09-09-2014 02:17 AM
I have a case structure in my program. I am using this to count the number of cycles in my experiment. I have a feedback node (image of the program attaced here) inside a case structure. I want the case structure to run only ONCE when the condition is 'TRUE". Every 'TRUE' represents each cycle. The problem I am facing here is that the case structure is continously running as long as it is 'TRUE' instead of running once and wait for the next 'TRUE'.
Temporaritly I am using a timer inside (as you can see in the image) to hold the program for the next 'TRUE' to come. I can hold like this only in case if I know exactly the time. Is it possible to make the case structure run only once when the condition become 'TRUE and wait for the next 'TRUE'? OR is there any other loop than the case structure which do this job?
Solved! Go to Solution.
09-09-2014 02:22 AM - edited 09-09-2014 02:24 AM
Hi aneps,
PtByPt_BooleanCrossing is your friend!
You really need to work on your problem analysis/description: You don't want to execute the Case as long as the input is TRUE, but you want to execute the case when the input changes from FALSE to TRUE!
05-24-2017 02:18 AM
Hello! Can you please tell me how to run the counter only for once? My counter keeps counting although I set the condition. Here's the attached file please find it. All I wanted is that, when the counter detects the rising edge of the digital button it starts counting till 400 samples (only for once). The problem is that It keeps counting again and again.
Thanks in advance,
Kind Regards,
05-24-2017 02:18 AM
Hello! Can you please tell me how to run the counter only for once? My counter keeps counting although I set the condition. Here's the attached file please find it. All I wanted is that, when the counter detects the rising edge of the digital button it starts counting till 400 samples (only for once). The problem is that It keeps counting again and again.
Thanks in advance,
Kind Regards,
05-30-2017 04:30 PM
Why are not you using the examples? I saw that your code is not for edges
05-30-2017 05:51 PM - edited 05-30-2017 05:55 PM
You should be able to do this with some simple logic.
If 'Input' is true, then allow 'Count' to increment.
If 'Count' is less than (or equal) to 400 then 'Trigger' equals true.
If 'Trigger' is true then record values.
Just chain all of that together and you have your VI.