Jump to content

DAQmx Change Detection w/Timing VI


Bryan

Recommended Posts

In my PXI system, I dynamically create a channel/task with all of my lines/ports that are configured as inputs.

Using the DAQmx Timing Polymorphic VI (with Change Detection selected) I wire my task and the same physical channels used to create it to the VI. My intent is to monitor all input digital lines and return all of the input values if any line changes state at any time.

Now, the VI has a timeout terminal (in seconds) that you can set to -1, which makes the VI wait indefinitely for a change on the input lines. This matches what I want to do, however, when I want to stop monitoring the channels, I have to wait until another state change before the VI will return.

I've tried doing like I've done with queues and destroying/clearing the tasks, hoping that it will force the VI to return with an error, but nothing happens.

Is there a way that I can abort the VI while it's waiting through the software? I'm currently searching through the DAQmx VI palette for functions that might hold clues. My unfamiliarity with DAQmx isn't helping either. :headbang:

One way I can think of to do this is to wire one of my output lines to one of the input lines I'm monitoring, and when I want to abort it, set the output line high, which will generate the change and have the function return. I'd like to avoid tying up any of my digital lines like this if possible.

Thanks guys!

Link to comment

Nevermind guys,

I set up a scenario and monitored the PXI controller processor performance using the change state timing VI and found that CPU usage went up to 100% or so. I created my own version of a digital input monitoring VI using the task start and read channels VI with my own 'new value notification" and it used FAR LESS resources. (CPU usage with just my VI alone allowed it to drop to < 8%). I think the DAQmx timer change state function was monitoring the channels at full processor speed (~2GHz) with is MUCH faster than I need for my application.

Sorry to end up solving my own problem, but hopefully it will help those who might run into the same situation.

Thanks anyways! :D:P

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.