Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LabVIEW: how to place a computed cluster value into a queue?

Tags:

labview

How do you put a computed cluster value into a queue? I modified the "Producer/Consumer Event" design pattern so that the type of the queue is a cluster rather than a string, but I cannot figure out how to get different values into the queue on each iteration of the loop:enter image description here

The cluster constant labeled "This should be dynamic" will eventually be a computed value containing the current time and the value extracted from .NET event argument.

like image 445
Kevin S. Miller Avatar asked Apr 19 '26 13:04

Kevin S. Miller


1 Answers

Instead of using a cluster constant (called 'This should be dynamic' in your picture) use the 'Bundle by Name' element with the 'SlopeEvent' cluster as input. Then you can dynamically update the values of 'Time' and 'Value'. Like So

enter image description here

If you use the 'SlopeEvent' cluster at severla locations in your code it might be a good idea turning it into a TypeDef (right click the cluster>'Make Type Def.' > Open Type Def. > Save in your project folder).

Note: The picture I attached is a VI snippet. Just drag-and-drop it onto your block diagram. That way you don't have to copy code from pictures all the time. This is especially useful for much larger code snippets...

like image 97
Douglas James Bock Avatar answered Apr 25 '26 08:04

Douglas James Bock