11-18-2019 10:48 AM
Hello everyone,
I have to build with:
a kind of timer. When the first photocell is crossed by an object must start, and must stop when the second is crossed. I have seen lot of examples here with the start triggered, but always with a timed stop, not with a second hw trigger.
Can someone help me?
Solved! Go to Solution.
11-18-2019 01:00 PM
Sounds like a counter task configured for Two-Edge Separation measurement. The shipping example that refers to Pulse Width & Frequency actually *also* supports Two-Edge Separation measurement. The property nodes used to configure the terminals for the start and stop edges can be expanded to allow you to specify the polarities of each, as needed.
Further note that the counter channel will be one of the counters built into your chassis while the photocell signals will be specified as input pins of your 9423 device. Just be sure the photocell signal is conditioned to be compatible with your input module.
-Kevin P
11-18-2019 01:01 PM
Seems pretty straight forward to me...
I would monitor the photocells with a simple DIO input since all you need to know is if the beam is broken or not (on or off).
11-19-2019 06:45 AM
Thanks,
I've done as in the attachment (the 2 buttons simultaes the photocells) and it works.
11-19-2019 07:13 AM
What time scale and resolution are you dealing with?
Based on prior threads here, I kinda figured that the use of photocells implied that you'd want pretty fine time resolution and accuracy. The counter/timer task approach I suggested will give you resolution and accuracy in the sub-microsec realm. Using Windows and software timing queries will put your accuracy in the multi-millisec realm.
If you're measuring 5 second intervals and you have a 12 msec error, maybe no big deal. But if you're trying to measure much smaller intervals, the inaccuracy and uncertainty of software timing *may* be a big deal.
-Kevin P
11-19-2019 07:33 AM
You're right, but I'm not able to do this… Can I ask you some examples about?
Btw, the time intervals are around 1 s, the photocells delay is 1ms.
11-20-2019 01:28 PM
The example I referred to in msg #2 can be found in the menu at "Help-->Find Examples...", then choose "Hardware Input and Output-->DAQmx-->Counter Input".
-Kevin P