Sign in to follow this  
Followers 0
m1n1

WinCC Button BAckground color using vb or c

2 posts in this topic

What i would like to do is to change the background colour of a button when a marker bit in the plc is 1. The tag that is addressed to this bit is called "test" I would like to do it with either vb or c script. Has anybody got any simple code that would do this. Also any documentation using vb or c with WinCC would be greatly appreciated. Thanks Edited by m1n1

Share this post


Link to post
Share on other sites
Usually I add a little script to the button's "display" property, something like this: const TAG_NAME = "yourtag_name_here" dim oTag set oTag = hmiruntime.tags(TAG_NAME) oTag.read if oTag.value = 1 then item.backcolor = vbred else item.backcolor = vbgreen end if Dont forget to enter the tag name as the trigger (best to avoid cyclic triggers). You could also use the dynamic properties, depending on the "style" of the button.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0