Jump to content

Changing Label text of a numeric object placed inside a case structure thru' VI scripting.


Sharon_

Recommended Posts

Hi friends :worshippy:,

I am back again..:wacko:

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.:throwpc:

:ph34r:

I have attached the VI along with this post for your reference... please help..

Thanks for your time..!!!

Sharon

01Case.vi

Diva.vi

Edited by Sharon_
Link to comment

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

Link to comment

Hi friends worshippy.gif,

I am back again..wacko.gif

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.throwpc.gif

ph34r.gif

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

Link to comment

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 :worshippy:...

Definitely I wouldn't have selected 'control' terminal...:yes: 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..!!!! :thumbup1:

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.