LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Change detection event

Hi Everyone,

 

I am using PXI 6509 DIO Card for Data Acq.

I want to use Event based techniques of Change detection rather than polling.

 

The application requires to generate an event when the digital line is High for more than 100 msec.

 

Change detection event gives me an event when the digital line becomes High to Low or Vice versa.

Can anyone help me how to achieve this???

 

Thanks a lot in advance.

 

Regards

Avni Vyas

0 Kudos
Message 1 of 6
(2,979 Views)

Hi Avni,

where do you have problems now? If you get the event, then you can create a timestamp and store it in a shift register. If you get the next event you can calculate the time between both event and run your code or not.

 

Mike

0 Kudos
Message 2 of 6
(2,965 Views)

Hi Mike,

 

Thanks a lot for your prompt reply.

 

Change Detection event will be given when the line goes from High to Low or Low to High.

 

Now for Example, We assume that we have captured the event when it goes from Low to High and recorded the time.

Next event will be generated when it goes from High to Low and I can calculate the time difference between them.

But I want to generate an event when the duration of the pulse being High is some fixed duration of time.

Cos the Digital line may be High for a longer duration, but I want to send a notification as soon the digital line is High for a fixed duration say 100 msec.

 

Thanks once again

Regards,

Avni Vyas

 

0 Kudos
Message 3 of 6
(2,956 Views)

Hi Anvi,

you can use a timeout. If the timeout occurs, then no new event was received, so the signal value is still high.

 

Mike

Message 4 of 6
(2,952 Views)

Hi

 

Thanks for the reply..

 

But I think that will not work, cos it will go in timeout as soon as that event is done.

The solution which I was thinking that we can start some timer as soon as we get the event, after the fixed duration, I will check the line again, if its still High I will consider it as a valid pulse else consider as a spike.

 

Please let me know, will this work.

Also one more query that if I have two lines going high at the same time, will that be captured by events or it will be lost??

 

Thanks a lot in advance

 

Thanks and Regards

Avni Vyas

0 Kudos
Message 5 of 6
(2,886 Views)

Hi Avni Vyas,

 

I think ur solution would work.

 

If 100ms waiting is not a big issue for your program, then, once the event occured, within the event case, you can just wait for 100 ms and read the line again. I guess this would be fine if u can create a separate loop for handling this particular event (or these types of events).

 

And as earlier suggested, you can set your timeout as 100ms so that after your event, there will be an event timeout 100ms later. So in the timeout event, you can check the line again.

 

Regards,

Deepu

 

0 Kudos
Message 6 of 6
(2,880 Views)