LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Waiting for a Trigger Event in Software

Greetings:

 

I am new to LabWindows CVI.

I have a PCIe-6353 card connected to a BNC-2110

 

I have a device that creates pulses of a few usec in width.  I would like to create a function in LabWindows CVI to wait until the pulse occurs and than continue once detected.

 

Any ideas on how to create task to do this?

 

Thanks.

 

 

0 Kudos
Message 1 of 4
(1,464 Views)

Hello,

I believe this card is supported by niDAQmx. You should be able to find callback functions in the library to do what you want.

0 Kudos
Message 2 of 4
(1,424 Views)

Greetings:

 

I was able to get started based upon the niDAQmx card and BNC 2110 connected the the card.

 

TaskHandle triggerMeasurement = 0;
#define DAQmxErrChk(functionCall) if( DAQmxFailed(error=(functionCall)) ) goto Error; else

.

.

.

 

DAQmxClearTask(triggerMeasurement);
DAQmxErrChk(DAQmxCreateTask("",&triggerMeasurement));
DAQmxErrChk (DAQmxCreateDIChan(triggerMeasurement,"/Dev2/Port1/Line1","",DAQmx_Val_ChanForAllLines));
DAQmxErrChk(DAQmxCfgDigEdgeStartTrig(triggerMeasurement, "/Dev2/PFI1", DAQmx_Val_Rising));

 

What function can I call to know when the trigger has been detected?

 

Thanks.

0 Kudos
Message 3 of 4
(1,361 Views)

You could try examining change detection events in DAQmx: this paradigma triggers a function when a digital input changes its state.

Look into the examples that are installed in your system: you should find a useful sample in <CVIsamplesFldr>\DAQmx\Events\Signal\Change Detection\Read Dig Chan-Change Detection Event . You can also search for it in the examples finder (Help >> Find Examples... menu function inside CVI IDE: browse the tree to Hardware Input and Output/DAQmx/Digital Measurements)



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 4 of 4
(1,348 Views)