From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

The Daily CLAD

Community Browser
cancel
Showing results for 
Search instead for 
Did you mean: 

Re: CLAD2017 - Hardware - DAQmx - Find those values

SercoSteveB
Active Participant

Consider the VI, which of the following values for Sample Rate and Samples/Channel resulted in the data shown in Waveform Graph?

 

WaveformGraph.png

 

WaveformGraphAnswer.png

 

WaveformGraphAnswerValues.png

 

Comments
Al_Niz
Member

 i think its a) because of the x-axis scale: (5/2000) = 0.0025 

crossrulz
Knight of NI

If this was a waveform chart, I would go with A.  Otherwise, none of these answers make sense to me.  The waveforms go for 5.5ms.  So a sample rate of 2000 makes sense.  But the number of samples would be 12.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
kiranteja93
Member

answer should be A, except A all the above will take more than 0.0025 seconds...... 

Baltur
Member

I agree with the others, none of the given options is fitting the graph.

 

The Sample Rate seems to be 2000samples/second but the samples/channel is neither 5 nor 20 but probably 12.

 

A.Bernau
Member

a) SR 2000 (0,5ms) multiplied with 5 samp => 2,5 ms time span => no valid answer
b) SR 1000 (1,0ms) multiplied with 10 samp=> 10ms time span => no valid answer
c) SR 1000 (1,0ms) multiplied with 15 samp=> 15ms time span => no valid answer
c) SR 2000 (0,5ms) multiplied with 20 sampl=> 10ms time span => no valid answer

Reverse test: I am only able to count 10 samples instead of 12
For 10 samples we need 0,006 sec
For 1 Sample we need 0,0006sec
=> Rate could be approx. 1666
So Sample rate of 1666 and Samples/channel of 10 could be close to the answer.

Timsrice
Member

Looks to me that the elapsed time is somewhere near to 0.0055 seconds.

& I think I can count 10 samples across the traces.

So the period of the sampling is somewhere near 0.00055 seconds

which is the same as 1.82 kS/s (1,820 samples per second)

 

Available sampling rates for NI-9234 & NI-9237

If the device was NI-9234, out of the box it will do 51.2 kS/s divided by "N" where "N" is an integer 1 to 31.

When a sampling rate is called for, the nearest possible sampling rate is set.

If "N" is 28, then the valid sampling rate is 1.828 kS/s (which 1828Hz  and this will be set for a 'requested' sampling between about 1795 to 1861Hz)

So if NI-9234 was the hardware, a sampling rate of 1800 Hz and 10 samples/channel would give the waveform graph shown.  (I thought this might be near one of the possible answers, but it isn't.)

 

Good practice: Ask the hardware what rate it actually set.

Displaying this value can help to explain what has happened!

keshavboss
Member

In Graph shown by white line, i can see two clear peaks which are 0.6 milisecond apart so rate is (1÷0.6ms) = 1666.66 and as crossrulz said waveform goes for 5.5ms so number sampels per channel equals to (5.5ms÷.6ms) = 9.16 or we can say 10. but none of the option fill this requirement.

 

Still i guess answer is  A.

RayFarmer
Trusted Enthusiast

b)

Regards
Ray Farmer
Tsjabrantes
Member

A...

Smiley Happy

Tarciso Junior
+55 (11) 996-282-103
Skype: Tarciso.junior2
Email: Tsjabrantes@gmail.com
http://br.linkedin.com/pub/tarciso-junior/23/a83/463
mabaig
Member

hey Greetings all,

can anyone explain me how you genius guys are calculating sampling rate and samples/channels by just looking at the graph. How to decode graph for number of samples and channels??? 

Help would be highly appreciated.

  

crossrulz
Knight of NI

mabaig,

Number of plots = number of channels.  So that one is really simple.

 

The other two are dependent on each other.  But the graph ends at ~5.5ms.  So that should give a clue to the sample rate.  1kS/s = 1ms/sample, so 1kHz is out of the question.  But 2kS/s is reasonable.  So 2kS/s*5.5ms = 11.  But there was also a sample at time = 0, so we should have a grand total of 12 samples.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
avega
Member

Hello,

I got something close to answer "B" after running the VI.  If I understand this, the sample rate equals the sampling frequency which is 1Khz.  From B 10/1000 = .01

I can only assume the graph is limited by the NI 9234 spec at 51.2kS/s/ch since there is only one acquisition.

Can someone elaborate? block.PNG

 

graph.PNG

 

User002
Not applicable

B (assuming my simulated device is the same as SercoSteveB's)

 

avega,

Tl;dr: When you input a rate of 1000 Hz, it's coerced to the nearest available option. The slowest sample rate available to the NI 9234 is 1652 Hz. Because that's the nearest option, it's the actual output rate, even though it's not what we asked for.

 

Explanation:

Timsrice talked about this above, but I'll explain it in more detail.

 

I suspect SercoSteveB used a simulated device like is set up in the "Data Acquisition Using NI-DAQmx and LabVIEW" training. Using this, my simulated device is also the NI 9234. On the NI 9234 data sheet (on page 6), it says

joeorbob_0-1594919622939.png

Based on this, the slowest data rate that the NI 9234 can produce is 1.652 kS/s.

 

You can get the actual Sample Rate by using the DAQmx Timing Property Node's Sample Clock:Rate property, and using the formula in the data sheet, you can get it algebraically, too. I'll include a snippet here.

The Daily CLAD 03-25-2018.png

 (Please forgive my 2019 snippet - it's the only version I have at the moment.)

 

Here's what I got as my output.

joeorbob_1-1594920359694.png

As you can see, we did input 10 Samples/Channel and a Sample Rate of 1000. And the output really does have 10 samples per channel. It's just that the rate is not 1000, but 1651.61 instead.

 

Also, kudos to NI for making their simulated devices behave like actual hardware. I think that's really cool.

 

-joeorbob

istan0227
Member

B

sathyavathi
Member

Hi,

 

Can anyone please explain how you do the calculation and determining the samples/channel and the sample rate? coz reading all the comments is quite confusing. Thanks in advance.

johnwhitcraft
Member

Hello Joe or Bob,

" User002 Not applicable ‎07-16-2020 12:37 PM "

Comment is helpful.

 

May I please have the snip in 2018 code?

johnwhitcraft
Member

daq-find-values.png

Here is "Joe or Bob"'s LabVIEW design in a slightly older version 2018.

I guess duplication is a good form of flattery.