10-06-2006 12:34 PM
10-06-2006 12:51 PM
If you want to send hex, change the display format of the string control/indicator. You do this by right clicking on it and selecting 'Hex Display'. In the normal display, if you enter 15, that is the ASCII characters '1' and '5' which is hex 3135. Another way to do this is to have a numeric array into which you enter the hex values. Create an array with U8 as the data type and set the format and precision to hex. Then you can use the Byte Array to String function and wire the output of this to the VISA Write. Doing a VISA Read, you can use the opposite function of String to Byte Array to get the numeric. Type Casting of the string can also be done. Search this board for 'hex' and you will find numerous examples.
Programming stop and start bits has nothing to do with knowing whether you have all of the data that is in the serial buffer. Start and stop bits assure you that each data packet is interpreted correctly. You would use the VISA Bytes at Serial Port to know how many bytes are available. Wire the output of this to the byte count input of VISA Read. When doing hex communication, be sure that you do not set VISA Configure Serial Port to use a termination character.