From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Several tasks addressing the same DO port

Hi,

 

I'm building a software program based on plugins.

All these plugins interact with DIOs.

 

When the plugin is loaded in memory, it loads its configuration and create a task to control/read DIOs port on C-series modules (9476 and 9425) placed in a cDAQ chassis.

If the task pointing on a module is already built, plugins reuse the already created task instead of creating a new one. All DIOs tasks are not synchronized on any clock, they only return the port state when necessary (software timed).

Actions on DO are always the same : Read current DO port state, apply mask and pattern on the read value and apply new calculated state on the DO port.

 

According to the plugins used, it might be possible that several of them will want to access the same DO port of a module at the same time. Is there something like a round-robin mechanism which handles this kind of situation ? Or should I create a semaphore to reserve the access the DO port one plugin after the other ? If an explicit semaphore is required, can it be embedded in the DAQmx task (or specific DAQmx function) or should I use standard semaphores available in LabVIEW ?

 

Thank you for your help !

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 1 of 3
(4,349 Views)

I just use an Action Engine to control my DIO tasks.  Only one system can access the non-reentrant VI at a time, so that acts as your semaphore.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 3
(4,346 Views)

Hi Crossrulz,

 

The description of my problem was simplified at maximum. If I was doing this in pure LV, indeed, I would have used an AE to prevent my code from being executed at the sametime by several parallel processes.

In my case, the 'plugins' are ... TestStand plugins... each of them running in different executions...

WHen doing this I usually use a Client/Server design, but here I can't. And using semaphores in TestStand is really time consumming. That's why I wanted to find a trick closer to the hardawre in order to accelerate my execution speed.

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 3 of 3
(4,342 Views)