11-10-2016 01:46 AM
Hi,
I am currently trying to get two queues to pass data over, one via strings and one via numeric. I have it seperated into to VIs where the operator has it split between two monitors. I am a fairly new labVIEW user and keep banging my head against the wall. I've seen this done with one queue and wondering the strategy to get two datatypes over to the other VI.
Attached is a screenshot of my current block diagram.
Thanks!
Solved! Go to Solution.
11-10-2016 02:00 AM - edited 11-10-2016 02:01 AM
Hi sckleymann,
I am a fairly new labVIEW user and keep banging my head against the wall.
When you are new to LabVIEW you should take the FREE online resources offered for beginners on NI's website!
(Banging the head against a wall is unhealthy! :D)
I've seen this done with one queue and wondering the strategy to get two datatypes over to the other VI.
A queue can only handle one datatype, so you have the following options:
- use two queue, one for each datatype
- use a queue to transport a cluster of [string, DBL] and use whatever item is needed
- use a queue to transport a cluster of [enum, variant]. Use the enum to provide information of the variant's content and to convert the variant to data correctly in your subVI!
There are example VIs showing how to use queues…
Attached is a screenshot of my current block diagram.
Attaching VIs instead would be so much better…
11-10-2016 02:26 AM
Hi GerdW,
When you are new to LabVIEW you should take the FREE online resources offered for beginners on NI's website!
Thanks for the response. I'll check them out. These forums have been helpful as well with searching previous posts.
Attaching VIs instead would be so much better…
I've put together a quick example of two queues for each datatype, but cannot get them to wire correctly?
The type of the source is different than the Queue RefNum? Am I missing something obvious?
Thanks
11-10-2016 02:43 AM - edited 11-10-2016 02:43 AM
Hi sckleymann,
unfortunately I'm stuck with LV2014 here so I cannot open your VIs. Mind to do a "save for previous" before attaching?
The type of the source is different than the Queue RefNum? Am I missing something obvious?
Yes: Each queue has a datatype and the wires must match them.
When you create a queue in your VI you can right-click it's wire and choose "create -> control". Move this control into your subVI and use it as input of this subVI: now it uses the same datatype as in your main VI!
11-10-2016 03:00 AM
Hi GerdW,
Apologies, I have saved them for version 14. It's actually in the main VI where I call the subVI, it has the Queue refNum error. Guessing it's a rookie mistake, I am basing my code off examples I've seen here and I really appreciate you helping me along.
Thanks
11-10-2016 03:20 AM - edited 11-10-2016 03:22 AM
Hi sckleymann,
in your case the solution is even simpler: when you want to use two queues you need to change the connector pane to have also two queue ref inputs in your subVI!
Read the LabVIEW help to learn how to work with the "connector pane"!
(This is pretty basic LabVIEW stuff and you learn this in those FREE beginner tutorials. Did you take them as suggested before?)
11-10-2016 03:54 AM
Yeah, that took me way too long to realize. Thanks for all the help and your time. I learned a few concepts along the way and will do some more reading.