troubleshooting Question

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

Avatar of SynsorIT
SynsorITFlag for United States of America asked on
ProgrammingVisual Basic.NET
2 Comments1 Solution1222 ViewsLast Modified:
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.
ASKER CERTIFIED SOLUTION
SynsorIT

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros