It is currently Fri Sep 19, 2014 11:50 am




Post new topic Reply to topic  [ 5 posts ] 
 Updating a String 
Author Message
Corporal
Corporal

Joined: Wed Jan 05, 2011 9:02 am
Posts: 40
Post Updating a String
I have a Label that is bound to a String in the PLC. When the user updates the PLC String, the Label does not update. Is there a way to get it to do this? I've added a dynamic property which is bound to the String.LEN and it updates automatically so I've tossed around the idea of watching the LEN and if the value changes, have the text field "reset". I put the term "reset" in quotes because I'm not sure why the text is not automatically updating, nor do I know how to make it update. Help?


Fri Jan 14, 2011 8:26 am
Profile
Moderator
Moderator

Joined: Sun Apr 02, 2006 2:46 pm
Posts: 1982
Location: Sacramento, CA
Post Re: Updating a String
Are you using a Label component or a Text Field component? The label should update as soon as the tag changes if the text is bound to the tag.

_________________
Travis Cox
Inductive Automation
Technical Support Rep.


Fri Jan 14, 2011 9:10 am
Profile WWW
Corporal
Corporal

Joined: Wed Jan 05, 2011 9:02 am
Posts: 40
Post Re: Updating a String
I am using a Label. My Property Change Event check is working - only 2 issues:

1. When the operator types a new message that happens to be exactly the same length (i.e. no change in String.LEN) then it won't update.
2. The old text is still in cache - when I type long text it displays. Then type a short text, I can see the new short text, but after the short text stops, the old long text is still showing.

Any ideas on how to "refresh" the string? Thanks!


Fri Jan 14, 2011 9:19 am
Profile
Moderator
Moderator

Joined: Sun Apr 02, 2006 2:46 pm
Posts: 4056
Location: Sacramento, CA
Post Re: Updating a String
I'm not getting a clear picture of what is going on here. Can you describe more precisely:

1. What are all of the pieces involved? PLC, OPC server, versions, database, etc?
2. Data Flow. A Label is bound to a string tag. I get that. Beyond that, I'm unclear. How is the operator making updates? Why is there a property change script?

_________________
Carl Gould
Co-Director, Software Engineering
Inductive Automation


Mon Jan 24, 2011 8:00 am
Profile WWW
Corporal
Corporal

Joined: Wed Jan 05, 2011 9:02 am
Posts: 40
Post Re: Updating a String
Thanks for the follow up Carl - I called into Tech Support and we figured it out via trial & error. It turned out to be a HTML glitch. I needed the string to "wrap" and "center" so I was sending the "<HTML><CENTER>" in the string from the PLC. When you do this, the label gets really confused:

    1. Type this STRING "<HTML><CENTER>This is the Message of the Day" in the PLC tag.
    2. The Label shows "This is the Message of the Day"
    3. Change the PLC String to "<HTML><CENTER>No Message Today"
    4. The Label shows "No Message Todayage of the Day"

The Label won't update the entire string (not sure why). So I removed that code from the string and we bound it as an expression:
Code:
"<HTML><CENTER>" + {HMI/IND/MsgOfDay/STRING}

Then the label started updating the entire STRING as intended. Thank you!


Mon Jan 24, 2011 12:14 pm
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: