Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

how to include value change from "daqmx read.vi" as an event in event structure without trouble

Hi this question might be a bit specific, but I'm having trouble combining the two programs below. The "digital testing 2.vi" is programmed for a light sensor, which output true or false and trigger an digital led. The second program is used for recording the timestamp and the count for each time u use boolean switch. I'm trying to add the programming for the timestamp and the count to the sensor program, but with no success. I thinks the problem occur when I included value change from the "daqmx read.vi" as one of the event in the event structure.

 

Thanks a lot, any suggestion is appreciated.

 

charledepper

Download All
0 Kudos
Message 1 of 4
(4,577 Views)

I forget, the problem to the program after I integrate the second program, is that the digital led indicator for the first program stop working, even though I have input a "5 volt" wire into the port of the daq continuously.

0 Kudos
Message 2 of 4
(4,574 Views)

The immediate problem I see is that you have two while loops with no "wait" timers in them. Add a fixed time delay to each main while loop, say 100 ms., and give it a try.

 

Dave

0 Kudos
Message 3 of 4
(4,566 Views)

I don't think the event structure is going to work for you here.  I would just is a single loop to read the DI and process it as needed.digital input value change.png


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 4
(4,562 Views)