Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Normal seriel commnication between PC and an instrument

Hi, I want to connect a water-chiller with a PC through RS232, The chiller's manual provides a table of ASCII command and a few rules. But I find if I use the VISA write.vi to write a string to the chiller, no error reported but the chiller does not follow my order. While I follow that VI with the VISA read.vi to get the bytes in buffer, there is a time-out error. I don't know why?
0 Kudos
Message 1 of 3
(3,163 Views)
Hi Tomas,

serial communication can be tricky, especially when using a device that is new for the programmer. What I'd suggest is:
1. Use Hyperterminal to interactively 'explore' the device and its behaviour.
1a set the proper comm parameters like baud rate, start/stop bits, parity and, if necessary, buffer size and flow control.
1b Interactively establish a stabile comm with that device. Start with some kind of ident commands, because those are usually returned immediately, while a 'chill' may take several minutes or even hours until it completes.
2. Try to use this setup and program a similar one using VISA.
3. Incorporate at least a basic error checking in your code.

There are several approved serial connection code examples availabel. Search for apropriate
key words, starting at LV examples, at the DevZone and maybe at www.searchview.net

HTH and Greetings from Germany!
0 Kudos
Message 2 of 3
(3,163 Views)
Hello,

You may simply need to include a termination character, as many instruments expect termination characters at the end of a command string. For example, if the instrument expects the linefeed character as a termination character, you would want to send a command of the form "TEMP?\n" instead of just "TEMP?", where the '\n' represents the linefeed character. You can include this termination character by simply typing the key, or include a termination character programmatically by using the concatenation function and string constants from the String palette.

Also, you may want to observe the number of bytes using a VISA Property Node, which can be found in the palettes by right clicking on a block diagram and selecting All Functions -> Instrume
nt I/O -> VISA -> VISA Advanced. See the attached screenshot for how to select the "Number of Bytes at Serial Port" property once you have placed the property node on the block diagram. You can use this to see if your instrument has responded to your command (if you expect a response).

Hope this helps!

JLS
Best,
JLS
Sixclear
0 Kudos
Message 3 of 3
(3,163 Views)