LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronization I/O signals

Solved!
Go to solution

Hi everybody.

 

I have written a LV code for switching on and off a group of six lasers and record their intensity output every n seconds for 24 hrs.

It works quite well but after a certain number of iterations the recording/switching operation gets out of sync.

Might anybody help me out with that?

0 Kudos
Message 1 of 6
(2,088 Views)
Solution
Accepted by topic author nicop92

Hi nicop,

 


@nicop92 wrote:

It works quite well but after a certain number of iterations the recording/switching operation gets out of sync.

Might anybody help me out with that?


This is because you use a hardware-timed DAQmx task and an additional Wait in your loop. Delete this Wait function!

 

Btw. you do some serious Rube-Goldberg code in your VI! You REALLY should cleanup that monster!

 

Example:

Those offset values should be provided as an array instead of 4 scalar values…

Best regards,
GerdW


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

Hi Gerd.

 

Thank you very much for your reply!

 

Are you referring to the wait function I have highlighted in the attachment?

 

Cheers

 

PS: yes, it's quite intricate. I'm trying to simplify it as much as possible

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

Yes!

 

When you set a timing in your DAQmx task then you just request a fixed amount of samples at DAQmxRead, which also sets the iteration time of your loop! (Simple math of samplerate*number of samples…)

 

Btw. don't forget to delete that additional wait function in the case structure, where you write the data to a file, too!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(2,055 Views)

Thank you very much Gerd.

 

Just one more question:

If I remove the the wait function you pointed out in the

beginning the data acquisition gets too fast (I cannot see a thing on waveform charts).

Could you please advise?

0 Kudos
Message 5 of 6
(2,042 Views)

Sorry Gerd!

Your last message notification got visualised in delay.

You're right: just set the samples number in the write functionality.

 

Cheers

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