LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-845x loop script

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

 

 

 

 

 

0 Kudos
Message 1 of 6
(3,253 Views)

@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.

0 Kudos
Message 2 of 6
(3,244 Views)

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.

 

 

0 Kudos
Message 3 of 6
(3,233 Views)

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.

0 Kudos
Message 4 of 6
(3,227 Views)

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

Roman Rolnik
Application Engineer
NI Germany
0 Kudos
Message 5 of 6
(3,198 Views)

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

 

0 Kudos
Message 6 of 6
(3,164 Views)