08-02-2011 06:43 AM - edited 08-02-2011 06:51 AM
Hi,
I got into some trouble during implementing communication with my sensor.
As you see in attachment I am using internal counter output to trigger write and read events.
This counter works with 10MHz speed, and I am sending 32 sample and acquire 50 samples.
I put get time in sec before it and after and substracted both values, and it come that every measure takes 0.015s, wchich is quite long.
In 10MHz clock, 32+50 samples should take 0.0001 s.
I need to speed up because my sensor let me acquire data in 400Hz speed (0.0025 s)
Do you have any idea what i can do to make measure faster?
Added aquisition.vi
08-03-2011 05:09 AM
Hi MarcinP,
What device are you using? For SPI, I would recommend checking out this links: Serial Protocol Communication Reference Design for Digital Waveform Devices and SPI Digital Waveform Reference Library, although they apply only to certain cards.
Am I assuming correctly that you're going to have the clock as the counter input? Or is there some other reason to use the counter?
How is the communication going to flow? Is it going to be command-response for every sample your sensor measures? Are you going to put some loop there?
I assume the time we are talking about is difference between output and input, ie.e. time 3- time 2, right? What you measured is 15 ms, which is not that much considering that Windows has to do other stuff in the meanwhile. Nevertheless, please try replacing the Get Date/Time In Seconds VIs with Tick count (ms) - in some cases it can be more precise.
However, I am afraid that it's possible that the delay you're measuring is expected - it doesn't mean that the hardware operations are slower though, it could mean that it takes a while to get the data from the hardware buffer to the software. I will try to find out if this is the case or not.
In any case, it might be neccessary to acquire more data at once, if possible - i.e. send several queries and acquire several responses.
Looking forward to your answers!
Best regards
Zenon
08-22-2011 05:21 AM
Thanks for answer.
I am using timer because my daq card (NI PCIe-6251) which don't have hardware one.
I am using SPI Waveform library, and in another procedure I made table with inquiries 3 register of accelerometer.
Communication flow (as you see in attatchment) will be producer-consument structure.
First I setup whole thing and in producer loop I just start and stop input/output ports.
My conclusion is:
It's impossible to measure digital acceleration by SPI (10MHz clock) with 1000Hz speed because start and stop procedures takes at least 15ms to setup.
Sad 😞