05-18-2006 05:46 AM
05-18-2006 06:30 AM
Looks like hex communitaction to me. This is not ASCII so you will not get back readable characcters unless you convert them and they still may not be readable. Use the String to Byte Array Function to see if they make any sense and consult the ASCII Table.
Matt
05-18-2006 06:42 AM
hi there
i bet there's something wrong with the serial port settings
- Enable Termination Char (T)
- Termination Char
- data rate
- data bits
- polarity
- stop bits
you can adjust these settings with the "VISA Configure Serial Port.vi". please check if the settings are correct.
you wrote "However if I use AComPort to read one byte at a time (rather than a string) I get the correct numbers", so try 8 databits, 1 stopbit, no parity and disabled termination character or see the documentation of AComPort .
05-18-2006 06:46 AM
05-18-2006 06:57 AM
Thanks, the string to byte array conversion works fine, although I'm still not certain why the characters look odd. Exactly what format are they in?
Incidentally, if I want to write two 8bit numbers what is the best way of doing it. If I create a string from '255' and '32' will I have to pad them out with zeros to '255032' ?
Thanks again
Emrys
05-18-2006 07:07 AM
Assuming it is Hex, use Byte Array to String to Send Characters. What exactly are you talking to? Is there a manual?
Matt
05-18-2006 07:29 AM
The hardware for the serial communication was custom built to write seven bytes and read thirty-two. There is no manual but I know the guy who made it and so can ask him. I'm sure its not using Hex values but if the string-byte conversion works then I'm happy to use it.
Thanks
Emrys