LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

synchronisation between DAQmx channel and I2C signal via USB-8451 (and BLE)

hello

I am setting a measurement vi using :

  • NI9215 to get analog voltage
  • NI9401 to get digital counter
  • USB-8451 to get data from an I2C device
  • Bluetooth data

I have set a sample clock @100hz on the anolog input and then placed a daqmx read @1 sample per read in a while loop. In this same loop, I am reading all other input (expecting the same frequncy for all) and write everything in a write to measurement vi express.

When I am enabling write measurement, I only write 150 logs lines (after 1.5sec) then it stops with no error message.

By increasing the sample read to 10 on the daqmx read, my output file give analog input datas @100hz and all others sensors @10hz (1 log line every 10 lines). But in this case, writing measurement does not stop.

I have tried to increase buffer (with daqmx buffer node) on the analog input channel but does not help

By decreasing the frequency, duration before the writing stops is longer. And @10hz it works

I don't understand what happen and what to test.

Hope my explanation are clear

thank you for your help

0 Kudos
Message 1 of 7
(1,499 Views)

Hi pi3rr3,

 


@pi3rr3 wrote:

I don't understand what happen and what to test.

Hope my explanation are clear


We don't know either, because your explanation is missing a VI to show the problem in your code…

 


@pi3rr3 wrote:

write everything in a write to measurement vi express.


This might be a part of the problem…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(1,469 Views)

thank for your answer gerdW, I will clear up my vi first.

What do you advise to replace this express vi?

0 Kudos
Message 3 of 7
(1,445 Views)

Did you get a solution?

0 Kudos
Message 4 of 7
(1,275 Views)

not really

I have replaced every VI express but did not resolve.

I finally have increased the frequency to have the lower one at the right level and have decimated the higher one...

0 Kudos
Message 5 of 7
(1,262 Views)

Thanks for the reply! I have never found a good solution to acquiring digital and analogue signals synchronously into the same file. At least, not in the time in which I need to provide a solution. I resort to an asynchronous capture, and entering the digital value as a comment in the LVM file. So far, it has been close enough, but the day will come when someone wants fast and accurate timing...

0 Kudos
Message 6 of 7
(1,245 Views)

Actually, it is not logical to synchronize different types of devices (at the hardware clock level, maybe of application-level importance at certain events in execution). For instance, the DAQ AI are continuously sampled whereas I2C communication using 8451 is packet-based and not continuous.

 

If you were to synchronize both an I2C packet and a continuous AI capture, you could use the I2C clock edge as a start trigger and capture a known number of samples on DAQ so that the samples correspond to the I2C packet duration.

 

Moreover, 8451 is not a device designed to be synchronized to external instruments and is meant to be just a simple I2C/SPI interface for asynchronous data read/write. If you were to implement I2C on the same DAQ that does AI capture, you can perfectly synchronize.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 7 of 7
(1,238 Views)