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.
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.
03-28-2013 07:37 AM
We have the following situation:
This does not work out as the Obtain Semaphore VI throws an error that it cannot find a semaphore with name "my_semaphore".
If all VIs reside in one project (so no packed lib) everything works as it should.
Is this a bug ?
Or is the semaphore (=queue) naming somehow subject to name mangling due to the packed libraries name spacing ? If yes is there some kind of scope operator to obtain the semaphore anyway ?
Thx & br
Martin
04-04-2013 04:18 AM
Hi Martin,
I was able to reproduce the behavior you described. The Problem seems to be the data type passed to the Obtain Queue.vi (inside Obtain Semaphore.vi). I attached my test project (LV2012 SP1), if you want to take a look. I receive error 1094, when I pass the datatype to the queue, you too?
It seems to be a bug, but I'm not absolutely. It also could be expected behavior. I will investigate this further and create a CAR (Corrective Action Request) if this is definitely is a bug.
I'll keep you up to date.
Kind regards,
Heinz
04-12-2013 04:55 AM
Hi Martin,
a colleague of mine discussed this topic:
It appears that packed libraries don't create their own application instance. What they do is create copies of any dependices and build them into the library. This is problematic when a VI within a project library uses things like type definitions that are not owned by the project library. That's because when it is built into a packed library it creates its own instance of the type definition and includes it in the build as a dependency. I'm thinking that things like Type Defined Controls have a unique identifier that prevent identical looking instances from actually being identical, hence the error that says we are using different data types when trying to obtain a reference to a named queue.
One workaround is to duplicate the semaphore VIs from vi.lib and include them in the packed library, then use the semaphore VIs from the packed library everywhere you need to use semaphore functionality.
I hope this helps you.
Kind regards
Heinz