LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial VISA read timeout

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:

turboVI.png

 

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?

0 Kudos
Message 1 of 17
(5,184 Views)

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.


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 17
(5,178 Views)

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

0 Kudos
Message 3 of 17
(5,168 Views)

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.


"Should be" isn't "Is" -Jay
Message 4 of 17
(5,156 Views)
What is the device you are trying to communicate with? Your command does not look correct for any instrument that uses the IEEE.488 standard id query.

Also, use the correct controls for parity and stop bits. You should have right clicked on the subVI and selected Create Control.
0 Kudos
Message 5 of 17
(5,154 Views)

@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.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 17
(5,128 Views)

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

0 Kudos
Message 7 of 17
(5,083 Views)

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

0 Kudos
Message 8 of 17
(5,076 Views)
Does the vendor provide a program that you can use? Have you used a terminal emulation program such as putty before jumping into the LabVIEW code? Have you verified that your cable is correct?
0 Kudos
Message 9 of 17
(5,065 Views)

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.

0 Kudos
Message 10 of 17
(5,052 Views)