05-29-2015 11:55 AM
So I'm trying to communicate with a device via RS232 serial, and only getting VISA read timeout errors. At first the port validation in MAX returned an error, but updating the USB/COM device's drivers fixed that so now it validates successfully, but still only gives timeout errors on read. I've checked that the port settings I use match the device (manual is here, checked that settings on device are factory default, relevant info on page 57/B110 onward).
This is the VI I'm using:
The 'string in' field is in \ codes display mode, I realised that this screenshot shows doubled up termination characters (due to the termchar settings and string), but fixing that is not the source of the error. Anyone have any ideas?
05-29-2015 12:14 PM - edited 05-29-2015 12:16 PM
the correct term char for the device id 0x0A and SHOW display styles and radicies on controls and indicators. your string in contains CR/LF and send term char is TRUE so CR/LF/CR is actually sent and the command is rejected by the device and device properly does nothing.
Also, with term char enabled you want to set Bytes to Read largeish so you read the term char every time.
05-29-2015 12:32 PM - edited 05-29-2015 12:32 PM
Sorry I didn't make it clear enough, but I was aware of that issue with the string already, sending the same string with the term char boolean off does not help. Good point on setting the the bytes to read to a large value, I hadn't thought of that issue and was just trying to get something out. I'm pretty sure 0xD is the proper term char though? the manual states that CR is compulsory and LF is not, CR is ASCII 13/0xD and LF is ASCII 10/0xA, correct?
Thanks
05-29-2015 12:45 PM
the read will end cr lf and you only get one term char. so keep it really simple and use LF or you will leave that LF in the buffer to start your next read and (trust me ive seen this) your string indicator (set to one line high) appears blank.
05-29-2015 12:46 PM
05-29-2015 02:27 PM
@JÞB wrote:
the read will end cr lf and you only get one term char. so keep it really simple and use LF or you will leave that LF in the buffer to start your next read and (trust me ive seen this) your string indicator (set to one line high) appears blank.
Don't forget to strip the white space off the end.
06-01-2015 06:22 AM
It's a turbopump controller that doesn't use standard commands, the command list is in the manual I linked in the original post. Changing parity, flow control, stop bits, and termination to their proper controls did not change anything.
Thanks
06-01-2015 06:27 AM
Well at the moment it's not reading anything, it times out beforehand. I understand that there's only one termination character, but the manual leads me to believe this device requires a carriage return at the end of a command. If the LF were in buffer for the next read it would still show something other than 0 in bytes read, correct?
Thanks
06-01-2015 07:23 AM
06-01-2015 09:45 AM
There's no vendor program or labview driver that I'm aware of or can find, I've resistance checked the cable pin by pin with a multimeter, and I've used the port with another serial device so I know that it works. I've tried using the basic I/O on the VISA test panel in MAX to do things and get the same issue (nothing but timeouts on read, and if I try to write a setting change to the device then walk over and check it manually it is unchanged). Trying to connect with putty (making sure I give it the correct settings) just gives me a black screen with a green square that I can't enter any input on. There's an identical unit beside the one that I want to connect with that I have also tried accessing all of these ways and I get the same non-response in every case.