LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

subvi transfer data and

Hi all

   My purpose that subvi scanning #1 SN toggle"Enter"key transfer to main vi active event and update SN,#2 SN toggle"Enter"key transfer to main vi active event and update SN,repeated that action,please help check it and how to optimized my code,

Download All
0 Kudos
Message 1 of 3
(2,033 Views)

Never ever attach VIs that are set to "run when opened"!!! That option should never be used anyway.

 

There is no main vi by any definition of the term. Your "active window" VI makes no sense whatsoever. Blatant overuse of local variables. Full or race conditions, missing toplevel loop, parallel event structures, stacked sequences, greedy inner loops, etc. etc. You need to learn about the basics of dataflow. This is not it!

 

If you want to complete SN entry with the enter key, set the string control to "limit to single line". Very little else is needed.

 

What is the program supposed to do? How it is used? I am sure it can all be done with 10% of the current code.

0 Kudos
Message 2 of 3
(2,024 Views)

Please don't attach VI's that are set to run automatically when opened.  And shrink the windows down to fit the contents of the front panel.

 

In the subVI, Enter should be a button, not a boolean push switch.

 

Why do you have two separate event structures on your main VI?  Just have your VI run your subVI,  (open when called, modal) and when it completes, pass out the values.  There is no reason to have any event structures in the main.  Unless you want one for a button to cause the subVI to pop up, in which case it belongs in the event case.

 

You need to go back to the tutorial to learn more about event structures.  It seems like you think that just writing a value to a terminal is going to cause the value change event to fire.  It doesn't.  The value change event occurs whenever the user changes the value of that control, or the VI programmatically triggers the event through the Value (Signalling) property node.

 

All of your boolean button handling and mechanical actions are wrong.  A press button should be set to Latch when Released on the front panel.

 

Here is a modified version of your code that is greatly simplified and works properly.

 

 

Download All
0 Kudos
Message 3 of 3
(2,005 Views)