LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

append signal

What exactly is the confusion? If you set the sample rate to 1000, then that means you get 1000 samples per second and if you then request 6000 samples to be read, it will take 6 seconds to return all 6000 samples. It's a very simple relationship. Time to Acquire Samples = Number of Samples / Sample Rate. If you want to acquire 6000 in one second, your sample rate would have to be 6000 hz. If you want to acquire 6000 samples in .5 seconds, your sample rate would have to be 12000 hz.
0 Kudos
Message 11 of 13
(424 Views)
hello

Yeah. there is no much confusion.
but the sample to read from the buffer is making me confuse. now if i have 2 channel of acquisition of analog signal, as i said each channel set to 1000 samples to read, the buffer size is automatically set to 2000, am i right? if i set the sample to read from buffer is 1000, then will it mean that it takes 1 second to retrieve data from buffer for these 2 channels?what if i put 1000 samples to acquire, sample to read is 2000?

will it be possible if the number of sample to acquire change dynamically?for let say, it gets from the sample of digital line. due to the lagging issue arise from the analog signal, the samples from digital line is delayed to be read and only for the subsequent signal(but not for the real signals that analog signal should be acquired).

to simplify the explanation as below
i give an example.

1st case
digital signal gets sample of number 1000, it will be sent to sample to acquire in analog acquisition vi.then sample number to read from buffer is 1000. it will be ok

2nd case
if the digital signal gets sample number 6000, logically it will be sent to sample to acquire in analog acquisition vi.then sample number to read from buffer is 6000. but i find that it was delayed to be sent to analog acquisition vi. in analog signal it chooses the default value 1000 as the sample number to acquire due to the delayed sample number. The sample number 6000 will only be sent to analog signal acquisition vi for the next signal. then it mess up the sample to be read

i hope u can understand what i am trying to explain what the problem exist
thanks


0 Kudos
Message 12 of 13
(422 Views)
Hi,

The best way to explain the samples to read is to not worry about the fact that you have multiple channels.  Just base the sampels to read on the idea that you have.  The code you sent does not seem to have a way to change the samples to read to 6000, which it seems like you want to do.  What if you just had the analysis of the digital signals and in the false case you have you created the task again except this time you used 6000 samples to read.

You seem very concerned with the buffer size, but I am unclear why.  The driver will make a buffer of an appropriate size based on the samples to read value and rate you have chosen. 

You asked if you chose 1000 samples to acquire and samples to read is 2000, then it will get the data for all your channels in two seconds, because that is how long it takes to record 2000 samples at a rate of 1000hz.

You mention the lagging issue with the analog input.  Is this with regards to the MUX and convert clock relationship of a multi channel acquistion?  I am wondering what the lagging issues are.

2nd case
if the digital signal gets sample number 6000, logically it will be sent to sample to acquire in analog acquisition vi.then sample number to read from buffer is 6000. but i find that it was delayed to be sent to analog acquisition vi. in analog signal it chooses the default value 1000 as the sample number to acquire due to the delayed sample number. The sample number 6000 will only be sent to analog signal acquisition vi for the next signal. then it mess up the sample to be read

In the code you have shown I do not see how you are using the digital signals to read 6000 samples.  How are you sending in that information to the analog acquisition VI?  right now all it has is 1000 wired to it with a constant.  There are ways to change this a couple in fact, the easiest would be to simply use a case structure that selects the constant you want to use, but there are also more elegant ways if that one will not provide the functionality you need. 

In general I think if you try and not worry about the multiple channel aspect of your acquisition and just set up the code as if you were acquiriing one signal you will get the behavior you want. There really should not be a delay of sending the values to the analog acquisition if you are properly using data flow in LabVIEW, so please clarify that situation, so we can try and get your issue resolved.

Have a great week,

Michael Denton
Applications Engineering
National Instruments
0 Kudos
Message 13 of 13
(403 Views)