LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Question related to stopping sub vi loop

While string works well in many cases as data for both events and queues, I prefer a cluster of a type def'd enum of commands and a variant for data. I make 2 helper VI's, Enqueue and Dequeue which handles the (un)bundling so only the Enum and Variant is exposed. That way cases and commands automatically get the right command and I can send whatever data I need to/from the command.

- Just an Init? Ignore the variant input.

- Message? Connect a string to the variant.

- Setup? Send a cluster of information.

and so on.

Although I do need some Variant to Data in the Consumer, that's a small price to pay.

Technically it's also slightly faster, as a case driven by a Enum is an integer, while the string requires string comparison (and 'to upper case'-functionality in case of 'case insensitive'). That factor is often negligible, but it feels good knowing I've chosen the (every so slightly) faster option. 😉

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 21 of 21
(185 Views)