LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Access to VISA control from another VI

I have a VISA control (com ports) in a sub vi and I am trying access this control from the front panel of the main VI.  What is the best way to do this?

0 Kudos
Message 1 of 8
(3,234 Views)

The best way would be to pass the reference into the subVI via the connector pane.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 8
(3,229 Views)

@crossrulz wrote:

The best way would be to pass the reference into the subVI via the connector pane.


For scalability, you could use a typdef'd cluster containing all the ref's you're interested in - in this case, just one.  That way, you can add refs to the typedef'd cluster and you won't break your sub-VI.  To use it, it's just a matter of unbundling the ref's inside the sub-VI.  Very useful if you're building a complicated interface.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 8
(3,223 Views)

@Echoman wrote:

I have a VISA control (com ports) in a sub vi and I am trying access this control from the front panel of the main VI.  What is the best way to do this?


I would avoid that......................

 

Being a huge fan of "Code it Once" and a guy who hate looking all over a large project to debug I allways create a "Resource Module" (A special Action Engine the encapulates All I/O between LabVIEW and Anything else)

 

Of course, you should read Ben's Famous Community nugget

 

The callers need to know nothing about the RM's private data since it is only used to do I/O with this device so it is the not even wired

 

 

 

A quickie example is shown below: as well as a example use.

317.PNG

Event Loop 7.png

 


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

Dear Jeff , I use two loops acessing the same serial, someone said the action engine will solve the race problem, but I do not know how to program with action engine, will u please give me an example on VISA. thanks

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

zhm,

Those pictures in my last post are snipettes.  drag them to your desktop, open a blank block diagram, drag from your desktop to the diagram.  POOF! 1 each example provided!

 

P.S  I reciently "Jinged" a demo of this and FORGOT to tag the darn thing-  Search isn't great and my spelling is almost as bad as the search so, free Kudos to the poster who finds that darn link and posts it here (so I can go back and tag it)


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

@zhm0204 wrote:

Dear Jeff , I use two loops acessing the same serial, someone said the action engine will solve the race problem, but I do not know how to program with action engine, will u please give me an example on VISA. thanks


Please check your original thread for another suggestion.

0 Kudos
Message 7 of 8
(3,121 Views)
0 Kudos
Message 8 of 8
(3,095 Views)