02-25-2010 12:05 PM
I have a case structure with 5 different cases and the case structure is inside a while loop which stops once any of the cases gets executed. This while loop is inside the major while loop which basically encompasses the entire module and stops when the STOP button on the front panel is clicked.
I need a way to count the number of times case no 2 is executed. Once this counter reaches 5, it should be reset to 0. Also, I don't know how to read this counter value in the major while loop because, I need to compare it to a timer. I want to have a timer in the major while loop which starts running as soon as the major while loop gets executed for the first time. What I need to accomplish here is, if either the timer reaches 15 mins or the counter reaches 5 (whichever happens first), I need to force my program to do some other action.
I'm just totally confused as to where to start. I did come across an example for a very similar problem in the knowledge base, but it is written in 8.0 version and am using 6.1. Any pointers in this regard would be greatly appreciated!!
Sukanya
02-25-2010 12:12 PM
02-25-2010 12:43 PM
02-25-2010 12:50 PM
Well, the first place to look is in the LabVIEW Help. There are also shipping examples. For LabVIEW 6, select Help -> Examples. This opens the Help file. One example that uses shift registers is in the Array Examples (the one called Separate Array Values). You can find others.
To learn more about LabVIEW it is recommended that you go through the tutorial(s) and look over the material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. You can also take the online courses for free.
02-25-2010 01:03 PM
use a shift register and put an increment in the true case and wire it to the shift register.
05-02-2013 10:09 AM
hi guys,
im using a state machine condition and i need to count the times my program executes a certain event so i can use the same count to index an array and change values. the problem is that if i use a shift register it holds the last value only for the next iteration and the event i want to count doesnt occur in a sequencial order. any idea how i can make that kind of counter.
05-02-2013 10:25 AM
@asnaev wrote:
hi guys,
im using a state machine condition and i need to count the times my program executes a certain event so i can use the same count to index an array and change values. the problem is that if i use a shift register it holds the last value only for the next iteration and the event i want to count doesnt occur in a sequencial order. any idea how i can make that kind of counter.
You need to wire the value through in the other cases. So then you are just passing the current value to the next. If using LabVIEW 8.6 or newer, there is a feature called Linked Tunnels. You just right-click on the tunnel and you will see an option to link it to another tunnel. There should also be an option to link and wire all of the unwired cases for you.