Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Simultaneously triggered AI and AO on 6024E with Measurement Studio for .NET

Solved!
Go to solution

Hello,

 

My apologies if similar questions have already been asked; I scoured the site for about 1.5 hours... but anyway,

 

I have a PC set up with a 6024E card and running Measurement Studio Enterprise with Visual Basic .NET 2008. (If someone could help with VC#, that would work too). I use LabVIEW a lot, but for this application I have to use Measurement Studio.

 

I want to set up a task so that an analog output starts on a digital trigger, and a single analog input begins measuring on that same trigger? [I want to see the output of a sensor based upon the analog output's excitation]

 

Is this possible with the 6024E card? And if so (and also if not, as I can try possibly purchase a card that would support this), how would I go about doing it with Measurement Studio?  I've been able to successfully read and write via input.Read() and output.WriteAsync(...), respectively, but how would I do what I'm asking about, with a trigger?  Particularly on the input side... how would I know when data was captured (polling?).

 

Any basic sample or guidance would be helpful.  I am quite well versed in VB.NET and am ok with VC#.NET, so anything that anyone could offer up would be appreciated.

 

Thanks,

0 Kudos
Message 1 of 3
(3,944 Views)
Solution
Accepted by topic author zaba

This can be accomplished by starting with the DAQmx example Synchronized AI-AO, adding a digital trigger to start the AI/AO and even set it to be retriggerable. Set up a counter to output pulses based on a digital trigger (set retriggerable property to true). Set up an Analog Input task where the clock source is the counters internal output. Start the AI task because it will be waiting for the counter to output before it takes any samples. Set up an Analog Output task where the clock source is the counters internal output. Start the AO task because it will be waiting for the counter before generating any samples. Start the Counter Task, now the counter task will be waiting on the trigger to output. As soon as the trigger is received the counter outputs a pulse train and both the AI and AO use that as the sample clock to acquire/generate. Since they are using the same sample clock they will be synchronized.

 

-Ciao! 😉

Message 2 of 3
(3,915 Views)

Thanks! 

 

I'm not sure how I missed that example.  I did it differently by writing to an output, which was then used by a circuit I had on the output. This physical circuit then generated the trigger I needed when I needed it, but thanks for your suggestion as well.

 

I took the sample, customized it to my needs and created a class around it which encapsulates everything into a nice object, so I hopefully never have to think of it in the nitty-gritty details again 🙂

 

Thanks again

 

Andy

0 Kudos
Message 3 of 3
(3,906 Views)