Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

interrupts and the pci-6601

I have recently changed the i/o board that we use from the PC-TIO-10 to the PCI-6601. The PC-TIO-10 had an EXTIRQ line which would cause the driver to send a message to the owner application whenever there was a signal transition on the input. The PCI-6601 does not seem to have this ability. I am looking for a way for the driver to indicate that an input/gate has transitioned from high/low or low/high. Is there any way to alert a windows based application that this signal transition has occured at a particular input/gate of the PCI-6601. Any help would be appreciated.

Thanks,
Jack
0 Kudos
Message 1 of 4
(3,539 Views)
Jack,

Thanks for posting to the NI forums.  It is possible to achieve the same functionality that you saw with the TIO-10, however, the approach would be radically different.  The exact way you approach this will also depend on the programming environment you are using.  How are you planning on programming the PXI-6601?  Are you using LabWIndows CVI, VB, Visual Studio, LabVIEW, etc.?  In C you can use the DAQmxRegisterEventEveryNSamplesEvent to find out when the counter register has been read into the computer RAM.  In addition you can set the DuplicateCountPrevention property to true so the value of the register is only read when it has changed values.  This will cause an event with each pulse that is detected by the counter and seems to be very similar behavior to what you achieved with the TIO-10.  Let me know what programming environment you are using and I could provide a more suitable example.  Good luck with your application.

Regards,

Neil S.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(3,527 Views)

Hello Neil,

We are using Visual Studio. The application is written in MFC/c++.

Thank you,

Jack.

0 Kudos
Message 3 of 4
(3,525 Views)
Jack,

In MFC/C++ you could employ the method that I mentioned above.  You would make calls in this order:

int32 DAQmxCreateCICountEdgesChan (TaskHandle taskHandle, const char counter[], const char nameToAssignToChannel[], int32 edge, uInt32 initialCount, int32 countDirection);

int32 __CFUNC DAQmxSetCICountEdgesTerm(TaskHandle taskHandle, const char channel[], const char *data);  // set the source for the pulses

int32 __CFUNC DAQmxSetCIDupCountPrevent(TaskHandle taskHandle, const char channel[], bool32 data);

int32 DAQmxCfgSampClkTiming (TaskHandle taskHandle, const char source[], float64 rate, int32 activeEdge, int32 sampleMode, uInt64 sampsPerChanToAcquire); // set the clock source to the same PFI line as used for source of pulses

int32 DAQmxRegisterEveryNSamplesEvent (TaskHandle taskHandle, int32 everyNsamplesEventType, uInt32 nSamples, uInt32 options, DAQmxEveryNSamplesEventCallbackPtr callbackFunction, void *callbackData);  // set nSamples to 1 select a function that you want to run with each pulse.

int32 DAQmxStartTask (TaskHandle taskHandle);


Now each time a pulse arrives the program should call the callbackFunction.  This allows the program to be alerted when a pulse arrives.  Let me know if you have any questions about this approach.

Regards,

Neil S.
Applications Engineer
National Instruments



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