LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RS-232 problems

I have a serial device that I'm acquiring data from. My LabVIEW vi will not read any data from the port unless I read the port first with hyperterminal. I not sure why.
0 Kudos
Message 1 of 18
(3,993 Views)
This sounds like a port initialization problem. Are you using the "Configure Port" VIs (either VISA or serial depending on how you are reading the port)? Check that the Configure VI has all the inputs with the correct values.

Rob
0 Kudos
Message 2 of 18
(3,993 Views)
Hey Rob, I'm using the Serial Port Init.vi. All of the settings are the same as they are in hyperterminal.
0 Kudos
Message 3 of 18
(3,993 Views)
Can you describe the steps that you have to take? Since two applications can not have the same port open at the same time, I'm curious as to the sequence you're using.
0 Kudos
Message 4 of 18
(3,993 Views)
Here are the steps I am doing.
1) Run my vi. The vi initializes, reads, then closes the serial port.
2) Since LV isn't recieving data I open and connect to the port with hyperterminal. After seeing the data from hyperterminal I disconnect.
3) Then I restart my vi, and I can see the data from LV
0 Kudos
Message 5 of 18
(3,993 Views)
Are you using hardware flow control? If this is the case then you should use VISA for serial communication, as the traditional serial vi's might have some problems setting hardware flow control.
0 Kudos
Message 6 of 18
(3,993 Views)
I don't have anything wired to the flow control terminal on the Serial Port Init.vi
0 Kudos
Message 7 of 18
(3,993 Views)
Is your hardware expecting flow control to be turned on?
0 Kudos
Message 8 of 18
(3,993 Views)
No, and I am not using flow control with hyperterminal either.
0 Kudos
Message 9 of 18
(3,993 Views)
If you don't already have one, connect an indicator to the error code out of the initialize VI (and other serial port VIs) and see if the VI is having trouble initializing the port. Step through the program and try to find out where the problem is coming from. Compare these results to the "after hyperterminal" results to see if there are any differences.

If you aren't already using it, use the Bytes at Serial Port VI to make sure that there is something to read before reading.

Some instruments require proof of connection (send a single CR to it) before they will send data. Give this a try.

To those saying to use VISA: Using VISA is not always a possibility. We have 3 different GPIB c
ards in computers and some of them will not work if NI VISA is loaded. So we use the serial port VIs constantly.

I hope these suggestions will help in finding where the problem is occurring.

Rob
0 Kudos
Message 13 of 18
(4,069 Views)