LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What are your thoughts about this "double queued command"

What are your thoughts about having this type of queued command, where I have the variant portion of the first command cluster be another command cluster with its own command and variant portions? I know that maybe the "double queued command" name is not the best, but I could not think of a better one, ha ha.

 

Thank you for your comments.

 

DoubleMessage.png 

 

Javier Ruiz - Partner at JKI
jki.net
vipm.io
0 Kudos
Message 1 of 28
(3,738 Views)

It depends how you extract the required data from the queue. It may create confusion at a later point. Lets wait and see the comments of the knights and champs.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 28
(3,735 Views)

Are you trying to send two commands?  Or are you trying to send a single command whose content is another command / state?

 

Maybe I need to draw it (code it into LV)...

 

Lemme try to explain...

 

Do you have a state machine which has separate states for "Initialize" & "Welcome"?  Or do you have in your state machine an "Initialize" state which has a case structure that contains a "Welcome" case?

 

I do not understand what you are trying to do.

0 Kudos
Message 3 of 28
(3,730 Views)

Do you have a specific reason to place the secondary cluster into the primary clusters variant, instead of having the cluster inside the other one as it is?

 

suggestion.png

Christian

 

 

p.s.: Sorry that I wrote "secondery" instead of "secondary" in the screenshot

 

0 Kudos
Message 4 of 28
(3,726 Views)

I would have suggested sending an array of commands if there are to be executed sequentially...

If the implementation is a primary command with secondary case, then what Christian suggested is a cleaner (better) approach.

0 Kudos
Message 5 of 28
(3,718 Views)

@jarcTec wrote:

What are your thoughts about having this type of queued command, where I have the variant portion of the first command cluster be another command cluster with its own command and variant portions? I know that maybe the "double queued command" name is not the best, but I could not think of a better one, ha ha.

 

Thank you for your comments.

 

DoubleMessage.png 

 


 

I can imagine a situation where that construct would be justified...

 

A VXI controller implemented as a slave loop that inturn controls multiple widgets in a frame each of which has a unique set of commands and unique paramters associated with different commands.

 

Question to YOU!

 

What is you use case for this construct?

 

Curious,

 

Ben

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 28
(3,716 Views)

Thank you all for your replies. I have a state machine with an Initialize case, inside of which I have another case structure with a Welcome case. So, I am not trying to send two commands to the same state machine.

Javier Ruiz - Partner at JKI
jki.net
vipm.io
0 Kudos
Message 7 of 28
(3,681 Views)

Just to add something, I would think that what Christian suggested would be a good solution if all the commands for my primary state machine contained a secondary command cluster. Nonetheless, I have commands that instead of using a secondary command cluster in place of the variant employ a string or a number. I don't know if that gives you a better idea of my implementation.

Javier Ruiz - Partner at JKI
jki.net
vipm.io
0 Kudos
Message 8 of 28
(3,677 Views)

Correcting my last reply, the variant portion of the Primary Command Cluster always contains an enum with a command. There are cases, like the one I showed above, where the secondary command requires some other input (a string, or number) and hence the use of a secondary command cluster. The variant part of this last cluster is the one that may be a string, a number or something else. Thus, my application is very similar to what Ben said, I am just wondering if there is a "more elegant" way of accomplishing the same. In addition, one could argue that I could keep adding command clusters on and on to the variant part of the previous cluster.

Javier Ruiz - Partner at JKI
jki.net
vipm.io
0 Kudos
Message 9 of 28
(3,664 Views)

See the figure below, where three different things are sent via the variant portion of the Display Control cluster. In the first case, the variant portion is not employed. For the second one, an EnableMenus command is sent via the variant portion of the Display Control The third case is the one in which I need an extra string input for the MainMenu command and hence the use of the UpdateMessageControl cluster.

 

 

Picture5.png

Javier Ruiz - Partner at JKI
jki.net
vipm.io
0 Kudos
Message 10 of 28
(3,654 Views)