07-24-2018 05:51 AM
Hi,
I want to pass a queue reference to a subvi.I created two vi s.First vi continuously generate the value and add that value to a queue.Simultaneously Second vi needs to display this value.But some problem in passing the queue reference.Please help..
07-24-2018 05:59 AM
hi there,
i'm still running on an older labview version, so i can't open your VIs,
but depending on the way you start your subvis, you can either have an input terminal for the queue-reference, or you could store the referenc(es) in a global variable,
and read that inside the subvis.
regards
07-24-2018 06:12 AM
Hi LHa,
unfortunately a lot subVIs are missing from your upload. Can you put the whole project into a ZIP file?
But some problem in passing the queue reference.
Which problems? The queue is passed to your subVI…
On your "frontpanel.vi": Why are there several tunnels for the same value? One tunnel is enough…
07-24-2018 06:34 AM
Hi,
Here i am attaching the whole project into a ZIP file.
07-24-2018 06:40 AM
Hi
When click on the OK button in Front Panel.vi,an error occur as in the attached image.When these all are in one vi,it is working.
07-24-2018 06:43 AM - edited 07-24-2018 06:49 AM
Hi LHa,
and what exactly is your problem? You didn't describe the symptoms or errors you got…
Edit: now I saw your next message…
Why do you create new messages queues in your "frontpanel" subVI? Why don't you wire the queue reference from your main VI?
And why don't you call that "frontpanel" subVI inside of your mainVI?
07-24-2018 11:22 PM
Hi
Main.vi is working properly.My requirement is Event Handling Loop and Message Handling Loop should be in separate vi s.That is why I created Frontpanel.vi and Savingto_table.vi.On a button click in Frontpanel.vi ,it generates random numbers and Savingto_table.vi needs to display it.But on button click in Frontpanel.vi, error occurs as in the attached image. When Event Handling Loop and Message Handling Loop are in same vi (i.e , in Main.vi) it is working.
07-25-2018 05:16 AM
You'll get that error when your variant data isn't compatible with the type your converting it to. So your variant isn't a float\numeric. Put a probe on that variant, and see what you are trying to convert to double.
Could be an empty variant, that you'll get when the queue returns with a time out.
07-25-2018 05:41 AM
You could just create references to the same queue in both subVIs; by obtaining queues and wiring exactly equal name strings to the queue name input of "obtain queue" in both VIs.
Just remember that you need to call release queue as many times as you called obtain queue when you shut down.
07-25-2018 06:11 AM - edited 07-25-2018 06:31 AM
@JarleEkanger wrote:
You could just create references to the same queue in both subVIs; by obtaining queues and wiring exactly equal name strings to the queue name input of "obtain queue" in both VIs.
I avoid named queues when possible (always, give or take a few corner cases). String references can be terrible to track. They make the queue globally accessible, and usually that doesn't do much good for modularization (e.g. it encourages tight coupling). It works, but when applications grow (and grow), sooner or later you'll regret it.