Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Error -89137 trying to start single point AO on mixed-card PXI chassis

Solved!
Go to solution

I'm working on a project with a couple of older PXI racks that are running a bunch of older PXI-6232 multifunction cards (like 10 of them per chassis).  We added a PXIe-4340 LVDT card a couple of years back and I was kind of hoping they would all be running off the same reference clock (or ref clocks that were ultimiately derived from one another on the backplane), but that turned out not to be the case.  We recently discovered the LVDT card drifts away from the other daq channels by a few ms per minute.  Not a big deal on short runs but the software runs for 3 or 4 days at a time.

 

Okay, so I did find a solution that keeps them all in sync with each other.  The 4340 was already manually set to use the PXIe_Clk100 as its reference clock and I modified the 6232 card tasks to use individual routes out to the PXI_Clk10 (like PXI1Slot5/PXI_Clk10, PXI1Slot6/PXI_Clk10, etc) as their reference clocks (they were not set before so default to OnboardClock).  Everything was already set to start with a common trigger line (the first 6232 card's aistarttrigger).  Each card has its own task, by the way, you can't do a multi-card task with the older 6232 cards.  So from there you start all the tasks except the first one (that holds the trigger line) then start that first one and everything is off to the races.

 

Okay, so skipping past my problem for a second, this works.  They don't drift apart like they did before.  However, this led me to another problem with a single point, software timed AO task.  We just write new values out to AO tasks on control value changes.  That worked fine before but now it's throwig a -89137 error:

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

Source RefClk.Src  Source Device PXI1Slot10  Terminal 10MHzRefClock required by terminal PXI_Clk10 Destination RefClock.

 

My biggest confusion here is why does a single point AO task need a reference clock at all?  I haven't had a chance to jump back on this machine (I only get narrow windows of time to remote in), but do I need to manually set the AO tasks to also use the PXI_Clk10 as the reference clock per this document?  

 

One part of that doc states:

If you plan to use multiple subsystems like AI, AO, DIO, or Counters at the same time, you must define the same reference clock for all of the tasks created. Do this by using the NI-DAQmx timing properties (Reference Clock Rate and Reference Clock Source), which should be set before any other channel configurations (such as triggering and timing).

 

I know .. try it .. but it's going to be a major rewrite.  This software was originally designed to be super modular with a bunch of OO fun so all the tasks are set up in their own little object lands and this would require I coordinate them all to create task, set ref clock, rendezvous them all (when they're largely set up sequentially now), then do the rest of the channel setup.

 

I just want to make sure that's the source of the problem here as it just feels really unintuitive that a super intermittent software-timed AO task needs a clock at all.

0 Kudos
Message 1 of 6
(215 Views)

I have played only a bit with AO on N PCIe cards clock-synced through RTSI cable, so basically same concept as in your case.

Doc states that AO SW timed generations are referred as immediate or static operations and are typically used for writing a single value out, such as constant DC voltage.

 

nidaqmx python examples shows the most basic example, which tends to align with your assumptions

task.ao_channels.add_ao_voltage_chan("Dev1/ao0")

number_of_samples_written = task.write(1.1)

 

Or more complex but still with no call to any cfgsampclktiming()

https://wiki.freepascal.org/NI-DAQmx_and_NI-DAQmx_Base_examples#Analog_output_software_controlled

 

 

Is the AO the only task on the device or do you have input task also ?

 

 

0 Kudos
Message 2 of 6
(183 Views)

There are like 12 AI tasks, 1 for each 6232 (x10), 1 for the LVDT card and 1 for a thermocouple card.  There are 4 AO tasks, each targeting one of the 6232's.  There's also a timed AO task but it's targeting a dedicated AO card and isn't causing any problems (it doesn't need to be synced to AI, it's just to playback waveforms).

 

I might try just not setting up an AO task to hold onto and setting it up / writing to it "on demand", then clearing it, but I suspect the problem will be the same.

 

There are no calls to a daqmx timing function on the single point ao task lines, it's 'create task' -> add global channels to task -> then calls to write as needed, then clear on shutdown.

 

Anyway, thanks for the reply, I was just hoping I wouldn't have to rewrite that whole block of code.  I've got a "simple" test vi that I can probably add this too to make sure it works before committing to rewriting the rest of it.

0 Kudos
Message 3 of 6
(174 Views)

I will try on my side. I have been using AO with timing function because I was outputting from 0 to 1 in mV steps at the convert clock rate (mono DAQ device so serializing the captures) to confirm the accurate sync of my X cards.

 

Will take some time to just output a unique voltage as in the example and see if I get the error

0 Kudos
Message 4 of 6
(161 Views)
Solution
Accepted by topic author mdwebster

I tested and I get error -89137 for any AO task.write(...) after the start of the master device. If I write before master starts, things look OK. 

My AI task is reading internal channel _ao0_vs_aognd so I could check that the write for AO output the right vqlue

 

But that means I am currently only able to set AO before everything starts then I can't change it.

 

Some people had same issue previously but they just played with setting src and rate, which you have already proved to be OK but annoying. 

https://forums.ni.com/t5/LabVIEW/Problem-with-simultaneous-AI-and-DO-tasks-Error-89137/td-p/3320075

 

No one knows how you can (re)program stuff after starting the AIs ?

0 Kudos
Message 5 of 6
(156 Views)