LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do you pause a shift register?

Solved!
Go to solution

Hi,

 

I have vi that uses shift register to modify a value with each iteration of the WHILE loop.  However, I do not want the value to be modified on every iteration.  There are some cases where I want the value in the shift register to remain fixed as the other operations in the WHILE loop execute during subsequent iterations of the WHILE, and, then, at some time later, I want the value in the shift register to resume being modified.

 

For example, in the attached sample code, a value of "2" is added on each iteration of the WHILE loop.  Also, at each iteration, the LOOPER value is multiplied by 10.  Suppose I want the shift register to increment by 2 only if the INPUT is greater than 1000, and the INPUT is known to fluctuate above and below 1000.  When the INPUT boolean is TRUE, I want the shift register to increment by 2, but, if it is FALSE, I want the other function in the WHILE loop to continue executing, but, I want the SHIFT register to hold the last value and act on the last value when the boolean becomes true again. 

 

For example, if the boolean is true we would see these values in the SHIFTER and LOOPER indicators, respectively:

 

2, 10

4, 20

6, 30

8, 40...etc.

 

If the boolean is true, false for 3 iterations, and then becomes true again, I WANT to see something like this...

 

2, 10

4, 20,

6, 30

8, 40

   , 50

   , 60

   , 70

10, 80

12, 90

14, 100

 

Is it possible to pause (and resume) the incrementing of the shift register, without interrupting the execution of the other functions in the WHILE loop?  I tried with a case structure, but,...  couldn't figure out a way to put it together.

 

Thanks,

 

Download All
0 Kudos
Message 1 of 11
(4,412 Views)

Hi dav2010,

 

can you please attach your code in LV2012.

 

Thankyou

0 Kudos
Message 2 of 11
(4,407 Views)

How do you do that? I select "SAVE FOR PREVIOUS VERSION" and select 12.0,  but, it creates a new folder, and then, when I check the PROPERTIES of the newly saved vi, it tells me that it is 2013 same as the original file I attached to the forum board.  Very confused.  Is there something else I need to check?

0 Kudos
Message 3 of 11
(4,393 Views)

It sounds like a classic case of a case statement (pardon the pun). Have a case statement, pass the shift register through it for one state, modify it as you wish in the other(s). If the state is >1000, then a simple boolean check, with the "greater than" function, wired to the case.

Message 4 of 11
(4,379 Views)

Hi dav2010

 

i think you are following the right procedure, yes it creates a new folder that depends on you can also use the same folder to save by using current folder option but anyways creating a new folder is also not a problem, you can try once more to save it in previous version and this time don't open it in your pc which contains LV2013, on other side you can also attach a snippet of your code .

0 Kudos
Message 5 of 11
(4,378 Views)

You actually did save it on another version.

I use LV 12 and tried the "save for previous version", when you ask for the properties the window just shows the default program you use for opening LV, in your case 2013

See attachments below for screenshot, in this case i tried to open it with LV8

---

UnCertified LabVIEW Student
Mistakes are for learning, that's why suggestions are always welcome!
0 Kudos
Message 6 of 11
(4,376 Views)

OK, I think that this is the version 12.  Also, here is the block diagram in pictorial form, very simple.

 

 

Download All
0 Kudos
Message 7 of 11
(4,318 Views)

As was said before, wrap a case statement around the "increment by 2" (or any other modifications to the shift register value) and have the case(s) selected by what ever you choose, in this case the input being > 1000.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 8 of 11
(4,315 Views)

Or maybe this is the version 12.  I tried it several times, and it is very user-unfriendly and confusing.  This one appears to say source "12.0"

0 Kudos
Message 9 of 11
(4,314 Views)
Solution
Accepted by dav2010

Your most recent was in LabVIEW 2013. Have you tried the suggestions of how to solve the original question?

 

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 10 of 11
(4,301 Views)