Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a Sub Vi, in a new Vi.

I am looking to add these different commands *in attachment* to a new vi, so that I can have them all running on one vi. i know there is a way to call vi's but i am having an issue with actually creating one, can i get some help with an example that i could replicate for the other 8-10 commands I have.

 

Regards

0 Kudos
Message 1 of 9
(3,372 Views)

If you want to run these VIs as sub VIs, you can drag and drop the icon of the VI (in the top right corner) and place it into the VI you want it to be called in. You can edit the pinout of the subvi clicking on the pin spot of the white grid, and then clicking on the front panel object you want that place to represent.

More detailed information on how to create subVIs can be found here:

http://www.ni.com/white-paper/7593/en/  

 

If you want to call the VI, there are multiple ways to do that beyond subVIs. 

Here is an article explaining the differences between calling a VI with an Invoke Node and a Call By Reference VI

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019MqkSAE 

 

-MichaelP

 

 

Message 2 of 9
(3,284 Views)

seems the second link is dead, can you send another one?

0 Kudos
Message 3 of 9
(3,274 Views)

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019MqkSAE 

 

This is the correct link, working on my end. If it still doesn't work, try searching for "Differences in Calling A VI with an Invoke Node versus a Reference Node"

0 Kudos
Message 4 of 9
(3,256 Views)

Hi PahIM,

 

Your links seem to have some garbage on the end (%C2%A0) that makes them invalid.  It doesn't show up in the display text but look at the html and you'll notice it.

 

Craig

0 Kudos
Message 5 of 9
(3,238 Views)

Craig, 

Thank you for pointing that out. If you copy the link and paste it into a browser it worked for me. Not sure why it adds that extra stuff to the end when I copy it. In any case, try the search I suggested and let us know how it goes!

0 Kudos
Message 6 of 9
(3,230 Views)

seems to be working just fine, i do have another question. I have created different commands, in different Vi's. I have essentially made a vi and called all the other sub vi's in to this one vi. Problem is when i have it running and i put a prob on the actual outputs it says it does not execute, when i look at the vi which command im using its actually displaying the command i used. How come i just cant seem to view the command in the consolidated vi?

Download All
0 Kudos
Message 7 of 9
(3,220 Views)

Hello, 

 

It looks like you have your subVI inside of a case structure, and you have a boolean command called "Run CMD" wired into the case structure that determines the case. So you are passing the value "True" or "T" into the case structure, so the structure is going to try to run the case called "True". However, the case you want is called "DynoDemand & Throttle". So if you want to run that case, you need to either wire an enumerated constant with that exact name (DynoDemand & Throttle" or change the case name to "True".

For case structures, the case name needs to be exactly the same if you want it to execute.

 

PahlM

0 Kudos
Message 8 of 9
(3,198 Views)

As for me http://www.ni.com/white-paper/7593/en/ instructions are rather clear to this topic.

 

Want to buy cheap essays?

0 Kudos
Message 9 of 9
(3,156 Views)