LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DTR state while port init

Hi,
I've remarked that the DTR line is moved while the serial port initialize. As I'd like it to stay in its position during this period, can somebody tell me wether it's possible or if it's built-in the init process?
If it's the case, how to modify this process?
 

Thank you in advance.
 
Bim
0 Kudos
Message 1 of 14
(5,899 Views)
What drivers are you using to access the port?  We have had good luck controlling the
handshaking lines directly with the older (compatability) serial port .vis in LV 6.1/7.1.1.

If you are using Visa, have you tried initializing the port with no handshaking?

Thanks.

Matt
0 Kudos
Message 2 of 14
(5,888 Views)
Usually, DTR comes from the device end (DTE), like a modem.  The computer is DCE, which asserts DSR and just looks at DTR.  The computer does not control DTR.  So if DTR is changing, it may be because the computer is bringing DSR high, and the device on the other end responds with DTR high.  Even with no handshaking, this may still happen.  Handshaking has more to do with RTS/CTS.  You can disconnect the serial connection and see if DTR still changes.  Why would DTR changing be a problem?  It is supposed to change when a connection is established.  Initializing the port will establish a connection if there is a proper device on the other end.
- tbob

Inventor of the WORM Global
0 Kudos
Message 3 of 14
(5,888 Views)

It's true that my application is not typical...

The fact is that I use the DTR line as a control (changing it from asserted to unasserted), independant from any RS-232 protocol. The device on the other hand is only hardware that acts in function of the voltage of the DTR line . So, if the DTR line changes while init, my device acts without my intention...

The only solution I'll choose (if exists!) is a software one, as the hardware is specific and non-modifiable.

Another question : You told about previous versions of serial communication VIs but I can't find them on LabVIEW 7.1, they are all VISA. So, is there a real difference between them and if true, where can I find the previous version?

 

Thank you in advance.

 

Bim

0 Kudos
Message 4 of 14
(5,868 Views)

In LV 7.1, it is buried in the property nodes.  First open a VISA session with COM1 or whatever (ASRL...).  Then look in the Function palette - Instrument I/O - VISA - VISA Advanced - Property Node.  Create a property node on the block diagram and wire it to the VISA session.  Then click in the property box and select Modem Line Settings - Line DTR State.  Change to write.  Right click on property and select Create Constant.  This will create an enum with the correct values for asserting DTR and such.

 

Message Edited by tbob on 11-09-2005 12:24 PM

- tbob

Inventor of the WORM Global
Message 5 of 14
(5,867 Views)

Thanks tbob,

But I already use this method to control the line state, I've also add the line control in the port config VI but it still switch the DTR line. I think the init of one of the parameter in the port config vi acts on the DTR state.

Maybe, we can remove one of the actions done while initializing the com port?

0 Kudos
Message 6 of 14
(5,859 Views)
Have you tried tbob's approach but skipping the visa open step?  Just wire the constant directly to the
DTR property node.  This works for us in 7.0.  We are not sending serial data, just  using the control
lines as I/O.

Matt
Message 7 of 14
(5,847 Views)

Thanks Matthew!

It works like I want ! Finally, to avoid the problem of init, simply avoid init !

Now, I'll know that the com init isn't compulsory if the serial protocol isn't required (that's it?)...

 

Thank you again.

 

Best regards

 

Bim

 

0 Kudos
Message 8 of 14
(5,839 Views)
Cool.  Glad it worked.  Thanks to tbob for the memory joggle.  Teamwork!

Matt
Message 9 of 14
(5,831 Views)

Hi,

I am using LabVIEW 8.0 VISA to communicate a device over the COM port.

 

The device requires that the DTR bit is set to low before sending any data to it and set to high before receiving any data from it.

 

So, would you explain how to set the DTR bit manually to high and low ?

Thanks.

Lev

 

0 Kudos
Message 10 of 14
(5,772 Views)