Discussion:
DAQmxCfgDigEdgeStartTrig with Digital Acquisition
(too old to reply)
kalganian
2008-05-21 13:10:07 UTC
Permalink
greetings,i'm trying to read digital data using an external clock that is synched to the data. also, i want the acquisition to start after i give an asynchronous trigger. i'm using a usb6251 card with microsoft visual c. i tried to use DAQmxCfgDigEdgeStartTrig:    DAQmxErrChk (DAQmxCreateTask("di_pfi0start_pfi1clk",&taskHandle));    DAQmxErrChk (DAQmxCreateDIChan(taskHandle,"Dev1/port0","",DAQmx_Val_ChanForAllLines));    DAQmxErrChk (DAQmxCfgDigEdgeStartTrig(taskHandle,"/Dev1/PFI0",DAQmx_Val_Rising));    DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandle,"/Dev1/PFI1",1e6,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,1e5));however, this gives the following error:    DAQmx Error: Measurements: Specified property is not supported by the device or is not applicable to the task.    Property: DAQmx_StartTrig_Type    Task Name: di_pfi0start_pfi1clk    Status Code: -200452is the DAQmxCfgDigEdgeStartTrig function unable to trigger digital acquisition for my card? i have gotten it to trigger analog acquisition correctly. any help will be much appreciated.thanks,regards,kartik
tnek
2008-05-22 23:40:12 UTC
Permalink
Hi kalganian, The function that you used to set up a digital trigger for your digital acquisition will not work since the USB M Series device that you are using does not have dedicated timing for digital tasks. This is seen in the fact that you need an external clock to drive the hardware timing. The task itself cannot be triggered but there are other clocks that you can use which can provide the sample clock you want. <a href="http://digital.ni.com/public.nsf/allkb/49904DD2ACC3574786257411007384F5?OpenDocument" target="_blank">This</a> article further explains this fact and has methods to achieve your triggered digital acquisition. This information can also be found in the <a href="http://digital.ni.com/manuals.nsf/websearch/B53FA1760200AF86862573A3006F9E56" target="_blank">M Series User Manual</a> in the Digital I/O section. Regards,KentApplications Engineer
kalganian
2008-05-23 00:10:07 UTC
Permalink
hi kent,thanks for the info... can you tell me if i got the article's import correct:1. set up an analog task that is triggered using DAQmxCfgDigEdgeStartTrig2. once the trigger arrives, the analog system generates a sample clock.3. feed the above sample clock into a PFIO pin.4. use the clock going into the PFIO pin to do the digital acquisition.could you tell me what C++ functions would be involved in the above? i'm unfamiliar with labview and the article attaches a vi.also, my requirement is a little different. i already have the clock at which i want to perform the digital acquisition. the sequence is thus:1. DUT sends out a ttl pulse.2. after the ttl pulse arrives, the DUT, sends out a clock and N bits of data synched to that clock.3. after the N bits, the DUT silences.4. goto 1attached is a timing diagram.can this be done using the workaround involving the analog subsystem?thanks,kartikMessage Edited by kalganian on 05-22-2008 06:45 PM


timing diagram.png:
http://forums.ni.com/attachments/ni/70/8903/1/timing diagram.png
tnek
2008-05-23 15:10:07 UTC
Permalink
Hi kartik,Thanks for the additional information. It sounds like your external clock is already triggered. Since the digital input will only acquire whenever the external clock is coming in, the data will only be acquired on the rising edges of your incoming clock. So to get digital data whenever the your external clock is present, you will only need to setup to the digital task with the timing function. You will not need to set the trigger function for the digital task since your clock is already triggered. Let me know if this produces the results which you need.Regards,KentApplications Engineer
kalganian
2008-05-23 15:40:11 UTC
Permalink
hi kent, yes, i have the clock that triggers the digital acquisition. the problem is i need to sync that to the pulse sent out by the DUT. for example, lets say that the sync pulse comes out of the DUT at t=1, 2, 3, 4 ... seconds and the clock/data come out of the DUT from 1.25-1.75, 2.25-2.75, 3.25-3.75, 4.25-4.75 ...seconds.now if i run my nidaq code at t=0 seconds, everything is good. however if i start the code at t=1.5 seconds, the data i read will not be synched to the sync pulse sent by the DUT.thanks,kartik
tnek
2008-05-27 19:40:13 UTC
Permalink
Hi Kartik, To trigger the acquisition using the sync pulse from the DUT, you will have to use another task. This can be done using the externally timed analog input task as we talked about before. You can set the triggered clock as the external clock for the analog task using the DAQmxCfgSampClkTiming() function. The sync pulse from the DUT can be set as the trigger for the analog task using DAQmxCfgDigEdgeStartTrig(). The analog input clock can then be set for the digital input by setting ai/SampleClock as the sample clock source. More detailed information on these DAQmx functions can be found in the NI-DAQmx C Reference Help. Try this and let me know how it turns out. Regards,KentApplications Engineer
kalganian
2008-07-15 18:40:10 UTC
Permalink
hi kent, sorry for the late reply. i got a new card the pci 6533 and have a related problem:http://forums.ni.com/ni/board/message?board.id=70&amp;thread.id=9180regards,kartik
Loading...