LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with SubVI

Hi all....I have developed one main VI and in that i m calling a subvi which counts the on and off time of the boolean switch...means whenever i switch on the boolean switch, it starts counting of the time it remains on and the same will be done when i switch off the boolean switch...so the problem is when the subvi starts running, my main VI is not showing output as per my subvi controls...even i can not control my boolean switch from main VI....I cudnt figure out what is the exact problem??? Is there any one who can help me??? I have attached my program...!!!

Download All
0 Kudos
Message 1 of 5
(2,650 Views)

Hope you need to aware of basic LabVIEW Functionalities and how it works.

 

1.State Machine Architecture and other stuffs.

2.Calling Sub VI's

3.Data Transfer between loops.

4.Avoid usage of Sequence Structures.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
Message 2 of 5
(2,620 Views)

Your biggest problem right now is a misunderstanding of Data Flow, the basis of LabVIEW.  A node cannot run until it has all of its data and it will not pass on any of its data until it has completed.  So when you call a subVI with specific data, that data is used.  You cannot change the input data while that subVI is still running.

 

But a simple solution for your current situation is to just use the Elapsed Time express VI.  Just make sure it is not set to auto-reset.  You can use one for the ON condition and a second for the OFF condition.


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
Message 3 of 5
(2,612 Views)

Thanks for the solution...but i have to develop timer for 32 boolean switches...in that case the code will become huge...& each boolean switch should run simultaneously...so how to use subvi in that case...???

0 Kudos
Message 4 of 5
(2,578 Views)

@rushi_federer wrote:

Thanks for the solution...but i have to develop timer for 32 boolean switches...in that case the code will become huge...& each boolean switch should run simultaneously...so how to use subvi in that case...???


No, he code won't become "huge". You can operate on an array of 32 booleans and the code will be about the same size as for one single switch.

 

You really need to do a few basic LabVIEW tutorials. None of your local variables or value property nodes are needed. Some of the other glaring mistakes have already been mentioned.

0 Kudos
Message 5 of 5
(2,572 Views)