LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

queued message handler _ use with sub vi's

It would be appreciated if an example could be posted using the QMH with sub vi's, where the sub vi's also used a QMH structure.

Regards,

GraemeJ

0 Kudos
Message 1 of 9
(3,274 Views)

GraemeJ,

 

Do you mean the subVI would access the same queue?

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 2 of 9
(3,265 Views)
Yes Matt, the same queue
0 Kudos
Message 3 of 9
(3,257 Views)

The easiest way to do this is to pass a reference to the queue to the subVI and manipulate it there.  I've done it before without any problems.  Is that good enough?  (Can't post or download vi's where I am right now).

 

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 4 of 9
(3,254 Views)

Thanks Matt. I will work on your suggestion and let you know how I got on. To extend the question, for my future use, do you have any comments if the main and sub vi's used different queues?

GraemeJ

0 Kudos
Message 5 of 9
(3,249 Views)

Using the new NI-QMH pallette,  I have not been able to pass a queue reference to a sub vi. Any help would be appreciated.

GraemeJ

0 Kudos
Message 6 of 9
(3,225 Views)

Try these.  (I put a few comments in to explain what I did.)

 

Can you explain why you'd like to process the same queue in a sub VI?  Why don't you want to do it all in the main?

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Download All
0 Kudos
Message 7 of 9
(3,206 Views)

Thanks for your examples Jim.  I will study them carefully. Circumstances required that my first Labview program had to be done on a fairly large project. Unwise I know, and I did so with the foreknowledge that it would contain beginners mistakes, particularly in regard to the (then not understood) choice of structure. Crunch time has now arrived and I now wish to transfer to a QMH structure.

The existing code consists of  sub vi's with numerous controls. I had thought that the best way I could keep track of the transfer was to get each sub vi working in isolation as a QMH version, with its own queue name, and then add it to the main. The other issue was, if this is way to go, would it be better to work from the bottom up or the top down. The top down would obviously give a more rationally designed project, but in this case of trying to recover from a mess, bottom up might be more containable.

Regards,

GraemeJ

0 Kudos
Message 8 of 9
(3,185 Views)

GraemeJ wrote:

Circumstances required that my first Labview program had to be done on a fairly large project.


Welcome to the club! Smiley Very Happy 

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 9 of 9
(3,173 Views)