LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I need to increment through specific values during a ramping cycle.

I have a pop up panel at the begining of test that allows the user to input the current, time, etc.  So I have been using globals off this pop up panel to reference the entire program.  I guess I don't need the info in the array to be global if I make the array a global.  This is my first time programming in LabView, well to be honest really my first time programming anything functional.  I am a little green.
0 Kudos
Message 11 of 15
(626 Views)
Global variables are something that can cause major problems and should be avoided whenever possible. They create a copy of the data whenever used and because the break the dataflow that is at the heart of LabVIEW, you can have race conditions where you might be reading one before you have written to it. It's far better to pass the values from main to subVI back to main with wires. It's often tempting to use locals/globals to cut down the number of wires but try to avoid the tempation and clean up the wiring instead. Shift registers and certain programming techniques make this easier. Look at the shipping examples and some of the different design patterns (state machines, queues, event structures, etc.) to get ideas.
Message 12 of 15
(625 Views)
Thanks I will look at the examples you suggestes.
0 Kudos
Message 13 of 15
(619 Views)
When comming out of the for loop to an indication I get data type error:  The source1-D array and the sinktype is double, how do I fix this problem.
0 Kudos
Message 14 of 15
(613 Views)
This means that you're passing a 1-D array out and the indicator that you created is designed for only a single double value. You can fix this one of two ways.

1) Create an array type indicator (do this by placing down an array indicator, then placing a double indicator inside of this, OR by right clicking the tunnel that comes out of your while loop and selecting Create Indicator).

2) Index the array that comes out of the array using the Index Array.vi and send only one value to the double indicator.

Regards,
Matt S.

LabVIEW Integration Engineer with experience in LabVIEW Real-Time, LabVIEW FPGA, DAQ, Machine Vision, as well as C/C++. CLAD, working on CLD and CLA.
0 Kudos
Message 15 of 15
(599 Views)