Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial communication the an RS232 device.

I have an RS-232 serial device connected to a computer. I have successfully talked to the device through HyperTerminal and I would like to have the device controlled through Labview. But, I can not get any of the example VI's to talk to the unit. The device itself is a custom built robot controller. Here are some example command strings:

"HMALL" - Home all axis.
"MV_XCAR" - Move the robot blade to the retract position.

When I type HMALL into HyperTerminal the robot responds properly, but I can't get Labview to send the commands? Does anyone have any advice to get this to work? I have included the PDF document that comes with the control unit. The last few pages have the command language using HyperTerminal.

Nick
0 Kudos
Message 1 of 3
(3,151 Views)
The manual doesn't state it, but most serial devices require a termination character at the end of each command. Hyperterminal does this by default. Try appending a CR or LF character (or both) and see if that works. You can do this several ways. If you're using a string control for input, turn on \ Codes Display and put \n (LF) or \r (CR) at the end of your string. You can use Concantanate Strings with the constants on the string palette. You can use the VISA Property node (see VISA Configure Serial Port) and add the property Serial Settings:Serial End Mode for Writes, enable it, and set the termination character to the correct hex value (0A = LF, 0D = CR).
Message 2 of 3
(3,145 Views)
Thanks for the help. I was trying a termination character of \n and it wasn't working. The \r did though.

Nick
0 Kudos
Message 3 of 3
(3,141 Views)