LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unexpected behavior in LabVIEW 7 release semaphore

Every modern languages provide counting semaphores. It can be used either for mutual exclusion or for task synchronization (a kind of occurrence, but semaphore can count the number of releases).
It was ok for LabVIEW 5, and 6 and 6.1. But now, in LabVIEW 7 Express (i have to test it on v7.1), it is an error to realease a semaphore that "has not been acquired". In other words, it is not possible now to create a 0 sized semaphore (before version 7, the only meaning for size was initial value) in order to achieve counting task synchronization...
I have done many programs with this semantics (size is only the initial value) that are now not functionning.

For me, either we should be able to give an initial value to a
semaphore, or the test on the size that is done inside "release semaphore" should be removed. It is not serious for a language like LabVIEW to provide only "Mutual exclusion" semaphores.

I don't know if the size test added in version 7 is of any interest for anyone

I posted a feedback reqest in order to ask to come back to semantics of version 6.x (remove test on a semaphore size in "release semaphore"). Moreover, I think that like me, people used to use semaphores as synchronisation mechanisme, with this semantics change, these programs won't run in LabVIEW 7.

Has anyone the same problem, or has anyone another point of view on this change ?
0 Kudos
Message 1 of 7
(3,405 Views)
Has anyone the same problem, or has anyone another point of view on this change ?"


I may have!

Would you mind posting a small example of what was working in LV 6.1 and does not work in LV 7.0.

This could expalin what amounted to retry messages i saw in a log file. These appeared to complete correctly after the semaphore was reacquired.


Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 7
(3,405 Views)
Hi,

Here is a small example: working with LabVIEW 6.x, do not work with LabVIEW 7 (.x ?)...
0 Kudos
Message 3 of 7
(3,405 Views)
I can confirm it is the same in LV 7.1.

I changed "greater than" to a "greater than or equal" in side of "Release Semaphore.VI" and the demo works in LV 7.1.

This does look like the errors i had seen in my log files.

Let me know if you try this change and your findings.

Trying to help,

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 7
(3,405 Views)
To fix it, i modified the code or Realesae Semaphore.vi: I just replaced the "greater than" bye TRUE in the condition of the structure.
0 Kudos
Message 5 of 7
(3,405 Views)
Test this thoroughly!

Changing VI's in VI.lib makes me nervous.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 7
(3,405 Views)
You should fix this by changing your applications. If you change Create to have size 1 followed by an Acquire, then branch from there, you will get the functionality you want, your program will read well, and you will be using the functionality as defined.

By changing the function in vi.lib, you change it for all applications (including LabVIEW itself). This will have adverse consequences for applications that count on the documented behavior. You will also lose your change when LabVIEW is reinstalled or updated.

You are right to be a bit frustrated with having to troubleshoot your application to figure this out. We're not doing a good job of documenting changes from one release to another. For this, I apologize. All I can s
ay to make amends is to say we are aware of our failings and are actively working to do better. We struggle with what to tell you, when to tell you, and how best to help without inundating you with so much information that you decide to ignore it all.

Again, I apologize for the inconvenience this change has caused you, but I strongly urge you to reconsider your "fix".

Roy
LabVIEW R&D
0 Kudos
Message 7 of 7
(3,405 Views)