LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

[DAQmx] Task triggering: error -200262

Dear all,

 

I'm trying to trigger an analog output task with a counter output.

When I run the code withtout triggering, it works (but the tasks are not synchronized, as expected).

But, when I trigger the analog task with the output of the counter, I encounter an error directly after the "DAQmx Write" vi.

 

The error is: 

Error -200262

An attempt has been made to configure a trigger without configuring the appropriate sample clock properties or when Sample Timing Type was set to On Demand.
Configure the sample clock type to something other than On Demand to use a trigger.

 

As you can imagine, I tried to configure the sample clock but I encounter another error (Non-buffered hardware-timed operations are not supported for this device and Channel Type.
Set the Buffer Size to greater than 0, do not configure Sample Clock timing, or set Sample Timing Type to On Demand.)

 

Could you help me please?

 

Task_Generation.png

Thank you!

 

0 Kudos
Message 1 of 9
(261 Views)

First and foremost, what DAQ model are you using? as the features vary widely by models.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 9
(227 Views)

Hello,

 

It's a USB-6363.

Thanks,

Sébastien

0 Kudos
Message 3 of 9
(211 Views)

I must admit, I was kinda surprised to read that triggering wasn't allowed for an on-demand output task (and which may also apply for input tasks?).  I guess I never ran into a situation where I wanted to try to do that.

 

Can you describe in more detail what you hope to accomplish with that specific kind of config?  There are probably some decent workarounds available, but I'd first need to know what target you're aiming at.

 

I suspect that in the code you posted, the counter task is only there to simulate a pulse signal that will later come from some external source that you don't control.  There's really no other purpose I can see for the counter task as the code stands now -- it only seems to get in the way with this attempt to use it as a software-controlled trigger signal. 

    You could simply get rid of the counter task altogether and configure the AO task without a trigger to get the behavior your code is trying to accomplish (after managing a couple details about the sequence of writing to the task, starting the task, and whether the write operation enables 'auto-start' or not.) 

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy coming to an end (finally!). Permanent license pricing remains WIP. Tread carefully.
0 Kudos
Message 4 of 9
(187 Views)

Hello,

My application is to control a microscope with 4 cameras, 8 lasr lines, 3 axes stages, etc.

 

I really need to use a counter that sends pulses on demand during a defined time.

This counter will trigger 8 AO generation, 4 DO generation with a rising edge and other DO on the falling edge.

 

The synchronization of all tasks with the counter is really comfortable (I already did that with another system).

 

Do you understand now my purpose? The counter trigger everything on my system.

 

Sébastien

0 Kudos
Message 5 of 9
(182 Views)

No, I don't understand your purpose yet, at least not well enough.  Among the things I'm not sure of:

 

1.  You say you want the counter pulse to "trigger" AO and DO.  One thing I've seen pretty often on the forums is a mixup between a trigger and a sample clock.   These are very distinct things in the world of DAQmx.  It seems that many instruments use the term "trigger" to refer to the thing that DAQmx calls a "sample clock", so folks who have prior experience with other kinds of devices often talk about a trigger when in the DAQmx world, they should be talking about a sample clock.

    In short, I don't yet know if you & I mean the same thing when using the term "trigger."  So for the sake of clarity, I would need to understand your intentions and expectations about what the AO and DO should do in response to the counter's pulse(s).  

 

2. I don't believe that you can have 2 distinct DO tasks active at the same time.  So I don't think it's even possible to have one such task react to a rising edge while the other reacts to a falling edge of the same signal.   Your device would only support 1 such DO task at a time and you'd need to choose just 1 polarity to react to.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy coming to an end (finally!). Permanent license pricing remains WIP. Tread carefully.
0 Kudos
Message 6 of 9
(142 Views)

Thank you.

In the world of research in electronics and computer engineering, we talk about TRIGGERING when a device receive or send a TTL pulse to be activated / desactivated / make a task, etc.

Here, I'm not speaking about sample clock.

I really mean TRIGGER.

 

You CAN haeve pultiple DO and AI and AO at the same time and they can be synchronized but a pulse coming from a counter.

I already did it with 8 AO and 4 DO.

My purpose is that I don't want to send a waveform  but simply a value to the analog ports.

0 Kudos
Message 7 of 9
(130 Views)

241030_SimpleTriggeringArchitecture.png

0 Kudos
Message 8 of 9
(126 Views)

The timing diagram is very helpful.  I'm basing my detailed comments on what I see there.

 

Summary: in addition to your master counter output task, you need 1 buffered AO task (where the buffer is filled with the constant value 5V), and 3 additional counter output tasks (note: not DO tasks!)

 

1. Master Counter Pulse task

    Set the frequency and pulse width you need.  Wait and be sure to start this task LAST.

 

2. AO task

    This needs to be a buffered & triggered continuous task, triggered by the rising edge of your master counter.  Write multiple 5V values to the buffer before starting the task.  The default behavior is to keep regenerating the values in the buffer, so you need to write a big enough buffer to allow the repeated USB transfer of buffer values to work efficiently.  0.1 second worth of values will likely be enough.

    There's also a way to configure your task to do regeneration from the onboard buffer rather than via repeated USB transfer.  That can work too, but is probably not necessary to learn for this app if you don't already know how to do it.

 

3. Laser On/Off task

    The falling edge doesn't seem to correlate with any other digital transition.  Thus, this needs to be a retriggerable single pulse counter task.  It triggers off the master counter's falling edge and has the pulse width you choose.  Note: if your pulse width lis onger than the time until the next master counter falling edge, you'll miss that next trigger.  The laser won't react again until the trigger after it has completed its full pulse width.

 

4.  Camera pulse tasks - the common parts

    Similar considerations as the laser pulse.  Falling edges don't correlate to any other signal so they need to be retriggerable single pulse counter tasks.  They seem to have minimal pulse width so you're probably unlikely to have issues with missed triggers.  The only apparent difference is that they are triggered by opposite edges of the master counter.

 

5.   Camera Readout End task - the unique part

    While this task will normally be retriggered by the master counter's rising edge, it doesn't want to be started by the very first rising edge.  It wants to wait until the 2nd rising edge.

    There's actually a way to do this with a counter task.  In addition to the normal rising edge Start Trigger, you'll also need to configure the special "Arm Start trigger".  The Arm Start trigger needs to happen to put the task into active mode.  After that, every "regular" start trigger will re-trigger this task to generate a single pulse.

    So here, you can set the Arm Start trigger to be the falling edge of your master counter task.  The first falling edge arms it so that the 2nd rising edge begins the retriggering behavior.

 

I'm running out of time now, but a little searching should get you more details about configuring the Arm Start trigger and retriggering for single pulses.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy coming to an end (finally!). Permanent license pricing remains WIP. Tread carefully.
0 Kudos
Message 9 of 9
(115 Views)