05-26-2010 05:31 AM
Dear John,
Thank you for the help! Now I managed to get the analog trigger example working. For our original task an Edge triggering can be fine, I only thought for one given treshold, and making a digital output from it.
I couldnt get the DAQmxExporSignal working for some reason, but DAQmxConnectTerms works:
DAQmxClearTask(AITrigTaskHandle);
DAQmxCreateTask("AITriggerForZwick", out AITrigTaskHandle);
DAQmxCreateAIVoltageChan(AITrigTaskHandle, "Dev1/ai4", "", DAQmx_Val_RSE, -10.0, 10.0, DAQmx_Val_Volts, null);
DAQmxCfgSampClkTiming(AITrigTaskHandle, "", 10000.0, DAQmx_Val_Rising, DAQmx_Val_ContSamps, 1000);
DAQmxCfgAnlgEdgeStartTrig(AITrigTaskHandle, "Dev1/ai4", DAQmx_Val_Rising, 2.5);
//DAQmxExportSignal(AITrigTaskHandle, DAQmx_Val_StartTrigger, "/Dev1/PFI3");
DAQmxConnectTerms("/Dev1/AnalogComparisonEvent", "/Dev1/PFI3", DAQmx_Val_DoNotInvertPolarity);
DAQmxStartTask(AITrigTaskHandle);
The reference trigger is not so good for us - I think - because it will stop the acquisition when the trigger occurs. What we need is only generating one (or more - no matter) output which will stop the machine, but the acquisition should continue. Unfortunately I am still facing with some problem. Inspite of the original post we do analog measurements with high frq on four (ai0-ai3) channels, using AITaskHandle. Setting the start trigger to one of these channels with AITaskHandleis not good, because it will not start the acquisition. Thats why I thought for using another taskhandle with another ai channel, but in that case the OnBoardClock is reserved - i guess. Is there a workaround for this problem? Can the onboardclock be wired out and back for example? 🙂
Thx for all:)
05-31-2010 07:18 AM