Referencing tags in a textbox

Post Reply
KevinGi
Posts: 1
Joined: Tue Jan 07, 2020 1:37 pm

Referencing tags in a textbox

Post by KevinGi »

I'd like to have a textbox display something like:
"Performing operation 5 of 50" where 5 and 50 are tags. How would I do this?

User avatar
Russ C.
Posts: 213
Joined: Thu Nov 16, 2017 3:32 pm
Contact:

Re: Referencing tags in a textbox

Post by Russ C. »

This can be done in scripting using the value changes of the 5 and 50 tag update a string tag that is assigned to your text object.

For example:

I have current operation number tag named "curOp"
and a maximum operations number named "maxOp"
then I would create a string tag named "stringOp"

and use this function for the value changes of the curOp and maxOp tags

Code: Select all

void operations_ValueChange(System.Object sender, Core.Api.DataSource.ValueChangedEventArgs e)
		{
			stringOp.Value = "Performing operation "+curOp.Value.String+" of "+maxOp.Value.String;
		}
and tie my stringOp tag to the text element on the screen

Then when either tag value changes, the text updates accordingly
dynamic_text_from_tags.png
dynamic_text_from_tags.png (3.98 KiB) Viewed 7464 times
Best regards,

Russ
(801) 708-6690
Technical Support
Contact Us

Beijer Electronics AB
http://www.beijerelectronics.us

Post Reply