Integer to text table

Im looking to do a simple integer to text conversion, I currently have a number from the plc 0-10 and wish to convert to 11 messages to display a particular event. Do I need to be as complex as having a database query?


take a look at the Switch or Case “expressions” that you can use on bindings

Switch/case expression bindings are excellent if you only need to use the ‘lookup’ once or twice, but I’m a big fan of dataset tags and the lookup function - the big advantage being that you can change what your codes mean in one place (the tag) and it will automatically reflect across all of the bindings.

Thanks for both your responses, I have been looking at the dataset tag and where its data is held? do you make a table in the mssql database or create a table in the project. This dataset will be used in different windows and my aim will also create an alarm specific to the window with the text as the description?

I’m also a huge fan of the dataset tags.
Create a tag and then click the highlighted button to edit the dataset.
[attachment=0]dataset tags.PNG[/attachment]

Dataset tags are very useful, its also very handy to know that you can edit the dataset externally, personally I use notepad++

copy the dataset and it will look like this

"#NAMES" "int","text" "#TYPES" "I","str" "#ROWS","5" "0","new" "1","test" "2","job" "3","thing" "4","hello"

The first line declares that the next line are the column names, don’t change this.
the second line declares the column names.
The third line declares that the next line are the column datatypes, don’t change this.
The fourth line declares the column datatypes,
The fifth line states the number of rows, this needs to match the data.
the rest is the data.

Easy, much quicker than the form. I have a archive datasets I use ready for pasting.

Great information thank you, the integer to text lookup is now working.
I am now working on the alarm feature to only populate the text with time stamp for specific page items.