cash drawer

vb6 Syria
  • 10 years ago

    Good day

    I require some help regarding a cash drawer. I want to open the cash drawer via my vb6 application but i do not know if i should use the ms comm control for this and even if, i dont know where to start with it. The cash drawer is using serial to connect to the pc. Can anyone help out with this? i would really appreciate it, have a great day :-)

  • 10 years ago

    Hi

     I am using the coding below to open a cash drawer in one of my applications. In "rsPosDefaults.Fields("CashDrawerCommands").Value" I enter the string to open the drawer, which in my case is a posifles, the code for this drawer is 7.

    'Com 1

    If rsPosDefaults.Fields("CashDrawer") = "COM 1" Then
    MSComm1.CommPort = 1
    MSComm1.CommPort = 1
    MSComm1.Settings = "9600,n,8,1"
    MSComm1.InputLen = 0
    On Error Resume Next
    MSComm1.PortOpen = True
    MSComm1.Output = rsPosDefaults.Fields("CashDrawerCommands").Value
    MSComm1.PortOpen = False
    End If

    'Com2

    If rsPosDefaults.Fields("CashDrawer") = "COM 2" Then
    MSComm1.CommPort = 2
    MSComm1.CommPort = 2
    MSComm1.Settings = "9600,n,8,1"
    MSComm1.InputLen = 0
    On Error Resume Next
    MSComm1.PortOpen = True
    MSComm1.Output = rsPosDefaults.Fields("CashDrawerCommands").Value
    MSComm1.PortOpen = False
    End If

    'Com3

    If rsPosDefaults.Fields("CashDrawer") = "COM 3" Then
    MSComm1.CommPort = 3
    MSComm1.CommPort = 3
    MSComm1.Settings = "9600,n,8,1"
    MSComm1.InputLen = 0
    On Error Resume Next
    MSComm1.PortOpen = True
    MSComm1.Output = rsPosDefaults.Fields("CashDrawerCommands").Value
    MSComm1.PortOpen = False
    End If

    'Com4

    If rsPosDefaults.Fields("CashDrawer") = "COM 4" Then
    MSComm1.CommPort = 4
    MSComm1.Settings = "9600,n,8,1"
    MSComm1.InputLen = 0
    On Error Resume Next
    MSComm1.PortOpen = True
    MSComm1.Output = rsPosDefaults.Fields("CashDrawerCommands").Value
    MSComm1.PortOpen = False
    End If

     If you need further help let me know.

     Regards 

     

  • 10 years ago

    Hi

    thanks for the help,i am using a posiflex as well. will implement and let you know. have a great day Big Smile!

    Regards

     

  • 10 years ago

    Hi Bronx

    the code worked, thanks!

  • 10 years ago

    'Com 1

    If rsPosDefaults.Fields("CashDrawer") = "COM 1" Then
    MSComm1.CommPort = 1
    MSComm1.CommPort = 1
    MSComm1.Settings = "9600,n,8,1"
    MSComm1.InputLen = 0
    On Error Resume Next
    MSComm1.PortOpen = True
    MSComm1.Output = rsPosDefaults.Fields("CashDrawerCommands").Value
    MSComm1.PortOpen = False
    End If

    how to use this code for c#.i am using this code in c#.but error is coming.

    any namespace is added to this code r which palce this code used.tel me

     

  • 10 years ago

    sorry buddy, no clue for c#. developing in vb6....ancient i know Smiley Face

    chow 

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“An expert is a man who has made all the mistakes that can be made in a very narrow field” - Niels Bohr