Taylorh140 Posted January 7, 2022 Report Share Posted January 7, 2022 I was working with some vims. and looking for a way to check rather the data was pink or brown. if brown i can simply typecast. but if pink i need to pad the strings to a fixed size. I didn't want to iterate the elements of the cluster to check for strings or arrays. Quote Link to comment
hooovahh Posted January 10, 2022 Report Share Posted January 10, 2022 Okay I may have a solution, but I don't know if it will work in your use case or not. If you wire a cluster to an Add, it will work if all elements in the cluster support the Add function individually. So you could have a VIM that has a Type Specialized structure, and perform a type cast if all elements in the cluster support the Add. Oddly enough in my test I used a Timestamp Constant, and that makes a pink wire, but supports the Add, and is a fixed size. But I'm not sure I understand what you want done into the byte array. If you are just trying to get a byte representation of a cluster, and you want to use a fixed string for those cluster elements, it probably would just be best to iterate over element in the cluster with while loop recursion. What I think you what can still be done with a VIM, using the Type Cast in one type specialized case, and then if that fails, then to iterate over all elements. 1 Quote Link to comment
Rolf Kalbermatter Posted January 12, 2022 Report Share Posted January 12, 2022 (edited) Actually the color distinction of a wire is not specifically between a fixed size cluster and variable sized cluster and if it can be typecasted or not. Aside from adding a fixed size cluster into another cluster there is also the case where you add a boolean into a cluster. Both result in a pink wire but are still fixed size and can still be typecasted. I think the brown wire only indicates that the cluster only contains numeric scalars and can coerce into a similar cluster with the same number of numeric scalars even if their numeric type is not exactly the same. Not really a very useful distinction I believe but 35 years back LabVIEW (and most other programming languages) wasn't as strictly formalized in many aspects. Edited January 12, 2022 by Rolf Kalbermatter Quote Link to comment
Neil Pate Posted January 12, 2022 Report Share Posted January 12, 2022 7 hours ago, Rolf Kalbermatter said: Actually the color distinction of a wire is not specifically between a fixed size cluster and variable sized cluster and if it can be typecasted or not. Aside from adding a fixed size cluster into another cluster there is also the case where you add a boolean into a cluster. Both result in a pink wire but are still fixed size and can still be typecasted. I think the brown wire only indicates that the cluster only contains numeric scalars and can coerce into a similar cluster with the same number of numeric scalars even if their numeric type is not exactly the same. Not really a very useful distinction I believe but 35 years back LabVIEW (and most other programming languages) wasn't as strictly formalized in many aspects. Total thread derailment... Hands up who remembers the great error cluster colour change. Was it 2005? Quote Link to comment
hooovahh Posted January 12, 2022 Report Share Posted January 12, 2022 14 minutes ago, Neil Pate said: Total thread derailment... Hands up who remembers the great error cluster colour change. Was it 2005? Around there, if I had to guess I'd say 8.0 or 8.20. 1 Quote Link to comment
The Q Posted January 12, 2022 Report Share Posted January 12, 2022 3 hours ago, hooovahh said: Around there, if I had to guess I'd say 8.0 or 8.20. Yep, LabVIEW 8.20. https://labviewwiki.org/wiki/Cluster_data_type 1 Quote Link to comment
Rolf Kalbermatter Posted January 13, 2022 Report Share Posted January 13, 2022 13 hours ago, The Q said: Yep, LabVIEW 8.20. https://labviewwiki.org/wiki/Cluster_data_type But it existed since around LabVIEW 6.1. You had to add a funkyErrorWire=True or something similar into LabVIEW.ini 1 Quote Link to comment
dadreamer Posted January 13, 2022 Report Share Posted January 13, 2022 (edited) 3 hours ago, Rolf Kalbermatter said: But it existed since around LabVIEW 6.1. You had to add a funkyErrorWire=True or something similar into LabVIEW.ini funkyErrClustWire works even in LabVIEW 6.0 (6i). https://labviewwiki.org/wiki/LabVIEW_configuration_file/Block_Diagram Doesn't work in LV 5.0. But! This token is still being read in modern LV versions. For example, this is from LV 2020. So, if you don't like that brown(ish), you can switch to pink classic. Edited January 13, 2022 by dadreamer Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.