LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

enabling a boolean button via UDP Multicast

Solved!
Go to solution

Dear RavensFan, Thank you so much, It has been really helpful and I am trying to implement the same based on your expert advice. I am facing issues with unbundling the string. Herewith, I attach my vi here. I kindly request you to assist me with unbundling. Thank you, once again.

0 Kudos
Message 11 of 17
(1,421 Views)

You forgot to wire the datatype into the top of the unbundle at the terminal called "Type".  That is how LabVIEW knows how to take the string of bytes and what type of data to turn it into.

 

So take the wire that is running into the Flatten to String in the top loop,  Right Click and Create Constant.  Drag that constant to the bottom loop and wire into the top of the Unflatten function.

 

Ideally, you make that constant a TypeDef control.   That way if you ever need to change the data type, (add another piece of data, remove one, add an enum, ...) you just change it in the typedef control and your code will update everywhere.

 

My general rule is that I make a TypeDef out of every Enum and Cluster I create.

 

 

Message 12 of 17
(1,402 Views)

Thank you, dear RavensFan. I was successfully able to wire and myself getting aware of the concepts. Thank you so much. While I try to run the vi I get this following error.

Diaspora_0-1577291545134.png

Herewith, I attach the vi. I kindly request your expert guidance.

0 Kudos
Message 13 of 17
(1,398 Views)
Solution
Accepted by topic author Diaspora

You did not create the constant from the wire in the upper loop.

 

Hover over the wire in the upper loop with Context Help turned on.  Notice the data structure.

Hover over the constant in the lower loop with Context Help.  Notice the data structure is different.  You created that constant on your own and got the order of elements swapped.

 

Either:

1.  Edit the order of the elements in the lower constant to match the upper loop.

2.  Delete that constant and create it like I said by right clicking and pick Create Constant from the cluster wire in the upper loop.

And.

Either way, create a typedef out of that cluster and use the typedef in both places.

Message 14 of 17
(1,376 Views)

Whoa! Dear RavensFan, this has been a worthwhile learning experience for me. I just followed your advice and fixed the issue. I am really much grateful for you. Thank you so much.

 


@RavensFan wrote:

Either way, create a typedef out of that cluster and use the typedef in both places.

 


I am unaware of how this (typedef out of a cluster) could be done. I kindly request you to throw light upon this. Thank you in advance.

0 Kudos
Message 15 of 17
(1,366 Views)
Solution
Accepted by topic author Diaspora

Right click on the constant and pick Make Type Def.  Save the resulting control file.  This only works in the few most recent versions of LabVIEW.

https://zone.ni.com/reference/en-XX/help/371361R-01/lvhowto/creating_type_defs/

 

For older versions, there is a slightly different method that it is a couple more steps.  Let me know if your version is older than LV2015.

Message 16 of 17
(1,343 Views)

Really so kind of you. Thank you so much dear RavensFan.

0 Kudos
Message 17 of 17
(1,313 Views)