Can someone help me out here with a Serial Port question?
I am interfacing to a piece of equipment that has very strange and strict serial protocol requirements but I'm failing to interface to it because the code that I am outputting at the serial port is not the same as the code that I am sending to the port. To get the devices attention I need to send the hex character 8F, which should be followed by a string of standard ascii characters
Here is the code snippet that I am using
Dim tx as String
tx = Encodings.ASCII.Chr( 143 ) + "x050000000000050019999"
Serial1.Write( tx )
Serial1 has been configured to the correct baud, bits, parity, handshaking etc. and opened OK. When I connected a serial decode to the output I found that it was actually sending the following
00000 | 8f ef bb bf c2 8f 78 30 35 30 30 30 30 30 30 30 | ......x050000000
00010 | 30 30 30 30 35 30 30 31 39 39 39 39 | 000050019999
As you can see there is a rather strange set of characters before the 'x' which is causing the hardware to hang up.
I normally program in C/C++/C# and am fairly new to Xojo so I'm sure that it's something that I'm doing but I can't for the life of me figure what it is. I would normally use an array of byte to hold the data and send that when using C/C++ but there doesn't seem to be any way to do that.
Can anyone help?