From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DigitalStartTrigger for multiple AO tasks 6289

Hi All,

 

I am presently using 6289 card.

 

Following is the configuration i am using.

 

Task1.AOChannels has ao0 and ao1

has corresponding writer1 as analog multichannel writer

 

Task2.AOChannels has ao2 and ao3

has corresponding writer2 as analog multichannel writer

 

Task1 timing are configured to finite sample and rate to be 5000. 

 

Following is the code.

 Task1.timing.ConfigureSampleClock("", 5000, SampleClockActiveEdge.Rising, SampleQualityMode.FiniteSamples, 18000);

 

 writer1.Write(array1) // Array1 is of dimension 2, 18000 and while configuring the task1 the number of samples are configured to this value.

 

while(!Task1.IsDone)

 thread.sleep(100);

 

Task1.Stop();

 

Then i configure Task2 to finite sample, update rate to be 10000. Also i configure Task2's start trigger to ai/starttrigger

Task2..timing.ConfigureSampleClock("", 5000, SampleClockActiveEdge.Rising, SampleQualityMode.FiniteSamples, 500);

 

Task2.Triggers.StartTrigger.ConfigureDigitalEdgeTrigger("/Dev1/ai/StartTrigger",DigitalEdgeStartTriggerEdge.Rising);

 

 

 

Then when i call Task2.Write,

 writer2.Write(data, false) // this isof dimension 2, 500

 

at the above write function call i get this following Exceltion:

 

Specified route cannot be satisfied, because it requires resources that are currently in use by another route.

Property: NationalInstruments.DAQMx.DigitalEdgeStartTrigger.Source

Property: NationalInstruments.DAQMx.DigitalEdgeStartTrigger.Edge

Source Device: Dev1

Source Terminal: ai/StartTrigger

Required Resource in use by: Task Name: Task1

Source Device: Dev1

Source Terminal: software

Destination device Dev1

Destination Terminal: ao/startTrigger

TaskName Task2

Status Code: -89137

 

 Please tell me what is wrong with the code? 

 

Regards,

 

Alok Damle.

 

the subject line looks out of  context of this post. however that is something that i finally need to do. switch the ai/startTrigger between task1 and task2.

 

Message Edited by Alok Damle on 11-11-2008 01:47 PM
0 Kudos
Message 1 of 4
(2,982 Views)

Hi Alok,

If I understand right, you are trying to start your analog out generation based on an external trigger...and you are trying to route this signal to the ao/startTrigger.

To accomplish this you have to use the PFI lines available on your 6289.

In your code you are trying to route the ai/startTrigger to the ao/startTrigger. This will not work.

Instead use the pfi 0 line (pin11 on connector 0) to get the digital trigger and route this to the ao/startTrigger.

You can get more information on PFI routing and device connection at the following links.

 

http://digital.ni.com/public.nsf/websearch/E539D226A643C1CE8625715E007C23C8?OpenDocument

 

http://digital.ni.com/public.nsf/allkb/A7A4024278353BF7862570230072C6E1?OpenDocument

 

http://digital.ni.com/public.nsf/websearch/CF592CB42924F9B986256F320053C5C7?OpenDocument

 

Try this out and let me know if you were successful.

 

Denver

Applications Engineer

National Instruments India

 

 

0 Kudos
Message 2 of 4
(2,958 Views)

HI Denver,

 

I am trying to synchronize my AI and AO. i have done the same with 4461 however because of its low accuracy i am now shifting my application to 6289. As i understand to do a synchronous read and write with the AI/AO the two must share the start trigger. And as per one of the example given under synchronization, best is to route the start trigger of ai to ao so that when you call a start it on AI the AO also starts. 

 

Now the issue i am facing is that i can do that with one of the AO and AI being synchronized. however in my appllication i have to switch the synchronization with another AO. which is not working.

 

The same code is wirking with Task 1. however when i want to switch the trigger to Task 2 it fails.

 

I tried disabling task 1 for some time and starting task 2 directly. This works. so essentially the start trigger can be routed to task 1 / task 2 individually however when i route it to one then even after calling DigitalTriggers.ConfigureNone() i am not able to re-route it to another AO. 

 

I tried stopping the ealier task and then also waiting for a good 10 second before and after switching the triggers. however no luck!

 

Let me know if it is not possible to switch the ai/StartTrigger between two AO  tasks. I dont want to use external PFI trigger cause the application works at a very high update rate and needs to be very accurate and highly synchronized. a single ms delay in synchronization will make work for years to get the calibration of the instrument right! 

 

Regards,

 

Alok Damle.
0 Kudos
Message 3 of 4
(2,948 Views)

Hi Alok,

Sorry for the late response. The reason that you were able to specify two tasks on the 4461 is because that board has separate ADC / DAC for each channel.

This allows you to create multiple tasks without any error. On the 6289, however, all channels are multiplexed over one ADC for AI and one DAC for AO.

Try including your AO generation under one task and select either one of them depending on the trigger. This should resolve the error that you are getting.

 

Regards,

Denver

0 Kudos
Message 4 of 4
(2,900 Views)