Avatar of SynsorIT
SynsorIT
Flag 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.
Visual Basic.NETProgramming

Avatar of undefined
Last Comment
SynsorIT

8/22/2022 - Mon
SynsorIT

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

Thanks
ASKER CERTIFIED SOLUTION
SynsorIT

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck