01-06-2012 05:27 PM
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
01-09-2012 12:41 PM
Bump?
Anyone?
01-09-2012 03:19 PM
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!
01-09-2012 04:06 PM
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
01-09-2012 04:28 PM
I believe so, does the error code match what I have? If not, what error code do you get?
01-09-2012 04:36 PM
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
01-09-2012 04:39 PM
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
01-09-2012 10:27 PM
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
01-10-2012 09:06 AM
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.
01-10-2012 09:41 AM
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