Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmxCfgSampClkTiming with NI 6220 and ati nano17 f/t sensor

I am using the sample code for f/t sensor data collection (ati nano 17) using DAQ NI 6220. The sample was downloaded in the link below ( built by C++)   

http://www.ati-ia.com/products/ft/software/daq_software.aspx

I tried to change sampling time (scan rate) to 1 millisecond by changing funtion DAQmxCfgSampClkTiming ( in DAQSys.cpp file): DAQmxCfgSampClkTiming( m_th, NULL, scan rate, DAQmx_Val_Rising,
DAQmx_Val_ContSamps, 10000 );

And I received: scan rate =500 : 320 samples in 5 secs ( 7 channels)

                         scan rate=5000: 323 samples in 5 secs ( 7 channels)

                        scan  rate =50000: 320 samples in 5 sec( 7 channels)

it seems that 500 is the highest scan rate can reach 

But, according to datasheet, ati sensor has resonant frequency is 7000hz for Fx, Fy, Tz and 7000 hz for Fz, Tx, Ty (http://www.ati-ia.com/products/ft/ft_models.aspx?id=Nano17)

How can i get 1 sample ( with 7 channels ) per millisecond?

0 Kudos
Message 1 of 11
(4,316 Views)

Hi abcdcadb,

 

How are you verifying that you are recieving this amount of samples in 5 second intervals?  Also, are you viewing the output on a graph?

 

0 Kudos
Message 2 of 11
(4,241 Views)

Hi 

thanks for reply.

I used "log" button . pressing it and wait in 5 secs and then stop check the number of samples.

this method isn't fully accurate, but almost the number of samples whatever scanrate(when scanrate>500) is about 300 ( some time 305,313,etc)

0 Kudos
Message 3 of 11
(4,235 Views)

Hi abcdcabd,

 

On the datasheet below you can see that the NI 6220 has a Mutichannel maximum (aggregate) sample rate of 250 Ks/s.  Based on this, you should be able to determine how many samples you can get per channel per millisecond.

 

NI 6220 Datasheet:  http://www.ni.com/pdf/manuals/375200c.pdf

 

Additionally, what software are you using for your program?

0 Kudos
Message 4 of 11
(4,209 Views)

I used sample code from ati (company of sensor) NI-DAQmx-VC6Sample.zip in the below link

http://www.ati-ia.com/products/ft/software/daq_software.aspx

Sample worked well, the problem is I cannot change    scan rate in sample ( I tried to change both in code and  interface but nothing change)

0 Kudos
Message 5 of 11
(4,204 Views)

Hi abcdcabd,

 

Where I am right now I do not have a way to build this file and run the program.  Is there a user interface that you are using? If so, could you please attach a screenshot of the data you are seeing?  Any additional information about this interface would be very helpful.

0 Kudos
Message 6 of 11
(4,173 Views)

HI 

This is main interface when it work.

 

I tried to ask the comany and they said that:

"

The init() code contains these lines:

 

if ( !status )

       {

              /* Configure to read relative to the next sample to be read. */

              status = DAQmxSetReadRelativeTo( m_th, DAQmx_Val_MostRecentSamp );

       }

       if ( !status )

       {

              /* Configure to read at offset 0 from next sample, meaning we wait for the next

              * sample everytime we try to read a sample. */

              status = DAQmxSetReadOffset( m_th, 0 );

       }

 These functions configure the DAQ card to always wait for the next available sample when it is read, so if you wait too long between reads, it will discard old samples if a new sample comes in. 

 

If you remove these lines, it will keep the old samples around, but if you do not read the samples out of the buffer at least as fast as the sample rate you configure, the driver will throw an error when its internal buffer becomes full.  In practice, this usually means that you should read multiple samples at once, to make sure that even if your code is not looping as fast as the DAQ sample rate, it is still reading samples out at the same overall speed as the internal sample rate.

 

To understand how to configure the DAQ card from C code, the customer should read the NI-DAQmx C Reference documentation, which is included in the NI-DAQmx installation, and is available from the start menu in the NI-DAQmx folder"

 

I tried to do following their instruction, remove these lines, but nothing change.

 

it isn't easy for you to check it without device. Anyway, I am so grateful for your care.

0 Kudos
Message 7 of 11
(4,162 Views)

Hi abcdcadb,

 

Thank you for the screenshot.  At this point there are a few more questions that can help me better understand your program:

 

1.  Could you expand upon what the buttons and indicators are for in the screenshot? 

2.  Have you tried any additional modifications of the described code besides removing the lines?

3.  What information are you collecting in your project?

 

Best,

 

Chris

0 Kudos
Message 8 of 11
(4,144 Views)

G 0,1,2,3,4,5,6 stand for force and torque of axis x,y,z ( these are the collected data). 

1/ I don't really care about other button, just only focus on 'Log data', it allow write down collected data to a .txt file

i attached a picture, it shows interface when I select Tools->program Option. This interface allow change scan rate ( but accutally I can change scan rate variable in code).

2/ I tried to change scanrate, timer value

3/ collected data, of course is forces and torques 

0 Kudos
Message 9 of 11
(4,138 Views)

Hi abcdcabd,

 

Just to be sure that we are on the same page, how are you seeing that you are reading around 320 samples in the cases mentioned previously?  Does this program provide a graph or any other indicator for this? 

 

Do you have LabVIEW or LabWindows/CVI? If so we can use some shipping examples to complete some further testing to see if you are seeing the same results there.

0 Kudos
Message 10 of 11
(4,104 Views)