Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronized AI read with encoder Position c# no Measurement Studio

Hallo Everyone,

 

I am very new to the topic of programming DAQ so I hope you can help me.

 

My Setup: I got a USB-6210 card, I am using Visual Studio 2013 so I can't use measurement studio and (obviously) I want to do all this in C#. Most tutorials are LabView only 😞

 

I want to aquire two (or more) AI signals and one position signal from an encoder at a fixed sampling rate. I don't want to aquire one DataPoint each encoder step, but at a fixed rate.

 

What should I use as the (as it seams: mandatory) external clock? As far as I understood the encoder reading I cant use a normal interal clock at a fixed rate. So I would need to generate a digital signal at the necessary rate and use that one as my clock. Or is there a more... elegant way?

 

In addition i couldn't find how to initialize the Encoder at a starting position and running it without reading it. The encoder should be tracked at all times but I only need the AI over Position Data from time to time. How do I initialize the Encoder but not reading its Data in c#? Is generating the Task enough to set the encoder "live"? And adding the counterReader is optional as soon as I need the data? Or do I need to read it at all times and just discard all the information.

 

As soon as I want to start measureing how do I correctly synchronize the position and the two(or more) AIs? It is !extremly! important that the gathered postion matches the read analog values. As all data transfer is async how can I match the 3 data lines together? Just by sample number? Should work as the clock is the sam, doesn't it?

 

And how do I trigger all the measurement so it is synchonized and has the exact same startingpoint? Would it be best to trigger it all just via the external clock (which would be off as long as I dont want to read) or is there a way to call a StartMeasurement and all 3 (sync) aquirations start at the exact same point? (So maybe I start acquiring AI1, which triggers AI2 which triggers the read (not the start) of the Encoder Signal?)

 

 

I know this is a lot of questions but the c# Tutorials dont really help out with these kinds of problems and the library documentation is by far to big to find out all the "tricks".

 

Thanks in Advance,

 

Kevin

0 Kudos
Message 1 of 1
(5,426 Views)