Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

why do i get the VisaRead time out error ?

I'm trying to interface a shutter control unit using a RS232C .I'm getting a read time out error.I'm using LABVIEW,->serial.vi.I tried giving the termination character to my command.But its still not working .The command format is as follows :
[A][BBB][C...C][CR]
[A]: Command identifier (one lower case alphabet ,ASCII code,one byte)
[BBB]: command name (three upper case aplhabet characters ,ASCII code,three bytes)
[C..C]: Parameter(ASCII code)
[CR]:carraige return(0x0D)

i run the follwing commands in LABVIEW<->serial.vi:
rTSW
rTSR
and i'm getting the time out expired error.i'm even tried gving "\n" rTSW\n etc..but still i get the same error.
Any help in this reagard is appreciated.
0 Kudos
Message 1 of 5
(3,382 Views)
Did you modify the string control called String To Write to '\' Codes Display by right clicking on it? If you didn't, you are sending the characters "\" and "n" and not the carriage return.
Message 2 of 5
(3,381 Views)
Hello Dennis,
I appreciate in u taking time and answering the question.
I tried the follwing options:

1.I sent the string rTSW and changed the string control to "\" codes display.
2.I'm sending the string in rTSW\n in "\" codes display.
3.I changed the second option to normal display.
4.I sent the string rTSW\n and changed the string control to "\" codes display.
In all of the above i get the same error.

Any help in this regard is appreciated.
Once again thanks for your time and effort.
0 Kudos
Message 3 of 5
(3,382 Views)
I didn't pick it up in your first posting but \n is a line feed and not a carriage return. The correct code for carriage return is \r. One way to avoid any confusion is use the constant on the string palette and use the Append to String function to add this to any command you want to send. You can also modify VISA Configure Serial Port to automatically send a termination character on writes. Add the property Serial Settings:Serial End Mode for Writes. If you do this, you need to specify the hex value of the termination character. For a CR, this is 0D.

If this doesn't fix your problem, have you successfully communicated with the device using hyperterminal? If you can, that will at least tell me that the cable and commands are correct.
0 Kudos
Message 4 of 5
(3,382 Views)
Hello Dennis,

I concatenated the "carriage return" constant on the string palette to the string to be written to VISA WRITE.And this worked.I greatly appreciate your time and effort.
Thanks ,

Rajesh Sannareddy
0 Kudos
Message 5 of 5
(3,382 Views)