FactoryTalk View SE - strings in expressions

Daveyh

Member
Join Date
Jun 2015
Location
San Francisco
Posts
15
I'm trying to get a multistate indicator to change color based on the value of a string variable that's read from an OPC server. The string value is either "Normal" or "Alarm".
I'd think that something like this below would work, created with the expression builder, but I keep getting errors, usually "Expression contains a tag that has an error value". The tag is good as I can read that into a String Display.

I've tried numerous combinations of quotes and spaces but have yet to find the magic combination. It's all on one line, any word wrap is from the forum's textbox. I also tried breaking into 3 lines.

Thanks!

If {Network.RATCOM.3.3408.Channel Status.Channel 1 AlarmState.Value} == Alarm Then 1 Else 0
 
Try putting Alarm in quotes "Alarm" that tells FT it's a string. I have done it in ME version I would think it works the same in SE
 
Last edited:
I tried quotes (and just tried again) and get the error "Failed to resolve item’s ID ‘Alarm’ because it does not exist on any server"

If I put the same tag {Network... AlarmState.Value} by itself in a string display object it returns "Normal" so I know the tag is working.
 
Fixed it!! I added parentheses around the comparison and it works :)

If ({Network.RATCOM.3.3408.Channel Status.Channel 1 AlarmState.Value} == "Alarm") Then 1 Else 0
 

Similar Topics

Hello all, I'm having trouble opening an application. After clicking open I'm prompted to login and after putting in username & password it...
Replies
0
Views
48
Has anyone found information on using the variable message file? I keep looking for documentation on how to implement the message file name as a...
Replies
0
Views
59
I have two identical machines running similar HMI projects, the only difference is one is done in FactoryTalk View Version 10 and the other is...
Replies
5
Views
225
Hello, I'm using FactoryTalk View ME V10. I created a valve as a global object with multiple parameters and when the object is being used at the...
Replies
2
Views
152
Hello all, I was modifying an HMI in factory talk and went to change a go to display button using the ... to select from a list as I had done...
Replies
4
Views
204
Back
Top Bottom