Expressions in FTV parameter files

Join Date
Dec 2014
Location
Louisiana
Posts
18
Hello, I am in a unique situation where both of my company owners have basically sat me down in front of a FactoryTalk View SE station and have given me a set of P&ID drawings and said "get to work". I am new to programming much less any specific languages or software packages, and they are rarely around for me to ask questions. I have figured quite a bit out on my own but I am now in a situation that I cannot figure out by myself and nobody in the office knows either.

What I have done is created a global object with setpoints to be used for different types of transmitters, whether it be tank levels, or pressures. I have also included a bypass button and also a bypass timer for each setpoint, i.e. High-High, High, Low and Low-Low. Now directly writing an expression on my button is as follows:

If [HMI]LT_2011.HHBypassActive == 0 Then Toggle [HMI]LT_2011.HHBypassOn Else Toggle [HMI]LT_2011.HHBypassOff Endif

It works great when directly linked to the button, but I want to use this global object for dozens of transmitters. The problem I am running into is that I tried to use this expression in a parameter file, and it doesn't work. Nobody in my company is around to help, not that I think they know anyway. Is it possible to use expressions with tags in them in parameter files at all? And if so what would be the proper syntax? If not, then is there a way to accomplish my goal?

Any input would be greatly appreciated as I have never worked with FTV at all.
 
Those won't run in parameter files.

Look at EVENT files.

Create new event file with expression and output.

Alternatively, could look at using DERIVEDTAG files.

Create new Derived Tag file.

In order for these to work the following need to be added to startup Macros:

EventOn EventFileName

or

DerivedOn DerivedTagFileName


Good job getting things done on your own! Let me know if I can help with anything else.
 
Ok, I tried building a Derived Tag using the same expression:

If {[HMI]LT_2011.HHBypassActive} == 0 Then Toggle {[HMI]LT_2011.HHBypassOn} Else Toggle {[HMI]LT_2011.HHBypassOff} Endif

It tells me:Error at line 1, column 52: ELSE missing from expression.

But when I input this expression directly on the button it works just fine. I'm not sure what im missing.
 
Ok, I tried building a Derived Tag using the same expression:

If {[HMI]LT_2011.HHBypassActive} == 0 Then Toggle {[HMI]LT_2011.HHBypassOn} Else Toggle {[HMI]LT_2011.HHBypassOff} Endif

It tells me:Error at line 1, column 52: ELSE missing from expression.

But when I input this expression directly on the button it works just fine. I'm not sure what im missing.

I would do event file.

Condition is {[HMI]LT_2011.HHBypassActive} == 0
Action is Set {[HMI]LT_2011.HHBypassOn} 1; set {[HMI]LT_2011.HHBypassOff} 0

Line 2

Condition is {[HMI]LT_2011.HHBypassActive} == 1
Action is Set {[HMI]LT_2011.HHBypassOn} 0; set {[HMI]LT_2011.HHBypassOff} 1


Something like that should work. Also - don't forget to run EventOn EventFileName either from the CMD in FTVSE Studio, or in a startup macro
 
Um, I hate sounding like an idiot but this is my first time ever using FTV, so I kind of feel like one. I'm not sure how to build an event. The first thing it says is action and that brings me to the command wizard. What do I select for action?
 
No problem - we all start somewhere.

In Studio, go to HMI Server --> Logic And Control --> Events --> Right Click 0 --> New

Screen_Shot517.png


Then ENABLE the events, set the actions as follows with the expressions:

Screen_Shot518.png


Then, make sure to SAVE the event file.

Finally, open the Command Line and turn the EventOn, as I've stated with the event file name.

Like this:

Screen_Shot520.png


Hope that helps!
 
Ok, I built the event just like you showed me and saved it as test, and then I ran the command in the command line. I was assuming after that was accomplished I would be able to attach the event to my button in some way but yet again I am hitting a brick wall.
 
Event files run automatically.

It is constantly looking for the EXPRESSION to be true, and when it is, it performs the ACTION.

This is running at a rate specified for the event file. If you open the EVENT file and go to setup, it should have a rate for running.

Look in the diagnostics window viewer in Studio for it to tell you when it is evaluating events.

Event files just run at the server and are used for setting tags / events based off whatever conditions/scripting you want to configure.
 
I made a global object to handle all my High and Low alarms setpoints. Next to the setpoints I made a button that activates a bypass on the high-high, high etc. I want that button to work on the reference object that reflects the global object and basically I want the reference object button to toggle the bypass status for each different transmitter that I have. So basically if I click the transmitter say for High Pressure Separator 1, I want the same screen and so on for 2 and 3 and so on. Well, everything else is easy, the timers, the setpoints, all that can be linked with parameter files. But I don't know how to make the bypass toggle button different on each reference object.

Global Object.png
 
If you make the window a Popup and pass it parameter files - then it doesn't need to be a global object.

If it is a global object, you should be able to still have {#1}...{#2}...etc defined.

For your Toggle Buttons, why not just define
{#1} = {[HMI]LT_2011.HHBypassOn}
{#2} = {[HMI]LT_2011.HHBypassOff}

Visibility:
If {#1} = 0 then show the button to enable it:

And have the Action on the button:

Set {#1} 1; Set {#2} 0

If {#1} =1 then show a different button with the inverse action:

Set {#1} ; Set {#2} 1

Or, something like that. Also, not sure the underlying PLC code but why not just have an LT_xxxx.HHBypass and toggle it to 1 (On) and 0 (off), instead of having 2 tags?

Just some ideas for you. Lot's of wayst to get things done.
 
Well, my boss did the PLC code, and we already installed it with the OIT's on the location, and if we need to change code, we have to shut in the facility, and its just the way he wrote the code, a bypass on and a bypass off. I agree, there should only be one tag, but he could add a rung and not have to download to it. I think just adding a rung can be done with a live edit once we get back to the facility. But working within the limits that I have, that is probably exactly the way I will have to make it work. I will try it and see if I can get it to work. I'll post an update if I figure it out in case people in the future come across this unique situation.
 

Similar Topics

Does TIA Portal support "regular expressions" (regex)? The operator needs to input a unique serial number in this format (see pic). I want to be...
Replies
8
Views
1,021
Example: Take this boolean algebraic expression: note: I'm using a single quote to denote negation as I can't place a bar over the letter. (CA +...
Replies
9
Views
2,834
Hello all, I am fairly new to programming HMI's and am working with Crimson 3.1 for the first time. I am trying to recreate an annunciator of...
Replies
12
Views
6,361
I am banging my head trying to get EB Pro to convert simple math expressions. Ex: 1 Pump conversion coming from a SCP instruction O0 1.1 value...
Replies
2
Views
1,868
title says it all. at what point in time are ( ) required when writing expressions in FTVS? is it only when you want to 'look' at things it...
Replies
1
Views
1,504
Back
Top Bottom