LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

synchronizing voltage and counter pulse two trigger inputs at a specified frequency and time delay

As you said earlier, with the CDE,  one cannot be sure inititally what voltage is being associated with which trigger ( rising or falling). But, after stopping and starting it a couple of times, I can sync the trigger with the associated voltages and that is something I can live with right now for my application.

I understand that Labview is based on data flow programming. Besides the triggered analog output voltage generation code, I want to put out a counter output pulse at two counters ( ctr0 for PFI0 and ctr1 for PFI1). So, I wrote two seperate codes for putting out these trigger pulses. I also need a certain delay between the trigger input and the counter output ( the trigger input also puts out the triggered analog out voltage).  This delay depends on the rpm of the motor ( which i am reading off of a data socket and doing a mathematical calculation and feeding it to the intial delay of the counter out tick based).

Somehow, when i put the triggered analog voltage out code in parallel with the just the counter output code(with no delay), only the analog voltage out code works and not the counter output code.  I am not sure whats happening here. I thought since the two codes are parallel, they should execute together and since the incoming trigger frequency is just 30 hz, i thought the counter output could get triggered easily.


0 Kudos
Message 21 of 23
(591 Views)
Actually, the code worked ( it is still without reading the values off from dstp server). However, when i hook it up to the oscilloscope, i can see that few trigger pulses are missed for counter triggers. There must be a gracious way of doing this.

0 Kudos
Message 22 of 23
(586 Views)
Triggers are missed because you keep clearing and re-configuring the counter tasks in their loops.  Here are some mods I made to get rid of the loops and to sequence the tasks with the error cluster.  Now when you finish generating the analog samples, all the tasks will stop in sequence.

This is probably not the "final" vi you'll use, but I hope it illustrates a different approach.

-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.
0 Kudos
Message 23 of 23
(574 Views)