Jump to content

VISA resource control always defaults to COM1


Recommended Posts

All,

I have this odd problem. I'm writing a VI that is supposed to accept input from two seperate serial ports. I am using the VISA Configure Serial Port VI in two different sub-VIs. One sub-VI should output a VISA resource name for COM1, while the other sub-VI should output a VISA resource name for COM3.

For some reason, though, whenever I start up my main front panel, both of the VISA resource names are set to COM1. I have to stop the VI, go into my second COM sub-VI and type in "COM3" for the VISA resource name input to the VISA Configure Serial Port VI, save it, and then run my app again. If I close it and reopen it and run it again, the same thing happens. My VISA Resource names always revert to "COM1".

Why is this and what can I do to make one sub-VI "take" the "COM3" setting that I specify and use it without me having to stop the execution and changing it manually?

Thanks for your time.

Link to comment

There are 2 things you can do to solve this problem

The first is to go the the control on the front panel set the value you want

and make it the default value.

post-584-1105725056.png?width=400

However I would recommend that you connect this control to an input terminal

and wire a constant to in in the calling vi. This method makes it easier to read the

code and easily allows the com channel to be changed later.

post-584-1105725080.jpg?width=400

Link to comment
There are 2 things you can do to solve this problem

The first is to go the the control on the front panel set the value you want

and make it the default value.

post-584-1105725056.png?width=400

However I would recommend that you connect this control to an input terminal

and wire a constant to in in the calling vi. This method makes it easier to read the

code and easily allows the com channel to be changed later.

post-584-1105725080.jpg?width=400

3525[/snapback]

Yes, I was considering adding a control to an input terminal of the sub-VI, but there are strict control restrictions on this app and there would be too many complications if a user could change the COM port on the fly: essentially it would be bad to do so, in this case.

However, the default value is my fix. Thanks! :thumbup:

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.