Basically in agreement w/ answer above, plus would add a few thoughts:
1. Suggest you add some data dependency in config area prior to main loop. Make sure both position counters are armed *before* starting your "acq. clock" (pulse train on CTR 2). As it stands now, can you be sure that the trigger condition doesn't occur, say, after programming one encoder & the pulse train generator but before programming the other?
2. Would further suggest not entering the loop until you verify that trigger condition has happened.
3. Would suggest building up each counter's total dataset with a 1D array rather than 2D.
4. I would recommend *against* using separate while loops for the counters. Though it may help short-term debugging, it'll make life more difficul
t in the long run. Once you get the basic functionality wrung out, there are some error-checking & error-prevention details that naturally want to be shared by both of these synchronized counters, and that'll be much simpler if they're running together in the same loop.
- Kevin P.
ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.