LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sequential frames not working

This is my goal:

I have 4 numbers

lets say : 3,4.3, 6,1

I start from level 2 let's say

I want to first 

3 - 2 ( starting level)  = 1 

Then for integer numbers send 1 x 20 digital signal ( so 10 true)

then wait 5 second then read the next number so

4.3- 3 ( previous number) = 1.3 ( so 1 integer part, .3 float part)

send 1 x 20 ( integer part x 20) + 3 ( float part) x 2 = 26 times ( 13 true)

and wait 5 second

then next number

I want this pattern be read 5 times

 

the problem is it only reads the last two elements of the array. if I run the first frame that reads the element separately in another vi it works perfectly but not here..any idea why

0 Kudos
Message 1 of 13
(3,882 Views)
  • Reduce it to a simpler problem without DAQ and shorter times. Just use a front panel LED.
  • You still don't initialize the shift registers
  • Place reasonable values into the controls and make them the default before saving
  • Some of your subtractions can result in a zero or negative number and the innermost loop will not iterate at all for these.
  • You use floating point numbers in your example above, but iterations need to be integers.

 

 

0 Kudos
Message 2 of 13
(3,850 Views)

UGHHH I attached the wrong file..here it is

0 Kudos
Message 3 of 13
(3,846 Views)

Please give your file unique names. I am already up to "test(15).vi" in my downloads folder.

0 Kudos
Message 4 of 13
(3,843 Views)

sorry..here it is

0 Kudos
Message 5 of 13
(3,840 Views)

Any clue ?

0 Kudos
Message 6 of 13
(3,818 Views)

Sorry I won't be near a computer for a while ...

0 Kudos
Message 7 of 13
(3,811 Views)

What are reasonable values for the "Pattern" array (currently it is empty). Your VI uses 100% CPU when not doing anything. Are you sure "switch until released" is the correct mechanical action for the "Run" button?

Shouldn't the "Pattern" array autoindex on the outermost FOR loop? Your code in the true case completes in nanoseconds, so you won't see anything interesting. Should't there be some delays?

 

 

0 Kudos
Message 8 of 13
(3,787 Views)

You are right about the switch . Wrong choice 

I even added 5 second time delay and still nothing happened 

I tried to rewrite it with a state machine instead . I feel kind of dumb ! If I want it to run sequentially should I pass the next state to the shift register ? Then how can I pass the values too ?

0 Kudos
Message 9 of 13
(3,784 Views)

Again, what are typical values for the "Pattern" array? I cannot test with an empty array.

 

How are you running this? What do you expect to see?

0 Kudos
Message 10 of 13
(3,769 Views)