Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Share a start trigger for multiple analog input tasks on a single board

Hello,

 

I am using M-Series cards. I have created two analog input tasks, task1 and task2 on a single card. These tasks are collecting data for different processes with different sample rates on different channels. I have specified these tasks to have their sample clocks referenced to yet another analog in task on another board task3, which is working fine. The problem I have is that I would like these tasks both start when task3 starts. Therefore, I did the following:

 

 

                       task1.Triggers.StartTrigger.ConfigureDigitalEdgeTrigger("/" + Properties.Settings.Default.Task3Device +
                            "/ai/StartTrigger", DigitalEdgeStartTriggerEdge.Rising);
                       task2.Triggers.StartTrigger.ConfigureDigitalEdgeTrigger("/" + Properties.Settings.Default.Task3Device +
                            "/ai/StartTrigger", DigitalEdgeStartTriggerEdge.Rising);
However, when I try to start these two tasks
task1.start()
task2.start()
I get an error saying that " The specified resource is reserved". I think this is because both task1 and task2 are referencing the same Start trigger terminal to get their start triggers (ai/StartTrigger on the device they are created on). How can I start two analog input tasks on a single board synchronously?
Thanks.
-Jon
                        

 

 

0 Kudos
Message 1 of 5
(3,976 Views)

Hi neuronerd,

 

Have you stumbled upon this similar DF thread yet? Hopefully this will shed some light on your specific issue.  It seems you may need to adjust the way you are calling the start trigger, give that a try and let us know what you find! 

Regional Account Manager
NI
0 Kudos
Message 2 of 5
(3,962 Views)

Hi K,

 

Yes, I saw this, but my issue is different. Because that person wanted to start AO and AI tasks simultaenously, they use the /Dev1/ao/StartTrigger and /Dev1/ai/StartTrigger to provide two different terminals for AO and AI Tasks.

 

My question is, what if I have two AI tasks on the same card? How can I start these simultaneously? If I assign them both a start trigger terminal of /Dev1/ai/StartTrigger I get the " The specified resource is reserved" message I mentioned earlier when I call task2.start() after task1 has already been told to start. Can I route the start signal to another terminal (like a PFI line) and tell task2 to start using that as a trigger? If so, then how? Thanks!

 

-Jon

0 Kudos
Message 3 of 5
(3,954 Views)

neuronerd, 

 

You are correct this is different from what you are attempting I apologize.

 

With your M series card there is only a single timing engine for analog inputs which is multiplexed, so in this configuration you will not be able to (based on hardware limitations) start two different analog input tasks on the same start trigger.  The DF linked above was using two separate engines and therefore never had an issue arise.

 

What we can do for your application is to combine both reads into a single task, sample at the higher rate, and decimate to get your second lower rate.   This way both will start simultaneously yet through software you will be able to divide down and achieve both desired rates. 

 

Regional Account Manager
NI
0 Kudos
Message 4 of 5
(3,942 Views)
0 Kudos
Message 5 of 5
(3,901 Views)