Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronized counter and ai measurement with log / different NIChannelLength

Hey,

 

i want to measure three encoder positions (from PCI-7340) synchronized with 8 ai (from PCIe-6320). I used the example "Meas Angular Position-Buffered-Cont-Ext Clk-Arm Start Trig.vi",  routed the phases A and B from each encoder to RTSI 0-5 and from RTSI 0-5 to cnt0-cnt2 and changed it to position measuremts. It runs perfectly.

 

So I add a new task for ai (Same 'Sample Clock Source', 'Sample Clock Rate per Channel' and'Trigger Source' from counter measurements). It runs with a graph for visualization. See attachment.

 

Then i delete the visualisation an Daqmx read for logging. For every task i have to save an own tdms-data. No problem. but every data/channel had another NISampleLength. Why. What is wrong.

 

Attachment:

- The VIs before DAQmx configure logging make name extensions for datanames before .tdms

- The Configuration for counters and (dis-)routing to RTSI are in SubVIs

 

Thanks for help.

Andy

 

LabView 8.2

Win XP

PCIe-6320

PCI-7340

 

Best Regards,
Andy

_____________________
PCI-7356@UMI7764; PCIe-6320@SCB-68; LV2011; Motion Assistant 2.7; NI Motion 8.3; DAQmx 9.4; Win7
0 Kudos
Message 1 of 19
(4,394 Views)

Hi,

 

interesting is how your trigger is implemented in the SubVI "Config 3 Count for Pos". Can you share this SubVI with us?

Are the differences in NISampleLength always the same between two channels (not absolute but relative)? Maybe there is a pattern which can help us here.

 

Thanks for your answers!

Jan

0 Kudos
Message 2 of 19
(4,376 Views)

Hey,

 

you´re right. The the SubVI "Config 3 Count for Pos" you have to see. I attached it.

 

I found out, that the difference of NIChannelLength between the tasks is always 25.600 (analog tasks to cntr0, cntr0 to cntr1, cntr1 to cntr2). The NIChannelLength of analog tasks is the highest Value.

The size of the TDMS-data shows, that the difference between the values is from the beginning of the measuring (after start trigger).

 

Andy

Best Regards,
Andy

_____________________
PCI-7356@UMI7764; PCIe-6320@SCB-68; LV2011; Motion Assistant 2.7; NI Motion 8.3; DAQmx 9.4; Win7
0 Kudos
Message 3 of 19
(4,372 Views)

Sorry,

 

I was wrong. After start trigger the size of the data of counters are the same. The difference accures when I stop the Program. So I will try to make a stop trigger too.

 

Best Regards

Andy

Best Regards,
Andy

_____________________
PCI-7356@UMI7764; PCIe-6320@SCB-68; LV2011; Motion Assistant 2.7; NI Motion 8.3; DAQmx 9.4; Win7
0 Kudos
Message 4 of 19
(4,351 Views)

Hi Andy,

 

thanks for your reply. Are there any new results? I had a second look at your VI and maybe the problem is the error-cluster after your while-loop. What happens if you change the sequence of the "Clear-Task" (dataflow of error-cluster)?

 

Best Regards

sequence
0 Kudos
Message 5 of 19
(4,333 Views)

Hey,

 

I changed the sequence of Error Cluster after the While-Loop. Every Task have now an own Error Cluster. Now the differences between the Data are undefined, because the sequence is quasiparallel. I think, If I would change the sequence of Error Cluster after the Loop from up to down, the difference between the NISampleLength will be the same. But other Data-File will be the biggest. I will try later.

 

To stop or pause the measurements with a trigger I have no Idea. Anybody an Idea? This would be the solution I want to. So it would be independent from PC.

 

I have another problem now. When I only protocol the Data, the Encoder Data show me later inexplicable values. When I only read the data, the values are correct. What could it be. I tried to change the "decode way" (Is it the right name? In German VI it is "Dekodierweise"-Input) of "Daqmx Create Virtual Channel.vi". No result.

 

Thanks for help.

Best regards

Andy

Best Regards,
Andy

_____________________
PCI-7356@UMI7764; PCIe-6320@SCB-68; LV2011; Motion Assistant 2.7; NI Motion 8.3; DAQmx 9.4; Win7
0 Kudos
Message 6 of 19
(4,327 Views)

Hey,

 

concerning the wrong log data I logged and read the Data. The Positions from reading are correct. The positions in tdms-Data are 0 or a position at -10^7. Is it possible, that there is a bug in the VI "Daqmx Configure Logging"?

 

Thanks for help.

Best regards

Andy

Best Regards,
Andy

_____________________
PCI-7356@UMI7764; PCIe-6320@SCB-68; LV2011; Motion Assistant 2.7; NI Motion 8.3; DAQmx 9.4; Win7
0 Kudos
Message 7 of 19
(4,305 Views)

Hey Andy,

 

With respect to the channel lengths being different between the tasks, if I understand the problem correctly, this is expected behavior.  To explain, with "Log only" mode of Configure Logging, an asynchronous thread is created which will continuously transfer data from the device to the TDMS file.  Even though you check "Is Task Done" in the loop, that doesn't have an effect on when the data gets logged.  The tasks would all three have to be cleared at exactly the same millisecond in order to guarantee the same exact amount of data.  If it were a finite acquisition or "Log and Read" mode, you have more explicit control over how much data is logged (with finite, the number of samples specified in the task will be logged; with "Log and Read" mode, any data that you read from DAQmx Read will be logged as there is no asynchronous thread).  Please clarify if I might have misunderstood the system setup.  If my understanding is correct, I would expect that the file created by the first task to be cleared has the fewest number of samples while the file created by the last cleared task would contain the most samples (when the Clear Task calls were sequenced with error chaining as in the first screenshot).

 

With respect to the data being incorrect, there was an issue in the Position Encoder scaling code that was broken in a version of DAQmx (9.2, perhaps? can't remember).  Upgrading TDMS should resolve this issue if that is the problem here. Unfortunately, I cannnot find the TDMS download on our website now and it's very late (so I can't ask anybody where it is/went); I will post tomorrow with a link.  The way that the TDMS streaming feature works is that the tdms.dll component builds into its DLL DAQmx scaling code.  Therefore, even though TDMS scales the data the same exact way as DAQmx does, the version of TDMS that you have installed might not have this fix in it yet.

Thanks,

Andy McRorie
NI R&D
0 Kudos
Message 8 of 19
(4,288 Views)

The latest TDMS installer can be found here:

http://zone.ni.com/devzone/cda/tut/p/id/9995

0 Kudos
Message 9 of 19
(4,281 Views)

Hey,

 

I installed the TDMS installer (link above) with no effect. Data are still incorrect. How can I check which TDMS is installed?

 

With respect to the different channel length I am happy, when the measurements begin at the same moment with the trigger. It runs.

 

It would be interesting to pause or stop the measurements with a trigger. Is it possible?

 

Thanks for help.

Best regards

Andy

Best Regards,
Andy

_____________________
PCI-7356@UMI7764; PCIe-6320@SCB-68; LV2011; Motion Assistant 2.7; NI Motion 8.3; DAQmx 9.4; Win7
0 Kudos
Message 10 of 19
(4,249 Views)