LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial communication with a null modem

I am trying to communicate with a serial device from my PC. I believe both the PC and device are DTE instruments, and I must use a null modem cable. When I use Hyperterminal to write a command to the device, I read back the expected response string. When I use the VISA Write/Read VIs, no matter what string I write, I read back the exact same string that was sent (even if it is an invalid command). Sounds like a loopback condition, but not sure why the communication works correctly with Hyperterminal but not with LabVIEW...
0 Kudos
Message 1 of 5
(3,924 Views)
It will be nice if you could include your code so we can take a look at.
But these are some things that I could think of on top of my head:
1. Before read and write serial port, have you properly “VISA Configure Serial Port”? (baud rate, data bits…etc). One thing that could trick you here is the termination character, set as Line Feed as default. If your device does not take that, it could cause errors.
2. Both VISA read and write has the option to “do I/O synchronously/asynchronously” (the latter being default), which you will need to have the correct mode for VISA section to function.

I hope this helps,

FightonSCtrojan
0 Kudos
Message 2 of 5
(3,924 Views)
I have necountered this when the RS232 interface of the device wasn't properly powered. The echo you receive is the noise pickup between RX and TX lines.
Some (battery powered) devices need that their RS232 interface be powered by RTS and DTR lines from the computer. HyperTerminal does clear RTS and set DTR lines. Initialyze the serial port with VISA (no hardware handshaking) and use VISA property "Modem Lines settings" to assert RTS and DTR correctly.


LabVIEW, C'est LabVIEW

0 Kudos
Message 3 of 5
(3,924 Views)
A couple things:First, what is the device that you ae trying to talk to? I have seen devices that require certain signals to be active for them to respond to commands.Second, does the loopback still happen when the serial cable is disconnected from the device? If the loopback goes away when you unplug the cable that's a good indicaion that a port parameter is bad.Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 5
(3,924 Views)
Thanks for the suggestions. Turns out that the device with which I am communicating was waiting for a Carraige Return character before it would respond. Adding the Carriage Return character to the end of the command string I send takes care of the problem...
0 Kudos
Message 5 of 5
(3,924 Views)