Editing a string

Discussion of application development using iX Developer, including but not limited to getting started, using the functions tab, properties, objects and installation.
Post Reply
danmas74
Posts: 2
Joined: Mon Sep 10, 2012 12:46 pm

Editing a string

Post 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

mark.monroe
Posts: 824
Joined: Tue Mar 13, 2012 9:53 am

Re: Editing a string

Post 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;
		}
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer

danmas74
Posts: 2
Joined: Mon Sep 10, 2012 12:46 pm

Re: Editing a string

Post by danmas74 »

Thanks for the quick response.

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

Thanks

Patrick Hall
Posts: 22
Joined: Fri May 25, 2012 7:44 am
Location: Charlotte, NC. USA

Re: Editing a string

Post 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.
Best Regards,
Patrick Hall

Post Reply