LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do you create an array?

(LabVIEW 6.1)  I have a while loop and within that while loop is a program that
 
I need to compare the present load with the previous load to determine the direction of the actuator (i.e. is it loading or unloading the specimen).  When it reaches the ends, it needs to reverse.  For example: If it's loading the specimen, when it reaches 10 pounds it needs to begin unloading and if it reaches 0 pounds then it needs to begin loading again.  It's easy to condition the ends, but it's when its in the middle that it gets confusing.
 
I think I need to use an array to simply store the previous value, check it with the present value, use it, then rewrite it with the present value.  All I need is a 1D array.  I can't seem to figure out arrays in LabVIEW and the array examples are not clear.
 
Any suggestions?
 
An alternate way to do it which, MIGHT BE EASIER and it would avoid comparing previous values, would be to simply run the actuator until it hits the end conditions and only at that time prescribe directions.  This could be done by writing the rising or lowering voltage (5V or 0V) to an array and if at the end, the array is rewritten and if not at the end the array remains the same.  Then at each loop the array value is called.  But still... I don't understand arrays.
 
 
>> The people in this forum are great!  All of the responses I get are really helpful and I really appreciate it.  I'm a new engineering grad student working in a lab over the summer and since not to many people here are familiar with labview, this forum has REALLY helped out.  Thanks! 
0 Kudos
Message 1 of 5
(2,963 Views)
that line should have been erased... "I have a while loop and within that while loop is a program that "  oops
0 Kudos
Message 2 of 5
(2,960 Views)
You don't need an array, just a shift register that contains the value from the last iteration. Take the difference to the current value and the sign will tell you the direction.
Message 3 of 5
(2,951 Views)

can you tell me where to find the shift register icon or is there an example of one somewhere?

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

There isn't an icon, just rght-click on the edge of the loop and select "create shift register". It shows up as nodes on the loop's two vertical edges. Check the help for examples on how to use them.

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

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

For help with grief and grieving.
Message 5 of 5
(2,940 Views)