LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Application Advice - Asynchronous call to a subVI?


@Lewis G wrote:

If not sure whether it is good or bad, but to pass the Search criteria around I use the Flatten to String and Unflatten from string.  I guess this is ok providing I use TypeDefs which I have.


I recommend using variants instead of strings for passing un-typed data. Flattening to a string requires making a copy of the data and storing it in a different format.  Converting to a variant just creates a pointer to the existing data that says it's now a variant, so it's much more efficient.

Message 11 of 12
(345 Views)

While I recommended using user events for passing the data i will add that we generally have some libraries of events messages we use. These libraries actually use an AE to manage the events. In the library we have code to initialize the event reference as well as returned the reference. Within the body your application code you generate the events using the library calls. Overall it is a much better method since the code becomes much clearer. Your cod ehas a VI called something like Generate System Exit Event or Generate System Stop Event. These VIs accept the appropraiet data assocaied with the event. It is a nice scalable way of using the events and makes the code much more readable and maintainable.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 12 of 12
(338 Views)