One of my favorite tricks is to use a terminal program (such as Hyperterminal) to talk to an instrument and observe what is being sent back. Hyperterminal will allow you to change baud rates, termination, data bit settings, and other settings. Once you can successfully talk to your instrument, you can use those settings and feed them into VISA Configure Serial Port.vi.
Hyperterminal should allow you to test that the cabling and settings are correct.
Okay, I'll admit that I can't leave well enough alone, so here is a small VI in LabVIEW 8.5.1 that will configure the serial port for the Instek supply.
I was surprised to find that its serial port is 2400 baud and that the serial port is DTE. So you NEED a cross-over cable to talk to it.
It's been a while and my test system is temporarily out of commission.
I set the termination character and enabled termination. Does this not send the termination character after a send? I forget if it does or not.
Like mogusa, I'm also a begineer trying to use labview to read data off a modbus device via rs232. After reading this tread, I'm wondering if the basic serial read and write will really do the trick. I tried myself, but did'nt get any reading but probably because i didn't modify the termination character; i'm not sure how that works, can anyone help?
If you're using Modbus, you should really look at the NI Modbus libraries. http://sine.ni.com/nips/cds/view/p/lang/en/nid/201711
Why? They do use the serial write and read VI's underneath. But they also handle the formatting of commands and parsing of responses as well as the CRC-16 checksum bytes for you.
Thanks for your response Ravens. I have looked over the vis for the MB library, but i was suggested that the pre-made "advanced serial write and read vi." should do the trick. I tried the vi as it is with the corresponding setting for my device, but there appears an error of "timeout expires". Does anyone know how I can get the right timeout and rather this method really works? I only need to read the temperature off my rs232 device.
thanks, really appreciate your help.
This is a great article when starting out with MODBUS. As you can see there is a specific structure to a MODBUS message that must be followed in order for your device to understand and respond. This structure includes Address, Function, Data and CRCCheck fields..
Hope this helps.