LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ Express code reporting wrong DT.

Solved!
Go to solution

All,

 

   I have an odd problem where a bit of DAQ Express code is reporting the wrong DT consistently. This occurs with both the hardware device and a simulated device. I've attached screenshots detailing everything I found relevant to the problem as well as the source code.

 

You can download the files here.

 

http://sites.google.com/site/xkenneth/downloads 

 

Regards,

Ken 

0 Kudos
Message 1 of 6
(3,357 Views)

Why don't you just attach the files to here? Use the 'Add Attachments' right below the message body. Could you also post the images in a format such as jpg or png. I tried to open the VI but got a message saying it was not a valid LabVIEW file so there might be something wrong with that.

0 Kudos
Message 2 of 6
(3,348 Views)
Trying this again.
Download All
0 Kudos
Message 3 of 6
(3,317 Views)
Solution
Accepted by topic author xkenneth

Hi Ken,

 

Thanks for posting to the NI Discussion Forums! From your pictures, I saw that you are using an NI-9239. From page 16 of the NI-9239 Operating Instruction and Specifications, it explains that the valid rates for sampling are derived from the timebase by first dividing this value by 256. Then, the value may further be divided down by an integer value from 1-31. Thus, valid sampling rates may be as high as 50 kS/s down to 1.613 kS/s when using the internal timebase of 12.8 MHz.

 

In your case, you have specified a sample rate of 300 S/s, which is much less than the lowest possible rate of 1.613 kS/s. Therefore, the board is coercing this value up to 1.613 kS/s and the inverse of this is the dt value you are seeing, which is 0.00062 seconds. To get an actual sample rate less than this value, you will need to provide an external clock. For example, to achieve a clock rate of 300 S/s, you would need to provide an external clock at an integer multiple of 76.8 kHz (up to 2.3808 MHz).

 

Also, thanks for adding the attachments to your post. This gives other users easier access to the information to both provide help and also to be able to view all the relevant information when exploring the post in the future (in case anyone else runs into the same type of problem). In any case, thanks again for the post and for all the details of your problem! Cheers,

Daniel S.
National Instruments
Message 4 of 6
(3,314 Views)

As a quick follow-up to the above post (for future reference), I did look into the valid data ranges when using an external timebase a little further. While the math works out correctly for the case of sampling at 300 S/s, the specifications further lists the valid data range when using an external timebase as being between 390.625 S/s and 51.2 kS/s. This can be found on page 19 of that same specifications document as mentioned above, and is shown in the image below. Sorry for the confusion Smiley Wink

 

 

 

Message Edited by dansch on 10-28-2008 10:12 PM
Daniel S.
National Instruments
Message 5 of 6
(3,292 Views)
Thanks! Your effort is very much appreciated!
0 Kudos
Message 6 of 6
(3,282 Views)