06-16-2015 08:39 AM
Hi,
I am using NI-8452 board to read data in an accelerometer IC.
Everything works fine with the script I created.
I used the "run script" vi and the "extract data" vi in a for loop and I am facing jitter issues.
Data are read most of the times between 12 and 16 ms but sometimes each 40 ms ! (I suppose when computer is doing others activities).
so, is there a way to be deterministic ?
The script used is very simple:
Read 1 register
Wait for 10 ms
06-16-2015 09:12 AM
@Coj wrote:
so, is there a way to be deterministic ?
Yes use hardware timing. When you need a real time system, you need a real-time system.
LabVIEW is not a scripting language, there are no scripts. Post your source.
But what you are seeing is expected. Have you ever had Windows lock up and have the mouse and keyboard not respond for a few seconds? Windows decided to go off and do something else and there's nothing you can do about it, sorry. There might be techniques to help improve jitter, but nothing but hardware timing can remove the jitter. Inline VIs, maybe subroutine them, turn off debugging, disable anti-virus and firewall, etc.
It might be better to have an embedded device that gets the data as fast as it can, and then send it over to your host in chuncks, but this might be over kill if you can live with a little jitter. This can be done with a cRIO, myRIO, or if you don't mind C++ an Arduino.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
06-16-2015 09:34 AM
Thanks Hoovahh for your answer.
Yes of course the solution is hardware.
I use the NI-8452 board and there is a FPGA inside, is there a way to say to FPGA to run the script countinously ?
I read the documentaion of the driver but I did not find the answer.
06-16-2015 09:40 AM
I am farily certain that there isn't an FPGA in the 8452, but I could be wrong. I suspect it is a basic micro, communicating with SPI, and I2C as commanded. The same can be accomplished with an Arduino. Even if there was an FPGA in there, there is no way to reprogram it.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
06-17-2015 04:21 AM
Hello Coj,
Hooovahh is right. If you want to work in this time frame you need to use a real time OS or a FPGA chip. If you working with LV and using Windows with software timing you can work in the timeframe of 100ms. If you want to be deterministic you can reach this only with real time OS or FPGA.
Regards
06-23-2015 09:03 AM
Hi,
Thanks a lot for all your answers.
Just to confirm, there is a FPGA chip inside the 8452 board.
What I do not understand is that with the SPI stream mode it is possible to loop with the hardware but not with the "script" mode.
I'm a little disappointed with that.
But anyway, I will try to find a new hardware solution.
Thanks
Coj