Link to home
Start Free TrialLog in
Avatar of SynsorIT
SynsorITFlag for United States of America

asked on

Magnetic card encoder MSR206 communication in VB.net with System.IO.ports

I am having some trouble getting our card encoder to receive commands with a vb program i have wrote.

I tried getting mscommlib to work but my research onthe interet shows this is all but non functional in .net 3 and above.

I am now trying to communicate with it through system.io.ports but cannot get the command to the encoder.  No error.  Also, I am able to get the included demo app to connect to the encoder on COM3.

The MSR206 book says
Command: All LED on
Command code: <ESC 82> <82>
Hex Code: 1B 82


here is the code i have so far.  Am i missing something?  I just need a bump in the right direction.  

Imports System.IO.Ports

Dim WithEvents mySerialPort As SerialPort = New System.IO.Ports.SerialPort
       With mySerialPort
            .PortName = "COM3"
            .BaudRate = 9600
            .Parity = Parity.None
            .DataBits = 8
            .StopBits = StopBits.One
        End With
        mySerialPort.Open()
        'turn leds off
        Dim test1 = Chr(&H1B) + Chr(&H79)
        mySerialPort.Write(test1)
        ' I also tried this with no luck
        'turn leds off
        ' mySerialPort.Write(Chr(&H1B) + Chr(&H79))
        mySerialPort.Close()

This is for writing employee timecards.
Avatar of SynsorIT
SynsorIT
Flag of United States of America image

ASKER

No help?  Please let me know if you require more information

Thanks
ASKER CERTIFIED SOLUTION
Avatar of SynsorIT
SynsorIT
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial