Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

two sequential dynamic generation engines

Hi

 

I was wondering a way to have two dynamic generation engines. The first engine should generate the outputs and stop, after this the second generation engine should start. Also ideally these two generation engines should be able to have two different triggers. What is the point where I should stop the first engine and start the second one? I have the following sequence in mind

 

Init Gen Engine -> Assign Dynamic Chn -> configure clock & Trigger -> Write Data -> Inititate -> Wait until Done -> Init Gen Engine2 -> Assign Dynamic Chn2 -> configure clock2 & Trigger2 -> Write Data2 -> Inititate2 -> Wait until Done2 ->Init Gen Close

 

Is this sequence valid? Is there gonna be any time delay in between these two gen, engines? Can we use just one Gen close engines when we have two Init Gen Engines. Please let me know a way to do this.

 

Thanks,

Priyatham.

0 Kudos
Message 1 of 5
(3,744 Views)
Forgot to mention Im using PCI 6551
0 Kudos
Message 2 of 5
(3,743 Views)

Priyatham,

 

Your flow is certainly doable but you have an uneccessary "Init Generation" step.  Since you're doing a reconfiguration, there will be software delay between the two "engines".

 

You need  a "close" for every  "Generation Init" you call (you have to close ever session you open).  Every initiate, needs a "done" (either a stop, or done state from the end of a waveform generation).  You can have as many initiates and reconfigurations you want between an "open" and "close".

 

Is that what you are asking?

0 Kudos
Message 3 of 5
(3,725 Views)

Hi Ryan

 

Thankyou very much that was exactly what I was asking. I have tried out the sequence (excluding second Init Gen as you noted) and it works, I also see the software delay you mentioned. Is there any way to avoid this delay between first generation and the second generation? The channels in the first gen. engine and second gen. engine are different, but unfortunately I can't merge these two engines into one(because of the complexity involved in my design).

 

I do not have to reconfigure the clock second time necessarily, I just have to assign the channel, write waveform and Initiate. Would any change in the order of these VIs take out the software delay because of re-configuration?I don't care if there's a delay initially, I just cant have any delay between the two patterns.

 

Thanks,

Priyatham. 

0 Kudos
Message 4 of 5
(3,721 Views)

Pryiatham,

 

 If you know the second waveform ahead of time and you don't have to change any of the channel attributes (just which channels you're using), you can use the 6551 with a single session.

 

You can use the "Z" symbol (for tristate) as a value in your waveform.  Here's a quick example - let's say I want my first waveform to only use channels 1 and 2, and I need my second waveform to use channels 3 & 4.  I could do them like this:

 

Channels 1-4, Waveform 1

 

0 1 Z Z

1 0 Z Z

1 1 Z Z

0 0 Z Z

 

Channels 1-4, Waveform 2

 

Z Z 0 0

Z Z 0 1

Z Z 1 0

Z Z 1 1

 

Do you see what I'm getting at?

 

With the scripting capbility of the 6551, you can use a generation start trigger to kick off the first waveform and then wait on a separate script trigger to start the second waveform.  As long as you assign the union of the two sets of channels to your generation session and make sure to use the tristate symbol for unused channels in each waveform, it sounds like you'll be able to do what you want.

 

I hope I'm not oversimplifying your problem and that this helps,

 

Keith Shapiro

National Instruments R&D

0 Kudos
Message 5 of 5
(3,711 Views)