09-24-2007 06:09 PM
09-25-2007 12:37 AM
09-25-2007 06:41 AM
09-25-2007 11:51 AM
Thanks guys,
I've studied a few examples and modified my vi. as it's now attached.
But now I found a even more fundamental problem. That is the uncertain delay between when my first sample collected and when trigger signal appears. as shown in data collected in 'engine cylinder pressure' channel. my trigger signal is the encoder z output (once per rev) and sampling clock is encoder A output (1 pulse/deg). the z signal has a fixed angular relationship about engine crankshaft. So if the sampling starts exactly after the trigger appears, the cylinder pressure data collected should always start from a fixed crankshaft angle. But the data collected in a few times show they didn't start in the same crankshaft position. I posted the result too.
The engine speed is 1000rpm, so the next sampling clock after the trigger will appear in DAQ terminal in less than 1/6 ms (one sample clock period), is it too fast for my PCI-MIO-16E-4? or even if the board couldn't response so fast, as long as it's a controllable fixed time deley it will also be acceptable.
PS: because every engine cycle event takes up to 720 degree, so there will be 2 trigger signal appears during one cycle and either one will trigger the sampling process. Thus when look at the plot data in excel, it's possible to see two pressure peak has 360 degree phase shift. But any other phase shift is wrong and that's my question.
09-25-2007 11:52 AM
second post following last one as only 3 attachment permitted in each popst.
09-25-2007 12:20 PM
@feilong wrote:The engine speed is 1000rpm, so the next sampling clock after the trigger will appear in DAQ terminal in less than 1/6 ms (one sample clock period), is it too fast for my PCI-MIO-16E-4? or even if the board couldn't response so fast, as long as it's a controllable fixed time deley it will also be acceptable.
09-25-2007 03:14 PM - edited 09-25-2007 03:14 PM
Hi Feilong,
I will like to ask you why is your second task been trigger from the VI “Get Terminal Name with Device Prefix” if what you want to do is trigger both task at the same time, why not on use the RTSI 0 as a source on the second “start trigger” since the PFI0 line is been routed to the RTSI. The “DAQmx timing” has the source set up as “onboard” on both task so each card is been clocked with its own “onboard clock; so they are not synchronize.
You VI also have the starting and stopping the task every time your loop goes around. so your task its been created and destroy ever 10 ms. I think you should take a look at the examples “M Series Synchronization” if you go all the way to the bottom there is a library you can download with very good examples, “Fig 5 - Multi Device M Series PCI.vi” is your best shoot.
See how the example I’m pointing you to only have one while loop around the “DAQmx read” not including the “DAQmx start.vi”. Another good suggestion is simplifying your code as much as you can so first try to gather the data (no logging) the way it is suppose to and the worry about the logging. Your “xls” files don’t have labels can you point me where is that you see the delay?
Message Edited by Jaime F on 09-25-2007 03:21 PM
09-25-2007 05:43 PM
09-25-2007 11:21 PM
09-26-2007 09:15 AM
Thank jdunham,
I have a question about the ai/trigger and ai/sampleclock. are they start to output signal (trigger or sampling clock) only when the task starts, even if the real sample clock for that task is always there all the time?
Thanks
Feilong