05-18-2011 03:32 PM
dimavima
Hi,
I'm trying to understand the operation of the board WLS 9215.
I have an application in LABVIEW where I have wls9215 to take readings of ananalog input (AI0) at a rate of 1 kHz and 2 samples.
The program is running continuously with the following sequence:
. read two samples in port AI0
. I record in file
. read two samples in port AI0
. I record in file
. (repeat continuously)
When I see what was recorded in file I see that are missing data that are theoretically expected.
rate: 1khz = 1ms
samples = 2
Theoretically in a second could make 1000 measurements on port AI0, but as I'm constantly connecting and disconnecting the card I lost data.
What I wonder is how long it takes the board to provide data wls9215?
How much time lost in communications?
Alguem me poderá ajudar?
05-18-2011 11:42 PM
Your theory is wrong. If you have 1000 samples per second, its going to take .002 seconds to acquire 2 samples. Then, depending on how you have written your code, you might have an additional delay while you write the data. ypu don't mention the rate you are actually getting or provided your code.
05-19-2011 04:56 AM
I submit the application that I explained above.
Where can I find the execution time of tasks as:
. read two samples in port AI0
. record in file
I'm testing two solutions.
solution 1 (rate: 1k; number of sample: 2):
. read two samples in port AI0
. I record in file
. read two samples in port AI0
. I record in file
. (Continuously repeat)
solution 2 (rate: 1k; number of sample: 1k)
. read 1000 samples in port AI0
. I record in file
. (done only once)
The solution 1 shows a much lower number of samples in relationship to solution 2.
This is because a solution 1 reads the data only two samples at a time.
The amount of hits the plate is much higher in solution 1 than in a solution 2.
During one second I expected theoretically:
. Solution: at least 500 hits to get data in a second.
. Solution 2: at least 1 access to get data in a second.
This difference the amount of records is due to wireless? Due to file written on repeatedly? Number of hits to the plate read again and again?
"Then, depending on how you have written your code". Tell me how can I do a solution for no loss of data.
Can you help me.
Greetings
05-19-2011 12:49 PM
You have some fundamental misunderstandings of how data acquisition and programming works. If you set the number of samples to 2, the DAQ card will take those two samples 1 msec apart, write them to a file, and then the program stops. No more samples will be taken until you hit the run button again. There will be an obvious gap because of the time it takes to click the run button and for the time it takes to execute all of the other code. There is nothing magical that will happen such that the rest of the code will take 0 time to execute. There is no sense in saying x number of samples in 1 second. As it is, you have no idea how long it takes to do repeated reads. If you specify 1000 samples, you will then have 1 second worth of data from a single acquisition but again a gap between the next DAQmx Read. I sense that you are using the run continuous button. Don't do that. It is for special debug use only.
In order to acquire data without gaps from one DAQmx Read to another, you need to change to continuous sample mode - not finite. Then you need to place the DAQmx Read inside a loop. You also need to use the producter/consumer architecture so that the file write is the consumer.
05-19-2011 04:27 PM
Ok, now I understand.
Your explanation is very good.
Thanks.
However, I would like to ask you about another matter.
If I have 15 boards wls9215 linked in a network is possible to take readings of 10 samples with a rate of 10hz on each plate and have the data for each board in real time labview?
I think not because there will be gaps from one card to another but I wonder if my idea is right.