LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I initialize an empty array?

Absolutely agree with Altenbach.  You can't "skip" elements in an array.  The first one is zero.

I was looking at your code and I was trying to figure out what it does or supposed to do.  Why all the boolean shift registers to the left and they are all being ANDed together..  Are you trying to find if one single value is False?  Could you build an array ot the result and then use the "AND array elements"?

Similar question concerning the math. 

Just curious..

R

0 Kudos
Message 11 of 14
(3,898 Views)
Yes, to keep a history of the last 10 values, use an array fixed at 10 elements inside the shift register and replace the oldest value with each iteration. Now you can use "AND array elements" (for the booleans) or "ADD array elements" (for the DBLs) to get your desired output. Much less code and easier to debug!
Message 12 of 14
(3,896 Views)
Oh, i see. That does make more sense. I'm used to using Max+II so I'm biased towards shift registers. I'd be happy to answer any other questions about why I've coded it the way I have. I'm sure there are all kinds of things I could have done more easily another way, haha..
0 Kudos
Message 13 of 14
(3,859 Views)
Also, here is the code that I am actually using in my application-- I use this to take readings from pressure transducers on a friction loop. The other code that I had uploaded was the one I use at my desk to teach myself how to do things, which is actually just hooked up to a voltage source and a potentiometer that I play with. This one might make more sense to read.
0 Kudos
Message 14 of 14
(3,852 Views)