Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Fast sync of input and output voltage signals with NI USB 6341 and Measurement Studio (C#)

Solved!
Go to solution

I need to implement a synchronized input and output voltage cycle with the NI USB 6341 in C# which executes quickly.  For example, a typical cycle would consist of 160,000 discrete output voltages paired with 160,000 discrete input voltages.  This cycle needs to complete within 30-40 seconds.

 

In more detail, the output voltages will be sent out as an (x,y) pair on AO.0 and AO.1 and the input voltage will be received on AI.0. Once a voltage pair is sent out, there will be a short "dwell time" (ms) before a corresponding input voltage is received on AI.0.  The output voltage pair is pre-calculated and ultimately maps out a raster (rows & columns).  At each point in the raster a voltage is returned which is converted to a grey-scale (0-255) pixel value.  In otherwords, an image is created corresponding to the raster area.

 

I'd like to know what mechanisms and functions I would need to implement using C# & Measurement Studio?  I do know this has been accomplished using LabView.

 

Thanks

ZappleDD

 

 

0 Kudos
Message 1 of 6
(5,901 Views)
Solution
Accepted by topic author zappledd

If you could give me a little more information about what your hardware setup is it might help. Specifically what is confusing me is when you talk about "dwell time." Why is it taking a matter of milliseconds for the output to loop back around to the input?

 

Also, how will you be using AI0 to read the output of both AO0 and AO1?

--------------------------------------
0 Kudos
Message 2 of 6
(5,880 Views)

What I didn't mention is that the output is not directly connected to the input.  There is another device in the loop which receives the (x,y) output voltages from the 6341, does some positional functions based on that (hence the dwell time) and then generates a voltage as a result which is received on AI.0.

 

Thanks

0 Kudos
Message 3 of 6
(5,876 Views)

OK, that makes a lot more sense. In terms of synchronization, what are you actually trying to do? Match each output with the corresponding input?

--------------------------------------
0 Kudos
Message 4 of 6
(5,862 Views)

As each output voltage pair (x,y) is generated on the 6341 and sent out to the instrument, the resulting incoming voltage must be matched up to it. This is because the (x,y) voltage corresponds to a coordinate position which I use to calculate a pixel position in the final image I'm building up. Its actually doing a raster.  

 

According to the spec, the (x,y) voltage needs to hold steady for a number of ms (dwell time) in order for this input voltage to be generated correctly.  Hope that helps.

 

Thanks

0 Kudos
Message 5 of 6
(5,860 Views)

It sounds as if the actual order of the input and output data is going to be the same, so you should be able to match it up 1:1 in post processing. Is the issue a matter of compensating for the time shift due to the dwell?  Or is it how to generate the dwell?

 

Sorry for so many followup questions. If I'm missing the obvious, I apologize.

--------------------------------------
0 Kudos
Message 6 of 6
(5,843 Views)