Cannot concatenate expression

I have the following expression.
[MySql_Connection]
(“sensor”+SensorValue)
/reading

SensorValue is a parameter I am trying to combine with “sensor” so that as the SensorValue Changes, “sensor” becomes "sensor1, sensor2, etc…).
What the hell am I doing wrong. I have tried every type of syntax I can think of.

I’m making some assumptions here, but maybe something like

"[MySql_Connection]sensor" + toStr(SensorValue) + "/reading"
1 Like

Did not work. This Tag Path is going into an easy chart for one of the pens. I thought the below would work but it does not.
“[MySql_Connection]sensor” + {Root Container.SensorValue} + “/reading”

If i use “[MySql_Connection]sensor1/reading” then sensor1 comes in fine. The SSensorValue I am referencing shows up in the root container properties and is being used on the same screen for other tags, so I believe that is correct. I am pretty sure I have a syntax issue, but i have spent days trying to fix it.

Sorry, but you lost me with your directions.
This is what I have.

on the easy chart customizer, I have a pen in the “Tag History Pens” whose Name is “Reading”.

The exact Tag path text is [MySql_Connection]{“sensor” + SensorValue}/reading

SensorValue is a custom Property that changes depending on which popup I select to get to the easy chart screen.
When I use the below tag it does work.
[MySql_Connection]sensor1/reading

I need to replace the “1” with the SensorValue value, which is an integer.

And how exatcly is your custom property text being sent to your Tag Path property on the Easy Chart? You’re using a cell update binding or are you doing something like this?

Exactly as you are showing it.

I might be wrong, but i don’t think you can use expressions there, can you try the following:

  1. Create another custom property, let’s call it “myTagPath” and set it as a string type.

  2. Make an expression binding at myTagPath with the expression @Paul.Scott provided but make sure to substitute “(SensorValue)” with the correct path to this value, you’ll know you’re on the right path if the value on the string result after you click OK matches "[MySql_Connection]sensor1/reading”

  3. At the EasyChart’s properties under Chart Configuration create a cell update binding for the Tag Pens dataset that modifies the TAG_PATH column with myTagPath’s value
    Should look something like this:

2 Likes

I created a custom property and I have it showing the correct text for the tag, but I cannot find the “Chart configuration” in the properties of the easy chart. I would think the property would go into the “edit Pen” window.

Use a Cell Update binding on the ‘Tag Pens’ Dataset


1 Like

It should appear right at the bottom, but make sure that your filter(highlighted at the top) is set to All

1 Like

Thank all of your guys very much. I finally got it. Leonardo pointed me to the Dataset, and that is what I needed. It seems like way too much work just to make a damn tag work properly.

thank you, again.

2 Likes

Well, that's on me, after reading carefully the post @JordanCClark cited, the whole process can be simplified by deleting the custom property and writing the expression directly at the "value" field on the Cell Update Binding like this:

[MySql_Connection]sensor{Root Container.SensorValue}/reading

Note that this time you wont have to use " since the field will already convert to a string and concatenate after solving your property reference, so by giving it the correct adress for your sensor value it'll look something like this:

Also Note that it works with tag references too.

I agree. It's also a reason I don't bother using the historian.

Thanks for the extra info. I will keep it in mind for future reference.
Thanks again for the help.

1 Like

I am in need of one more piece of assistance.
I got the one pen working with this:
[default]sensor1/reading

I have two pens that are supposed to read the alarm setpoints. I have this:
[default]sensor1/Reading/Alarms/High Alarm.SetpointA
[default]sensor1/Reading/Alarms/Low Alarm.SetpointA

Thyey will not work. any idea?

Those look like adresses to point directly to the alarm’s setpoint, being “Alarms” the name of your tag and High Alarm and Low Alarm the names of two different alarms configured there, is that correct?

If so, maybe it doesn’t work because they’re not historical and in that case you can add two calculated pens with the Constant function using the easy chart customizer and then the process will be the same as with your tag history pens, but this time your dataset will be called “Calculated Pens” and the column you need to modify is called “FUNCTION_PARAM” and instead of a properety or an expression, you use the same tag path you provided above.
image