Sharon_ Posted November 11, 2009 Report Share Posted November 11, 2009 (edited) Hi friends , I am back again.. I am getting the following error when I am trying to change the label of a numeric indicator placed inside a cluster. Error 1057 occurred at Open VI Object Reference in 01Case_Cluster.vi Possible reason(s): LabVIEW: Type mismatch: Object cannot be type casted to the specified type. I dont why.. I have been trying to fix this problem for an hour but couldn't. I have attached the VI along with this post for your reference... please help.. Thanks for your time..!!! Sharon 01Case.vi Diva.vi Edited November 11, 2009 by Sharon_ Quote Link to comment
dannyt Posted November 11, 2009 Report Share Posted November 11, 2009 Hi Sharon, Well that was fun, I have a solution for you, I am sure others will give you a better one. Basically your VI object Class needs to be a ControlTerminal in this case and not Numberic, note the attached file picks up Diva.vi from C: not D: Though this change works I think you need to be a little more generic in your code. The Diagrams[] returns an entry for each case in your case structure, I would make it loop round for each case, and then use a Diag - AllObjs[] on each of these Diagram, you then need to go through all the objects in that Diagram. An alternative way of going about this especially if you want to make this a more generic tools is to use the TRef Traverse for References.vi as you starting point. 01Case.vi Quote Link to comment
Grampa_of_Oliva_n_Eden Posted November 11, 2009 Report Share Posted November 11, 2009 Hi friends , I am back again.. I am getting the following error when I am trying to change the label of a numeric indicator placed inside a cluster. Error 1057 occurred at Open VI Object Reference in 01Case_Cluster.vi Possible reason(s): LabVIEW: Type mismatch: Object cannot be type casted to the specified type. I dont why.. I have been trying to fix this problem for an hour but couldn't. I have attached the VI along with this post for your reference... please help.. Thanks for your time..!!! Sharon 01Case.vi Diva.vi Unless the cluster in question is NOT part of a running VI, you can not change the lable but you can change the caption. If you are having trouble type casting your reference you may want to look at the Nugget I wrote (on the Dark-Side) that can be found here. http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=267659#M267659 It demonstrates one method of dealing with complex data structures. Just trying to help, Ben Quote Link to comment
Sharon_ Posted November 12, 2009 Author Report Share Posted November 12, 2009 Hi Sharon, Well that was fun, I have a solution for you, I am sure others will give you a better one. Basically your VI object Class needs to be a ControlTerminal in this case and not Numberic, note the attached file picks up Diva.vi from C: not D: Though this change works I think you need to be a little more generic in your code. The Diagrams[] returns an entry for each case in your case structure, I would make it loop round for each case, and then use a Diag - AllObjs[] on each of these Diagram, you then need to go through all the objects in that Diagram. An alternative way of going about this especially if you want to make this a more generic tools is to use the TRef Traverse for References.vi as you starting point. 01Case.vi Thank you Danny and Ben ... Definitely I wouldn't have selected 'control' terminal... coz' juniors like us think the object is a numeric and add 'numeric' terminal. Actually I tried to change the label without placing inside the case structure and it was ok.Inside cluster-didn't work. That's why I wanted to ask masters like you and I got the answer.. Thank you very much..!!!! 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.