05-22-2024 11:17 AM
i created a counter using event structure. by pressing button it counts good.
now i want to modify it such that read signal from DAQ (IR Sensor) . as signal is hight, it should count as push button (replaced push button with output of DAQ.
But reading from DAQ not woring in loop so no counting.
Please guide.
i want to replace input button with daq output which is sensor signal. i dont have DAQ so can not place its block here.
please tell why DAQ signal not being read here. when i use seperate while loop DAQ signal is being read.
how can i modify this counter to count when sensor output is high?
Solved! Go to Solution.
05-22-2024 12:11 PM
Hi Asif,
@Asif138 wrote:
But reading from DAQ not woring in loop so no counting.
How do you know the DAQ reading does not work inside the event case?
On your counting problem: there is a "default if unwired" output tunnel at the event structure: as soon as any other event kicks in your counter value in the shift register is (probably) cleared…
05-22-2024 02:05 PM - edited 05-22-2024 02:06 PM
@GerdW wrote:
On your counting problem: there is a "default if unwired" output tunnel at the event structure: as soon as any other event kicks in your counter value in the shift register is (probably) cleared…
(Sorry, your snippet is too new, cannot look at the actual code.)
In addition, there should be no orange anywhere. counting is an integer process!
Also your count indicator should be before the event structure so it correctly resets to zero at the start of the program and before events got triggered (no local variable needed!). Your button should be latch action (again no local variable needed!) What happens to the count in other events. Is there one to decrement, for example?
If you have problems with DAQ, you should show that code! Event structures are typically for user interactions (yes, there are exceptions!), so just eliminate the event structure and poll you sensor at a reasonable rate and act accordingly.
05-22-2024 10:42 PM
Thank you for your reply.
My concern is to read IR sensor output in LabVIEW and count whenever it detects objects.
the counter works fine if i use push button and press it.
when replacing push button with IR output it is not working.
this issue was shared my one friends. i currently do not have DAQ. i worked on his computer and check it is not working with DAQ .
I have attached code 2020 version please suggest or modify it.
05-23-2024 01:01 AM
See if this can give you some ideas.
I recommend the learning resource listed at the top of the forum.
05-23-2024 06:06 AM
Thanks alot.