Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Two tasks trigger error

Hi,

 

I am trying to start two voltage analog tasks. Each one should start after a digital trigger (start edge) is detected (first task uses PFI0 and second uses PFI1).

When I try to run, I get an error that the trigger resource is already taken.

 

How can I get this to work? Is it even possible for two tasks to wait on two independent triggers?

I am using PCI-6229.

 

Thanks!

 

-- Shay

 

 

0 Kudos
Message 1 of 13
(3,889 Views)

Bump?

 

Anyone?

 

 

0 Kudos
Message 2 of 13
(3,872 Views)

Hi Shay,

 

Based on what I see in your code, the first problem is that you are attempting to two different tasks of the same type.  When I run your code without the triggering VIs, I get error 50103, which is indicating what I described above.  Now, I am not sure exactly what you are doing, but if you need advice about possible workarounds give us a better idea of what you are trying to accomplish and we will be able to point you in the right direction!

Applications Engineer
National Instruments
0 Kudos
Message 3 of 13
(3,863 Views)

Hi,

 

OK. I'll try to be more precise.

 

The goal is to have two voltage out channels that are outputing different wave forms. Each channels should have its own trigger. The two channels are suppose to be completely independent of each other (in the example I uploaded the two shared the same wave form, but that was just to show the point). So, the two tasks are indeed of the same type (i.e., voltage out), but operate on different analog out channels. Is this a problem?

 

-- Shay

 

 

 

 

0 Kudos
Message 4 of 13
(3,857 Views)

I believe so, does the error code match what I have?  If not, what error code do you get?

Applications Engineer
National Instruments
0 Kudos
Message 5 of 13
(3,853 Views)

When I implemented the whole thing in C, I get the following error:

 

 

DAQmx Error: Specified route cannot be satisfied, because it requires resources
that are currently in use by another route.
Property: DAQmx_DigEdge_StartTrig_Src
Property: DAQmx_DigEdge_StartTrig_Edge
Source Device: Dev1
Source Terminal: PFI1

Required Resources in Use by
Task Name: _unnamedTask<0>
Source Device: Dev1
Source Terminal: PFI0
Destination Device: Dev1
Destination Terminal: ao/StartTrigger

Task Name: _unnamedTask<1>

Status Code: -89137
End of program, press Enter key to quit

 

 

0 Kudos
Message 6 of 13
(3,849 Views)

So, the two possible solutions I can think about right now are:

 

1. Get another NI card and program the second voltage output task on the second card 

2. Implement a soft trigger (i.e., a loop that reads from both PFI0 and PFI1 and whenever one goes up, starts the voltage out task). 

 

1 will probably work, but is too expensive right now. Will the second option work, or will two voltage out tasks that are started manually will also collide?

 

-- Shay

 

0 Kudos
Message 7 of 13
(3,848 Views)

If I understand the analog output architecture of M-series cards correctly, there is only a single AO Start Trigger per board, just like there is only a single sample clock for analog output. So it is not possible to create two separate AO tasks that use subsets of the available channels and are triggered by two separate digital events.

 

- Andreas

0 Kudos
Message 8 of 13
(3,839 Views)

Andreas is correct.

 

You would have to manually do the output one step at a time, outputting 0s on the second task until that soft trigger is hit, for most applications this is not ideal, but sufficient depending on requirements.

Applications Engineer
National Instruments
0 Kudos
Message 9 of 13
(3,834 Views)

Hi,

 

Thanks for the help!

I need micro-sec precision for this task, so I guess I am left with option 1 (getting a second card).

 

One remaining question - will other architectures (say X) be able to do this, or is the only solution using two cards?

 

-- Shay

 

0 Kudos
Message 10 of 13
(3,830 Views)