DQMH Consortium Toolkits Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Helper Loops using DAQMx tasks

Hi All,

 

Sorry if this has already been discussed. 

 

I have seen a number of examples of instrument DQMH modules with helper loop where the helper loop is enabled / disable by setting the Timeout value of the timeout event case and doing the instrument sampling or read data in the timeout case.

 

Instead I have been starting and stopping a DAQmx task in the helper loop and in registering or unregistering a dynamic DAQmx event like "Every N samples Acquired in Buffer", and reading the data in that event case. I am happy this method works for me, but I was curious on other viewpoints comparing of these two solutions? 

 

cheers 

 

Danny

Danny Thomson AshVire Ltd
0 Kudos
Message 1 of 4
(1,522 Views)

I'd say that if you have something (especially hardware) that takes care of your timing, then by all means use it!




DSH Pragmatic Software Development Workshops (Fab, Steve, Brian and me)
Release Automation Tools for LabVIEW (CI/CD integration with LabVIEW)
HSE Discord Server (Discuss our free and commercial tools and services)
DQMH® (Developer Experience that makes you smile )


0 Kudos
Message 2 of 4
(1,502 Views)

I have changed the helper loop design a little on occasion.

 

One thing I've done when determinism is important, is change the helper loop while loop to a timed loop structure.  By doing this, I can manage the priority of the loop among other things.

 

Then inside the loop the event structure timeout is simply set to 0.  ie. I let the timed loop structure manage the loop timing.  

 

Another option that the event structure has a timeout of 0 and is a small part of the loop at the beginning, only to check if the Stop Module request was received.  Other than that, the loop business code is inside the timed loop (and not inside the event structure)

 

There is plenty of opportunity to make the helper loop flexible to meet your specific module requirements.

 

Christopher Farmer

Certified LabVIEW Architect and LabVIEW Champion
DQMH Trusted Advisor
https://wiredinsoftware.com.au

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

Hello @danny_t,

I'm using the same method.

Just let me point out this thread that is talking about this very topic --> https://forums.ni.com/t5/DQMH-Consortium-Toolkits/Incorporating-NI-DAQmx-change-detection-events-in-...

On the 2nd page, you may be interested to know that you can come across a LV crash in some situations and have a possible workaround.


Olivier Jourdan

Wovalab founder | DQMH Consortium board member | LinkedIn |

Stop writing your LabVIEW code documentation, use Antidoc!
Message 4 of 4
(1,474 Views)