Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

QMH: create user Event in Consumer Loop

Solved!
Go to solution

Hello Together,

 

for my issue i was searching for an solution but didn't find one.

System: Labview 2015, Service Pack 1, Using a PCIe-6323

 

Sorry for not posting the Vi, it's a rather big one whereas only a small part is relevant:

 

I'm Using the QMH Example and expanded it quite much:

 

WWolf78_0-1615291901972.png

 

 

My Problem:

I've registered an Stop event if the stop button is pressed.

 

at the DAQ there is an emergency button, which shuts down some of the hardware.

I want to register this one as an event to switch to a specific handling, on which i can restart some of the hardware and do some resettings with user interaction:

 

But:

I'm not able to register this DAQ Input as an Event.

 

something like this does not work:

WWolf78_1-1615292087726.png

 

must of the examples register this one before the user event, which is not possible in my case, as I register the inputs in the consumer loop

 

how can i register an Event on an DAQ input, beside the Exit and button events in the consumer loop?

 

Thanks in Advance!

0 Kudos
Message 1 of 23
(1,552 Views)

Hello Together

 

I've moved forward but I got stuck anyway:

 

I've moved the Initialisation of the Inputs into the "create User Event vi:

 

WWolf78_0-1615458644209.png

 

whereas I try to initialize an Dynamic Event for change detection:

 

WWolf78_1-1615458691670.png

 

 

BUT IT DON'T WORK

 

If I try use this one:

WWolf78_2-1615458775396.png

I get an Error

 

 

how can I use an Input of the DAQ Device for a dynamic event??

 

 

 

 

0 Kudos
Message 2 of 23
(1,494 Views)

Please specify what error do you get when using the vi. 

0 Kudos
Message 3 of 23
(1,488 Views)

this one:

 

WWolf78_0-1615478920577.png

 

0 Kudos
Message 4 of 23
(1,485 Views)

which means:

 

WWolf78_0-1615478979517.png

 

 

If I try to set the Buffer by property note to "0" the inputs don't work in the following procedures

 

0 Kudos
Message 5 of 23
(1,483 Views)

Not completely sure what you want to do, but maybe can offer some advice.

 

It looks like you want to register for a "Change Detection" Event. This is when the digital line changes form Hi to Low or Low to Hi. You decoupled the registration from the loop which can work, but is harder to make sure it works correctly.

 

I suggest registering for the DAQ event in the loop where you use the DAQ. You can create a state where you register/unregister for the event as needed in your loop. When you are decouple, it's harder to do. See below.

Snap71.png

 

mcduff

 

0 Kudos
Message 6 of 23
(1,472 Views)

Hi mcduff,

 

thanks for your reply!

sorry for not explaining my issue in detail, I'm way to deep in my program to notice.

(and it looks like you've a newer Version of Labview than mine [2015])

 

in my device I have 16 inputs, from which I want to register a dynamic event of one; the emergency button. Beside I have 17 outputs, that's why I've implemented them in an VI

 

I'd like to have an event at changes of Input "Sirius"

WWolf78_1-1615529915017.png

 

 

If I try like this, I got the following error

 

WWolf78_0-1615529877466.png

 

 

 

 

any suggestions ?

 

 

 

0 Kudos
Message 7 of 23
(1,469 Views)

Specifically focusing on the DAQmx error:

 

X-series boards like yours support hardware-clocking features such as change detection and buffering *only* on port 0.  Apparently, your task contains at least 1 line from a different digital port.

 

You'll probably need to make a separate task solely dedicated to change detection on the emergency stop button while all the *other* DIO is in one or more software-timed tasks.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
Message 8 of 23
(1,460 Views)

Hi together,

 

thanks for the hint, I've implemented those as suggested!

 

WWolf78_0-1615874508811.png

 

Good News:

I can register those as events without getting an error,

 

Bad News:

It don't word. If I press one of the buttons I've registered as an Event, nothing happen.

Try to find the error in this point...

 

 

0 Kudos
Message 9 of 23
(1,442 Views)

I think you *ARE* getting an error somewhere but not noticing it.  Your attempt to create 2 or more "change detection" tasks on the same device *will* produce an error, though it may not occur until you attempt to start more than 1 of those tasks. 

 

Odds are, this task error propagates in your code and prevents your "Generate User Event" call from functioning.  Can't say for sure because your screenshot doesn't show that part of the code.

 

But definitely you'll need to put all the "change detection" DI lines into 1 common task.  And when you service that task, you'll need to figure out which of the lines caused a change detection sample to happen.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 10 of 23
(1,438 Views)