LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Semaphore problem upon reinitializing VI

Dear all, 

 

I am not a Labview expert and I'm encountering a problem here. I've searched the web and these forums, nothing came up though. 

So here is the thing: I used labview's suggestion to reinitialize all values in my program to their default values (see http://digital.ni.com/public.nsf/allkb/08E7DDAE66A7D02C86256DDA00630E75). It worked like a charm. Now I added a semaphore to control the data flow, but now the reinitialization fails. When I press the reinitialization button, I get the following error, referring to the acquire semaphore vi.

 

Possible reason(s):

LabVIEW:  An input parameter is invalid. For example if the input is a path, the path might contain a character not allowed by the OS such as ? or @.
=========================
NI-488:  Command requires GPIB Controller to be Controller in Charge.

 

I must admit I don't exactly know what the reinitialization does (I just copied the method), but my guess is the semaphore gets reset which makes t impossible to acquire it somehow. Is there a way to not reset them, or to make 'em readable again?

 

TY, 

Kristof

 

I added a simplified VI that shows the problem.

0 Kudos
Message 1 of 16
(4,454 Views)

Hi Kristof,

why do you need the semaphore. You can use a wire to select the data flow. You don't need a local variable for the semaphore. It's a reference you can connect it directly to both functions.

 

Mike

Message 2 of 16
(4,450 Views)

Locals- I was able to fix this by removing the locals, the semaphore control(just supporting the locals) and wiring the semaphore.

 

You aren't the first person to get in trouble with locals


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 16
(4,445 Views)

Hi Mike,

 

Thank you very much for your reply,

 

Indeed for this example, I can just connect them. But this is a simplified version, showing the problem. In my real program, I have to control the data read from a DAQ and a serial port and for that I need the semaphore.. atleast that's what I think is best.(I added the real program as attachment, but I doubt whether it makes sense to you.)

 

 

0 Kudos
Message 4 of 16
(4,442 Views)

Hi Kristof,

also in your "real" program is no need of the local vairables, because all your loops run independently. You can connect the reference to all the functions directly. Why don't you close the semaphore reference?

 

Mike

Message Edited by MikeS81 on 03-16-2010 08:56 PM
Message 5 of 16
(4,431 Views)

Dear Mike, thank you,

 

I will try that. I was using the locals to keep my program less messy. Anyway, what do you mean with closing the semaphore reference?

0 Kudos
Message 6 of 16
(4,427 Views)

Hi Kristof,

i mean, you never call the "release Semaphore function", but you should do.

 

Mike

0 Kudos
Message 7 of 16
(4,423 Views)

Dear Mike,

 

you lost me here, do you mean the release semaphore.vi ? Because that one I use after every acquire semaphore.vi 

But you probably mean something else... as I said, I am just getting familiar with the semaphores!

 

thanks for the help so far, much appreciated

 

Kristof

0 Kudos
Message 8 of 16
(4,420 Views)

Hi Kristof,

sorry, i mean the "release semaphore reference" vi. In LV8.5 it's "destory semaphore". 😉

 

Mike

Message Edited by MikeS81 on 03-16-2010 09:16 PM
0 Kudos
Message 9 of 16
(4,417 Views)
No.  you should also call the Release semaphore referance to de allocate the memory.

"Should be" isn't "Is" -Jay
0 Kudos
Message 10 of 16
(4,414 Views)