Command Prefix in C#

LK/ELK/VK/PK/OK/MX/GLK/EGLK/GVK/GLT Series

Moderators: Henry, Mods

Post Reply
PatO
LCD Geek
Posts: 27
Joined: Fri Sep 14, 2001 6:00 pm
Contact:

Command Prefix in C#

Post by PatO »

How do I send a command prefix (and other control chars) in C#? (using the ancient MSCOMM control)
In VB 6.0, this works -

Code: Select all

CP = Chr$(&HFE)
MSComm.Output = CP & "X"
I don't quite understand the theory behind what is being sent.
The MSCOMM control accepts a text string in C#. Not sure what it was in VB. Perhaps the encoding is incorrect... Is it an array? Is it a bit?
I'm so lost it's not even funny.
Please Help!

PatO
LCD Geek
Posts: 27
Joined: Fri Sep 14, 2001 6:00 pm
Contact:

Post by PatO »

Found it -

Code: Select all

int d = 0xFE;
char d1 = Convert.ToChar(d);
this.axMSComm1.Output = d1 + "X";

Post Reply