06-29-2010 09:10 AM
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"?
06-29-2010 09:30 AM
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
06-29-2010 09:36 AM - edited 06-29-2010 09:38 AM
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 connected
06-29-2010 09:42 AM
@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 connected
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
06-29-2010 09:47 AM
Sometimes a wire isn't the solution. - Hard for us LabVIEW geeks but truely proverbial
06-29-2010 10:00 AM
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.
06-29-2010 10:03 AM
When flow control is set to "none", shouldn't the RTS and DTS be left alone?
06-29-2010 10:03 AM
What version of LabVIEW are you running? And, peek into MAX> Software, what version of NI-VISA are you using?
06-29-2010 10:08 AM
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
06-29-2010 10:18 AM
@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.