From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronizing Counter Output and Analog Input to control and record at the same time

The code below is fairly large a may be a bit hard to read, as it is not optimized by a professional developer, and is meant for personal use only. I am trying to record signal outputs from a counter on the NI board (USB 6366), along with other analog inputs from recorded voltage changes from an IR beam sensor, using the analog input. Right now I only have the counter outputs and trigger for the recording device setup. I want to verify that when I send out the signals, they will record and occur at the times I demand within a range of 0.01 secs. I tried to have the code run as fast as possible by minimizing the amount of data in the while loops (why I have the constants outside of the case structure that starts the loop, I figured this would minimize calculation time). Unfortunately, It seems that the recordings are not as exact as I want. I want the pulses to come out every minute on the minute, but they are off more than 0.1 seconds. I am thinking the recording and command loops are not starting at the same time and wonder if that would fix it, and how to do that. I tried rendevous, but that simply stopped the recording until the command time was over. If there is a better overall structure for this, please let me know. 

Download All
0 Kudos
Message 1 of 2
(454 Views)

I could take a quick look later if you save back to LV 2020 or earlier and repost

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 2 of 2
(396 Views)