03-16-2010 02:33 PM
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.
03-16-2010 02:39 PM
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
03-16-2010 02:42 PM
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
03-16-2010 02:46 PM
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.)
03-16-2010 02:56 PM - edited 03-16-2010 02:56 PM
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
03-16-2010 03:05 PM
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?
03-16-2010 03:09 PM
Hi Kristof,
i mean, you never call the "release Semaphore function", but you should do.
Mike
03-16-2010 03:13 PM
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
03-16-2010 03:15 PM - edited 03-16-2010 03:16 PM
Hi Kristof,
sorry, i mean the "release semaphore reference" vi. In LV8.5 it's "destory semaphore". 😉
Mike
03-16-2010 03:16 PM