Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Can NI-USB8452 be programmed to run a predefined script in a timely fashion?

Hi all, 

 

We are working on a data acquisition application via SPI, and we already achieved reading from our sensors with NI-USB8452 from a C++ program. However, we have to manually ("polling") issue writing+reading commands to read each measurement, which imposes some delay. 

 

Is there any way to tell the USB board to perform some SPI script automatically at a fixed rate? In that case, how are the reading data retrieved from the C++ program?

 

Best,

Jose Luis

0 Kudos
Message 1 of 2
(6,299 Views)

Depending on the script you can use the SPI streaming mode.If your script is to write a consistent, small output message (up to 64-bits, if I recall correctly) and read N bytes (N is not limited) then streaming mode will continue to run at a rate dictated by your configuration. However, this isn't exactly the same as the scripting API, but if you aren't doing anything fancy, this will give you great performance. The one thing to note is that SPI streaming is limited to one chip select.

0 Kudos
Message 2 of 2
(6,153 Views)