LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview VISA Open/Close Session Asserts Serial DTS

I am attempting to communicate with an Arduino microcontroller via a USB virtual serial interface. I have noticed that a call to VISA Open/Close Session asserts the DTS pin on the serial interface. This is a problem for the Arduino, because asserting DTS causes the microcontroller to reset, making it unavailable to send or receive commands for a few seconds. Is there some means to override this behavior of "Open Session" and "Close Session"?

0 Kudos
Message 1 of 14
(4,381 Views)

Did you try

 

Property >>> Serial Settings >>> Modem Line Settigs >>> ....

 

to control that line?

 

Do you see the same from other serial ports?

 

Have you looked at the default setting the OS applies?

 

Don't know if any of the above helps but those are the ideas I had.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 14
(4,371 Views)

17653iB3EBD9A5ABD0CE3E

You have a few options that will control the state of the hardware handshaking lines.  The first is to use the "VISA configure serial port.vi" buried very deeply on the palettes at Instrument I/O> VISA> Advanced> Bus specific> Serial sub palette.  This vi uses a inst class VISA session and is NOT polymorphic but if you want this class of session it is the easiest method. 

 

A second option is to use a property node to write the "Flow Control" property.  This works for any session class (and is a good way to "Peek" at the line states too!)

 

And a third option exists in hardware.  Simply construct a serial cable with only 3 wires RX, TX and GND at pins 2, 3, 5 or 3, 2, 5 depending on if the equipment is DTE or DCE.  Its really hard to assert a signal (like DTS) that is not connectedSmiley Wink


"Should be" isn't "Is" -Jay
Message 3 of 14
(4,366 Views)

@Jeff Bohrer wrote:

...

And a third option exists in hardware.  Simply construct a serial cable with only 3 wires RX, TX and GND at pins 2, 3, 5 or 3, 2, 5 depending on if the equipment is DTE or DCE.  Its really hard to assert a signal (like DTS) that is not connectedSmiley Wink


Ahh yes, the hardware solution, where cutting a wire fixes things.

If the BD is viewed as a box then that suggestion is truely thinking outside the box.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 4 of 14
(4,360 Views)

Sometimes a wire isn't the solution.  - Hard for us LabVIEW geeks but truely proverbial


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 14
(4,356 Views)

That does allow me to explicitly control the DTS line, but only after the VISA session is already open. After further experimentation, it appears that the problem is really with Close Session asserting DTS.

0 Kudos
Message 6 of 14
(4,348 Views)

When flow control is set to "none", shouldn't the RTS and DTS be left alone?

0 Kudos
Message 7 of 14
(4,343 Views)

What version of LabVIEW are you running? And, peek into MAX> Software, what version of NI-VISA are you using?


"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 14
(4,342 Views)

I wonder it there is a "Don't do that!" hidding in this question.

 

You aren't opening and closing VISA ports repeatedly are you?

 

Re: should?

 

????

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 9 of 14
(4,337 Views)

@Jeff: LabVIEW 8.5.1 and NI-VISA 4.3

 

@Ben: Opening a serial port in LabVIEW generates a lock on the port. For my particular application, I don't care so much, so I could keep the port open and then make the VI keep track of the VISA session state to deal with first-run issues. And if there isn't a way to change the behavior of VISA Close Session, that is what I'll have to do.

0 Kudos
Message 10 of 14
(4,328 Views)