11-10-2016 10:22 PM
I've been trying for a couple of days to create a program using one signal to detect front edges and the times between them. I would like the times to be added to an accumulated output on the user interface if the time is above 2 minutes and 30 seconds. If the time between edges is less than 2 minutes and 30 seconds then the time is not added to the accumulated value and the timer resets. Attached are 2 time accumulator VIs I've created, but neither are outputting values.
Only 1 sensor shining on a reflector is to be used to accomplish goal.
Starting point:
When sensors beam is broken (rising edge) by unit 1, a timer starts
Scenario 1:
When the 2 nd unit passes through and breaks the beam (2nd rising edge) and the time between units was
less than 2 minutes and 30 seconds then the timer resets and starts counting the time between the 2 nd
and 3 rd units. This process will continue to repeat for hundreds of units.
Scenario 2:
When the 2nd unit passes through and breaks the beam (2nd rising edge) and the time between units
was greater than 2 minutes and 30 seconds then the timer will start collecting the time and adding it to
an accumulated value until the 3rd unit passes through and then scenario 1 or 2 will occur again.
Example incorporating scenario 1 and scenario 2
Unit 1 passes. Unit 2 passes two minutes later. Result = no time is accumulated. Scenario 1
Unit 3 passes three minutes later. Result = cumulative time of thirty seconds. Scenario 2
Unit 4 passes four minutes later. Result = cumulative time of two minutes. Scenario 2
Unit 5 passes one minute later. Result = cumulative time of two minutes. Scenario 1
So on and so forth. This will occur for hundreds of units.
11-14-2016 10:13 AM
Howdy bkg,
Your post gives a great idea of what you are looking to get your VI to do, but not much detail on “how” is isn’t working currently. Troubleshooting this should be an iterative process of confirming:
My recommendation for troubleshooting this is to just break it down piece by piece and make sure that every step of your code is outputting what you expect. Probes are your friend! Best of luck with this.
Thanks and have a great day,
Sam R.
Applications Engineer
National Instruments