LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RS-232 problems

Make sure you check the "Serial Communication Examples" in LabVIEW's help.
www.vartortech.com
0 Kudos
Message 10 of 18
(2,224 Views)
rohrdt wrote:

> 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

#########

Hi rohrdt,
maybe you could post the serial vi here (or mail it to me right away) and
will have a look at it.
I mainly use serial communication with RS-232 and RS-485, but only had
probs like this when I had an error in the vi.
One thing you could try, is to use a second computer connected to the
first one with a 0-modem cable. Use Hyperterminal on the second one and
simulate your instrument by fingers
trokes or a written vi.
Then you can see on the second computer what what comes across the line
from your first computer (I guess the first computer should send a kind
of data-request command, before your instrument returns data).

Oh, and another idea..., there are Break-out boxes available at
electronic shops with LEDs on it. They monitor the signal states and you
will see right away if there is some "life" on the handshake lines or
not. Then you would know if its worth considering handling of those
lines.

Let me know if this helps,
Rainer
0 Kudos
Message 12 of 18
(2,300 Views)
I'm not sure exactly what's going on, but the only thing I can think of is that for some reason RTS/CTS flow control is somehow being used and going into hyperterm is asserting RTS thus allowing data to flow when you return to LV. I recommend replacing your traditional serial vi calls with VISA calls. The VISA routines are much more advanced and gives you greater control over your serial port. Also, the traditional serial vi's have known issues that have been resolved with VISA.
0 Kudos
Message 11 of 18
(2,300 Views)
Some devices draw their RS232 levels from RTS and DTR lines of the computer port. These two lines must be asserted/unasserted a certain way in order to the device port to function properly. It happens that LabVIEW does not initialyze these lines the same way Hyperterminal does so the device won't function properly in LabVIEW unless you assert the lines explicitely after Serial Port Init.
Using a VISA property you set these line using properties under "Modem Lines Settings".

Using legacy serial VIs you set them using "serial line ctrl.vi" under vi.lib\platform\_sersup.llb (LV6). Location varies with LabVIEW version so make a search if necessary.

Try to Clear RTS and set DTR (or the opposite).


LabVIEW, C'est LabVIEW

Message 14 of 18
(2,300 Views)
Jean-Pierre Drolet, today I just tried your suggestion, and it worked. Thank you so much. I really appreciate you help.
0 Kudos
Message 15 of 18
(2,300 Views)
How do clear RTS? under Property Node (write) in VISA, what value should i set "Modem Line RTS State" and "Modem Line DTR State" to?

many thanks
0 Kudos
Message 16 of 18
(2,300 Views)
Create a constant/control from the property node. You'll have a ring where you can select Asserted and Unasserted.


LabVIEW, C'est LabVIEW

0 Kudos
Message 17 of 18
(2,300 Views)
Thanks JP!

Yes, it's a problem that I encountered.. (My solution was not as pretty..)
Message 18 of 18
(2,300 Views)