Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

More than one Callback with Change Detection on NI-6528

Hello,
 
is there a chance to get two change detection callbacks with the NI-PCI-6528 Card.
 
I have to detect two digital Signals with the card an I want to have to seperate callback funktions.
In this time i use one callback with changedetection (trigger on falling edge)  and read all data in and compare it with the last state
of my inputs and seperate the signals with a if condition. But this is not good!!
 
The Problem:
 
1. signal: every ~110ms (typically) a falling edge ( the time can change from 1s to 30ms)
2. signal: no spezificated time, but it occurs
 
the 1. signal is always present. When the 2. Signal is coming i will reading in from the serial port with the trigger of signal 1. When
the 2. Signal is coming again then the reading from the serial port stops since the next 2. Signaltrigger is comming. And so on.
 
The reading from the serial port takes 100ms per trigger. If the tigger of signal 1. is comming faster then 100ms i detect a fault and
dont read from the serial port.
 
My Question:
 
Can I do more than one Daqtask on the card, or, can i have more than one callbackfunktion in one Daqtask?
 
Thanks a lot and sorry for my bad english
 
0 Kudos
Message 1 of 3
(3,217 Views)
Mile,

i do not completely understand what you want to do but here is some information on DAQmx:
you can include both input-channels into one task and then configure the timing of the task to "1 sample (hw timed)". change the setting to "change detection" and configure it to react on both channels. this should, as far as i understood your question, settle your needs.

Norbert B.
- NI Germany
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 3
(3,205 Views)

Hello Norbert,

thanks for your answer.

I know, that more than one changedetectionline can put into one task, thats not the problem. At the moment i do it this way, but it is very slow. I mean,

if i only put one line into the change detection task, the time between fallingedge and execusion of the change detection callback is smaller than I put

two or more lines in one task. You can try it with just count a variable up (every falling edge of all konfigured change detection lines in the task) in the callback and

show the variable in a nummeric field. If two or more lines in one task it stops and hangs, with only one line it's a very fast count. The same frequenz on the line

you detect in both situations. The frequency of the second or the third line ( falling edges)  in the change detection does not matter, try one per minute.

 

Because of this behavior i want to have two tasks on this card with only one line per task?!? Always i try to config a 2. task i get errors.

Is there a chance to do this?

 

Mile

0 Kudos
Message 3 of 3
(3,196 Views)