03-27-2013 02:36 PM
I have an Alicat mass flow controller that uses a serial connection for read/write. I have the connection working in hyperterminal but we are updating our computers and aren't using serial ports any longer. I have a USb232 cable and am now trying to make the connection through labview. There are several specific hyperterminal settings required to get the device to communicate that I cannot find in labview settings. The device requires:
1. 19200 baud, 8 bit, no parity, no flow control (not an issue, can set these parameters)
2. Terminal emulation should be set to ANSI
3. Under ASCII setup
Send line ends with line feeds is NOT turned on
Echo typed characters locally is ON
Append line feeds to incoming lines is ON
When I connect through the basic serial.vi I get a timeout error and do not get any data from the device. In hyperterminal, the device info is polled by sending "A" to the device. Any help getting this device communicating would be appreciated.
Thanks,
Solved! Go to Solution.
03-27-2013 04:13 PM
The "ANSI Emulation" has nothing to do with the communication channel, that's specific to the client.
The LabVIEW SubVI's deal with the communication. Once you've got the channel set up with the baudrate/flowctrl/etc, the rest is up to you.
"Line ends with line feeds" is \r vs. \r\n.
LLooccaall eecchhoo shouldn't be necessary, but you could do the same thing with a concatenate-strings with your input and the output. It's just there for the operator's convienence when you're typing in commands.
Appending linefeeds to incoming lines can be done with a concatenate strings, stick a linefeed constant after you read the input.
Write an "A" to the visa session, read what's at the port, and see what comes back. Might have to loop it a time or two.
03-27-2013 04:26 PM
I have setup the VISA session with the channel parameters and sent an "A" to the device but I only get a timeout and no response. Now that I have no serial port I have to connect using TeraTerm, but I can talk to the device through that. None of these other settings are causing my failure to talk through VISA?
03-27-2013 04:57 PM
What's your code look like? Post that, might be something you're doing.
Another thing to try is sending/receiving the commands in MAX. If you can make it work in there, you can make it work in LabVIEW.
03-28-2013 08:05 AM
I am just using the Advanced Serial Write and Read.vi example. I have set the 19200, 8-N-1-N settings. I have turned off end write and read with termination characters, and am writing the string A/r. I have an input buffer size of 500 and set to 500 bytes to read with a timeout of 10000. I get a timeout error and no response from the device.
I have also tried to communicate through MAX and get no response. I do get a response when I talk to it through TeraTerm (no hyperterminal in Win7).
03-28-2013 09:21 AM
So, now I can get it to work through MAX if I use a lowercase "a" instead of capital. I also had to set Send EOS character CR (\r) and termination character \r. I am still getting the timeout in labview, however. I am not certain how to apply these EOS and termination settings using the provided labview termination character functions. Sorry, I am pretty new to serial communcations and am not familiar with the syntax.
03-28-2013 09:33 AM
Problem solved, I just have to turn on the end write and read with termination characters and set the hex value to D.