Thang Nguyen Posted May 6, 2010 Report Share Posted May 6, 2010 (edited) Hi, I have an array of clusters. There are multiple of types of control inside these clusters (number, string, enum, boolean). If I use event structure, I can manage to find out which cluster changes and which control changes but I cannot get the actual value of that cluster. I don't know how to get the reference of the cluster. Could you please give me a hint? This is the part of my code: Best regards, Thang Nguyen Edited May 6, 2010 by Thang Nguyen Quote Link to comment
Francois Normandin Posted May 6, 2010 Report Share Posted May 6, 2010 but I cannot get the actual value of that cluster. Hi Thang, I'm not sure I understand... but can't you just take the "Index Array" primitive to extract the cluster from NewVal? Quote Link to comment
Thang Nguyen Posted May 6, 2010 Author Report Share Posted May 6, 2010 I am sorry making you confuse. I mean I want to get the value of the control which has been updated. I can index the cluster but I cannot index the control inside that cluster. Quote Link to comment
Francois Normandin Posted May 6, 2010 Report Share Posted May 6, 2010 I am sorry making you confuse. I mean I want to get the value of the control which has been updated. I can index the cluster but I cannot index the control inside that cluster. In that case, you can use the OpenG Variant palette to get the data you want, "Cluster to Array of VData" in particular. If your cluster's data is all from the same datatype, you can typecast it. If not, then Variant is all you can have. Quote Link to comment
Minh Pham Posted May 7, 2010 Report Share Posted May 7, 2010 my simple example, might explain ur requirements to some extent getchangesfromcluster.vi Quote Link to comment
Francois Normandin Posted May 7, 2010 Report Share Posted May 7, 2010 my simple example, might explain ur requirements to some extent Here is what I meant. getchangesfromcluster_2.vi (LV 8.6) Hopefully, the linkage to user.lib OpenG is correct. Quote Link to comment
Thang Nguyen Posted May 7, 2010 Author Report Share Posted May 7, 2010 (edited) Thank you for all of your helps. @Minh: I like Dr Slump too By the way anyone can tell me why there is a convert of boolean type when I use build array function? I have seen this but I don't really understand what it is. Edited May 7, 2010 by Thang Nguyen Quote Link to comment
Grampa_of_Oliva_n_Eden Posted May 7, 2010 Report Share Posted May 7, 2010 Thank you for all of your helps. @Minh: I like Dr Slump too By the way anyone can tell me why there is a convert of boolean type when I use build array function? I have seen this but I don't really understand what it is. Guessing... The original cluster was a type-def ? Float over the wire with the wire tool active and help screen open to get the details on the wire. Ben Quote Link to comment
Val Brown Posted July 11, 2010 Report Share Posted July 11, 2010 Any way to implement get changed value in a cluster WITHOUT using OpenG? Quote Link to comment
Yair Posted July 12, 2010 Report Share Posted July 12, 2010 That depends on whether or not or you want this to be a generic tool and whether or not the cluster elements are all of the same data type. If they are all of the same type, you can simply use Thang's original suggestion but use the Cluster to Array primitive instead of manually building the array. If not, LV 8.x should have some VIs in <vi.lib>\utility which allow working with the variant data type. It's possible one of them allows converting a cluster to an array of variants. Quote Link to comment
SteveChandler Posted July 23, 2010 Report Share Posted July 23, 2010 Hi, I have an array of clusters. There are multiple of types of control inside these clusters (number, string, enum, boolean). If I use event structure, I can manage to find out which cluster changes and which control changes but I cannot get the actual value of that cluster. I don't know how to get the reference of the cluster. Could you please give me a hint? This is the part of my code: Best regards, Thang Nguyen I think this may be what you want. It will return the index of and value of the changed cluster in an array. Find Changed Element In Array Of Clusters.vi 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.