LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reconfigure RS232 VISA channel

Solved!
Go to solution

If I need to reconfigure a VISA channel (RS232) (baudrate, timeout, stop bit, etc) do I need to close the channel first and the reopen/configure it?

 

I am currently passing the already existing VISA reference into the configure VI and setting a new baudrate and timeout.  This currently seems to be working fine, but I wanted to make sure I am not setting myself up for hard to track bugs later on.  If anyone has experience with reconfiguring this way and has encountered problems, or knows this is a problem free way to reconfigure an RS232 VISA channel I would appreciate the feedback.

 

See attached screenshot for a visual

 

Thanks!

Message 1 of 8
(3,278 Views)
Solution
Accepted by topic author TitanLabview

No problem!

Really! you are just applying new property values to an existing VISA resource.  One of the benefits of no longer needing to use VISA open


"Should be" isn't "Is" -Jay
Message 2 of 8
(3,274 Views)

No.  You don't need to close the VISA resource before reconfiguring it.

 

If you open up the Configure VISA, you'll see it is just a subVI that basically wraps up a property node where all of those things are set.

 

Is there a reason you need to reconfigure it?  It seems very unusual to change settings on a serial port if you've already established communication with the device at the other end.  The only reasons I can see for doing it is if you are trying to poll a device to see what baud rate it is responding to, or if you programmatically change the baud rate of the device on the other end, thus you then need to reconfigure the baud rate on your end to continue with further communications.

Message 3 of 8
(3,272 Views)

Bill, I'd just about bet the device on the other end is from TotalPhase (that edge case you mentioned strikes a memory)


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

The reason for reconfiguring is the Com channel is being Muxed to 4 different channels to be tested and 2 are at one baud rate and other 2 are at another so I am placing the configuration in the SUBVIs that send commands to each channel in order to make sure they are communicating at the correct baudrate for each device.

 

Thanks for the explanation!

0 Kudos
Message 5 of 8
(3,263 Views)

That makes sense.  What is the mechanism for switching between ports in the multiplexer?  Does that work at a specific baud rate?

 

However, multiplexers seem kind of old school.  With the cheapness of USB to RS-232 converters, 4 of those seem like they'd be cheaper than 1 mulitplexer, especially when you throw in the extra trouble for switching between ports.

0 Kudos
Message 6 of 8
(3,246 Views)

The multiplexer is switched using two control lines that are switched using a multifunction DAQ card.  This is on a test jig/adapter for our production area so we wanted to cut down on as many cables as possible to reduce clutter and for simplicity.  (Simple for production, not as simple on the design end)

0 Kudos
Message 7 of 8
(3,215 Views)

Some other ideas that might simplify your programming.

 

I've used an ethernet based RS-232 server with multiple ports.  Connect the ethernet to the network, install drivers on the PC.  Each serial port on the device gets its own virtual com port and can have different settings.  Such as http://www.advantech.com/products/EKI-1524/mod_A50D438C-A4D5-47AF-B2D2-7BFC98059012.aspx  (I've used the 8 port EKI-1528)

 

 

Or some that are based on USB.  such as http://www.bb-elec.com/Products/USB-Connectivity/USB-to-Serial-Adapters/Panel-Mount.aspx

0 Kudos
Message 8 of 8
(3,208 Views)