03-03-2009 12:44 PM
OK, so now I've created a queue for the processor VI. This queue was created in the main VI. I created a control from this queue and placed it in the secondary VI and am controlling my states from there.
When I run the program, it now tells me the refnum is invalid. I verified in the main VI that the refnum is valid, but it's not getting to the secondary.
This is where I was getting stuck before. How do I get the reference to the queue between the VIs without wires?
03-03-2009 12:58 PM
With wires, you'd need to pass the queue wire from the main VI to the connector panel of the subVI.
Without wires, you will need to obtain a queue reference in the subVI using the same name you did in the main VI. So that piece of code you have in the main VI, you would just duplicate in the subVI and wire it into the structure instead of using that queue reference control.
03-03-2009 01:01 PM
Ravens Fan wrote:With wires, you'd need to pass the queue wire from the main VI to the connector panel of the subVI.
Without wires, you will need to obtain a queue reference in the subVI using the same name you did in the main VI. So that piece of code you have in the main VI, you would just duplicate in the subVI and wire it into the structure instead of using that queue reference control.
But then the queues wouldn't be referring to the same process, correct? I need to pass data and control states between the VIs without wires.
Thanks,
Jim
03-03-2009 01:11 PM
phalanx02895 wrote:
But then the queues wouldn't be referring to the same process, correct? I need to pass data and control states between the VIs without wires.
Thanks,
Jim
They will be because you will be using the same name to obtain both queue references.
When you use a named queue, LabVIEW will search to see if that name exists. If it doesn't, it will create a new queue and give a reference to it. If that name has already been used, it will give a new reference to the same queue that has already been created.
As Ben said, try it out!
03-03-2009 01:35 PM
I did just that (try it out), and indeed that does work.
Thank you.
Now I'm having an issue with the variant-to-data. It's telling me the data type of the variant is not compatible with the data type of the input. I'm trying to send send a merged waveform (3 phases). I used a single-waveform constant wired to a merge signals with 3 terminals.
07-21-2009 03:11 AM
Hi all,
I was taking the practice test morning!
I had this interesting question!
what's the best way to pass data in the same Vi?!
through wire, global or local variable!
My answer to this question is all three of them are the same?! Am I right on this?!
just before I post this question, I have found this page
http://zone.ni.com/reference/en-XX/help/371361B-01/lvconcepts/vi_execution_speed/
in this article, it states that the order of efficiency for passing data within application is wire -> shift register -> global variables!
so, does this mean that Wire is the best way to pass data in the same VI?
I know the better way for passing data through 2 different VI would be global variables!(am I right?)
I think I am little confused now!
Jay
07-21-2009 03:37 AM - edited 07-21-2009 03:43 AM
Hi Jay,
well, the referenced article says it all.
"I know the better way for passing data through 2 different VI would be global variables!"
My 2 cents:
- Where do you know this from?
- Please define "better"! (Faster?, more memory efficient?, less "coding real estate"?,...?)
just found a duplicate post...
07-21-2009 03:58 AM
sorry about the duplicate post! it was an accident!
and, was I wrong with the global variable is the better way to transfer data between different VIs?
can you wire 2 different VI? by 2 different VI, I mean 2 different files!
so, between wire, globabl, local!
isn't the global variable the best of the three?!
07-21-2009 04:29 AM
07-21-2009 04:35 AM
hi GerdW,
come to think of it, maybe my "better" was saying that it is easier!
but, I still don't know how to wire two vi with different files
Jay