LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

rs-232 works with teraterm but not labview

Hello,

 

I am trying to control a multiposition Valco valce using rs-232. If i just start TeraTerm and run the commands directly, the valve works as expected. However, when i try to use either the basic or advanced serial read write example vi, i get no response from the valve. I have also tried to use the NI MAX program with no results. The serial port for the valve should be set up as follows: 

 

Set the serial port at 9600 baud, no parity, 8 data
bits, 1 stop bit, no hardware or software
handshaking.

 

Im not sure why TeraTerm would work while labview does not when i am using the same exact settings. 

Any help would be appreciated

 

Thank You

0 Kudos
Message 1 of 15
(3,977 Views)
How have you set teraterm's termination characters and how have you done it with LabVIEW? What does the instrument require?
Message 2 of 15
(3,971 Views)

Thanks for the reply.

I have not set the termination characters for either teraterm or labview, i am just using the default settings for each program. Im not sure what termination the instrument requires it only states "no hardware or software handshaking" which i assumeed meant there should be no termination characters.

0 Kudos
Message 3 of 15
(3,963 Views)

In the manual for the unit, you will most likely see something like <CR> or <LF> or both after each command.

This means that you need a Carrier Return or Line Feed after each commend.

This is what Teraterm most likely is sending for you automatic.

Message 4 of 15
(3,950 Views)

Or when you type in your string and hit the Enter Key. That is when TeraTerm sends the line feed.

Omar
Message 5 of 15
(3,934 Views)

Just to make a small point that is often overlooked.

 

Two applications cannot access the same COM port.  So, did you close the teraterm connection before trying to use the COM port in LabVIEW?


"Should be" isn't "Is" -Jay
Message 6 of 15
(3,933 Views)

In the manual i found the following: "Carriage Return (OD hex) and Line Feed (OA hex) characters parse the communications by defining the end of each
command" 

So what would i enter for each command as part of the string in Labview?

0 Kudos
Message 7 of 15
(3,878 Views)

!1-1.png

Strings can show a display format.  All of those constants are <CR LF>


"Should be" isn't "Is" -Jay
Message 8 of 15
(3,875 Views)
Several ways. You have those constants on the string palette and you could use the Concatenate String function to add them to your command. You could click on your string control/constant and select '\' Codes Display and enter \r and \n. The basic serial example that comes with LabVIEW is set this way.
Message 9 of 15
(3,871 Views)

Thank you guys for all the replies, i finally got everything to work 🙂

0 Kudos
Message 10 of 15
(3,851 Views)