Sending hex value with mscomm

A

Thread Starter

andreas

<p>I need to send ENQ which is 05h to the scale
anyone knows how to send a hex value with mscomm?
<pre>
mscomm.output = val(&H5) '? correct ?
</pre>
<p>thank you

<p>andreas
 
try this

mscomm.output = chr(5)

this statement is equvalent to sening ENQ. i have tested it with my application of time and attendance.
 
i m facing problem in sending hexadecimal commands to mscomm.ouput.i have tried all methods
i have tried sending hexadecimal values in a software for com port debugging.
like 01 09 00 00 00 00 F0 F8 07
 
Actually this is not a good way to do it. Because on MBCS (Multi byte character systems) such as ShiftJIS sending Chr$( >&H7F and < &H100) will always send a '?'. You should set up the MSComm control as binary and use byte arrays to send and receive data. To send just &H5 is
ReDim ByteArray(0)
ByteArray(0) = &H5
MsComm.Output = ByteArray

To send text: ByteArray = "Text to send"
MsComm.Output = ByteArray
 
Top