Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Ni 6259 - multichannel reading and synchronization

Hi @all,

I have a question about using my PCI6259 DAQ board. At first let me describe what I would like to do. In my System there are 4 different sensors. And two motors to control. (2 Sensors on each motor). Now I would like to control this system with a rate of 100Hz. That means to get the sensorvalues with 100Hz and to write the values calculated by the PID-Algorythm with the same 100Hz to the motors.

 

In case that I want sometimes to use both groups of sensors at the same time and sometimes only one group, I  think I should create three Tasks.

 

ai_sensorsMotor1 //with 2 channels to read the two sensors on Motor1

ai_sensorsMotor2 //with 2 channels to read the two sensors on Motor2

ao_Motors //with 2 channels to write the calculated values to the Motors

 

Now I configured on each task a SampleClock with a rate of 100Hz. When I started the tasks I began to read multisamples. There you can define a AsyncCallback function.

But this is only called when the read is done and not when 0,01seconds passed. What I want is to have a callback function which is called 100times a second and gives me the aquired values from each Task. So that I can calculate the new values and write them 100times a second to the Motors.

 

For me it´s important to work on a deterministic time base with every task.

 

So how would you do this? What kind of solution do you have in mind?

 

Would be great if you can drop some ideas or explanations.

 

With best regards,

Cube

 

EDIT:

I work with MS VS2008 and C#

Message Edited by BrokenCube on 09-18-2008 10:29 AM
Message Edited by BrokenCube on 09-18-2008 10:35 AM
0 Kudos
Message 1 of 3
(2,783 Views)
Nobody an idea how to get data with a deterministic time rate up to the user?? Or how to aquire and hanlde data in a exact time frame...
0 Kudos
Message 2 of 3
(2,756 Views)

Hi,

 

well the only real solution to run your application deterministically is using a real-time OS. On a Windows system you never can be sure, that the OS doesn't interrupt your control algorithm, but stable loop rates are at least as important as a good tuning of your PID parameters.

 

In fact I can see two options here:

  1.  Run your application in a real-time environment. NI real-time solutions run on PXI-systems and on Desktop-PCs, that meet specific requirements. For this approach you could use C-programming (LabWindows/CVI Real-Time) or graphical programming (LabVIEW Real-Time).
  2. Use a dedicated motion controller for your motion control task. These devices run the motion control onboard, so you don't have to care about the real-time execution in your application.

I hope that helps,

 

Jochen Klier

National Instruments

0 Kudos
Message 3 of 3
(2,749 Views)