Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

C# hardware wait function

Hi,

 

I am using DAQmx in C# without Measurement Studio, and I am trying to synchronize a two-axes stage with a camera. AO0 provides voltages to the X axis and AO1 provides voltages to the Y axis. The camera would take one frame after receiving a digital pulse.

 

The sudo code of take a video would be like this:

 

loop

{

   // Supply AO0 with vx1

   // Supply AO1 with vy1

 

   // wait for xx us

   

   // Supply AO0 with vx2

   // Supply AO1 with vy2

   

   // wait for xx us

 

   // Trigger the camera

}

 

I am new to this and after looking at couple examples, I found the logics in most examples are quite different than what I am trying to do. It would be very helpful if somebody could answer my questions below:

 

1. How do I implement a "// wait for xx us" function based on a hardware timer (preferrably the internal 20MHz clock)?

2. Is there any way to control execution time of one loop iteration, cause that means I can control the frame rate of the video?

 

Thanks,

Joe

0 Kudos
Message 1 of 4
(3,917 Views)

Hi joehsiao,

 

Thank you for posting in the discussion forums. As you know, you posted in the forum Measurement Studio for .NET Languages, so most of our expertise is in using Measurement Studio. However, I will do my best to try to help you. Which development environment are you using, and which hardware are you using?

 

Tina K.
Applications Engineering
National Instruments
ni.com/support
0 Kudos
Message 2 of 4
(3,885 Views)

Hi Tina,

 

Sorry about posting the questions in the wrong forum. Could you point me to a more appropriate one?

I am using a legacy PCI-6502E card on the developement machine. On the production machine I plan to put two PCIe-6323 on it, but I figured the same code sould run fine on both cards. The software enviroment is DAQmx 15.1 and Visual Studio C# 2015.

 

 

0 Kudos
Message 3 of 4
(3,872 Views)

@joehsiao wrote:

Hi Tina,

 

Sorry about posting the questions in the wrong forum. Could you point me to a more appropriate one?

I am using a legacy PCI-6502E card on the developement machine. On the production machine I plan to put two PCIe-6323 on it, but I figured the same code sould run fine on both cards. The software enviroment is DAQmx 15.1 and Visual Studio C# 2015.

 

 


http://forums.ni.com/t5/Multifunction-DAQ/bd-p/250

 

You will probably find that the majority of people use LabVIEW.

0 Kudos
Message 4 of 4
(3,864 Views)