LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

wire or local variable?

Try putting your dequeue function before the case structure????  As it is now, the case structure essentially executes first ahead of the comparison function, so it is really operating on either the timeout or the command from the previous iteration of the while loop.

How were the error wires wired up?  Eliminating error wires should not help a program run better.  Though if you have an error and that is fed through the loop on a shift register, then once an error occurs, it will return to the beginning of the while loop and could cause problems with the execution of the next iteration of the while loop.  In those cases, ordinary tunnels would be better for handling the error wire.

Message 11 of 33
(2,316 Views)

if i have file path Control Varaiale.

t.PNG

I need to share my file location to many write function(Subvi)..

 

How to do this without local variable or Propert Node (Value).

 

If you Says local Variable is Not good ..

 

is there anyother solution LV has .

 

in C language (we are using Global Variable)

 

Here(LV) what to do?

0 Kudos
Message 12 of 33
(1,759 Views)
Your image shows exactly one subVI so your question is pretty ambiguous. Where are all these other subVIs? In different loops, in different states? Where is the path created? Front panel, another subVI?
0 Kudos
Message 13 of 33
(1,754 Views)

Hi ,

 

its in a different Loops in a same Vi

 

 

0 Kudos
Message 14 of 33
(1,749 Views)
And what about my other question?
0 Kudos
Message 15 of 33
(1,738 Views)

Where are all these other subVIs? In different loops, in different states? Where is the path created? Front panel, another subI

 

For yor questions , i have created Vi files ..

 

and shows Image and also attached Teswt Code.

 

TR.PNG

0 Kudos
Message 16 of 33
(1,732 Views)
That shows the subVI In different events and there is no need for locals or property nodes at all. Wire directly from the control. Get rid of the sequence structure as well. Your subVI should have error in/out connections that control execution order.
0 Kudos
Message 17 of 33
(1,723 Views)

okay thanks ..

0 Kudos
Message 18 of 33
(1,719 Views)

Also do not loop on the Numeric element. This loop makes no sense at all despite hogging one core.

Remove the "Stop" local variable and replace it with a wirde sourced by the stop button in the appropriate "Stop: Value Change" event.

Remove the value property nodes from "Numeric" and replace the reading node with the Numeric terminal (the element you currently have in the top loop) and create a writing local variable for writing values back in the Numeric element.

 

Norbert

 

EDIT: Just to clear things up for LV:

- The Wire is The Variable

- A node executes when all inputs provide valid values, once a node finishes execution it passes valid values to all of its outputs

Putting both items above together, you should learn to implement DATAFLOW. The wire is the best option to pass data (performance wise) and additionally defines order of execution in your VI!

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 19 of 33
(1,700 Views)

The other key idea you are missing is error checking. There are very many things wrong with the code you posted, but let's take one example. In the main loop you have two blue icons one is write and one is read. You are reading back data to make sure it changed -- which is curious logic in and of itself, but we'll let that go for now.

You have a sequence structure so the two actions run in the right order. But ask yourself this: If the write generates an error, why bother with the read? You already know the write failed! If you tie the write and read together with an error cluster you get simpler code that makes more sense logically.

In fact, if you check for and use errors the entire need for the read goes away. If writing to the INI file did not return an error the data is there. No need to read it back.

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 20 of 33
(1,673 Views)