Page 1 of 1

Editing a string

Posted: Mon Sep 10, 2012 1:37 pm
by danmas74
Hi,

Is it possible to edit a string. I want to have a text field that i will edit on the operator panel and transfer that string to my PLC.

The only object that i found who make the keyboard appears is the TextBob Object. But i don't know how to save the new value.

Thanks for your help

Re: Editing a string

Posted: Mon Sep 10, 2012 1:50 pm
by mark.monroe
Create an AnalogNumeric component on your screen. Then on its InputValueChanged event take the value from that component and use C# to manipulate the string. Then assign the manipulated value to a tag. Have that tag be associated with a register in your PLC.


Code: Select all

		void AnalogNumeric3_InputValueChanged(System.Object sender, Neo.ApplicationFramework.Interfaces.Events.ValueChangedEventArgs e)
		{
			string myString = this.AnalogNumeric3.Value.ToString();
			myString += "_I_added_this";
			Globals.Tags.a_string.Value = myString;
		}

Re: Editing a string

Posted: Mon Sep 10, 2012 3:31 pm
by danmas74
Thanks for the quick response.

the alphanumeric object is not good. I want the field to be a text.

Thanks

Re: Editing a string

Posted: Mon Sep 10, 2012 4:06 pm
by Patrick Hall
The AnalogNumeric Object has a Display Format property that can be set "String”, this allows me to use the full keyboard versus the numeric only version. I am using this in my current HMI tied to a screen "Alias" called a_Description which is configured as DataType String.

The object type dropped on the screen may be "AnalogNumeric" but so far it has worked quite well as a text entry box for me. I’ve been using it to implement the Description entry of my own “Preset Editor” (custom PresetsDB.sdf with Json Serialized data).

I have not tried to attach it to a Controller Tag that was configured as STRING<X>, but I think it should work; it’s worth a shot anyway.