Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

Edge HMI

RunGlobalProcedureOnTrue

  • Last UpdatedOct 29, 2026
  • 2 minute read

This function runs a global procedure when the value of a specified project tag or expression becomes TRUE.

Function

Group

Execution

String Exp.

Windows

Windows Embedded

IoT View

Thin Clients

Mobile Access

RunGlobalProcedureOnTrue

Module Activity

Synchronous

No

Supported

Supported

Not supported

Supported

Not supported

Syntax

RunGlobalProcedureOnTrue("strCondition", strProcedureOnTrue)

strCondition

A project tag or expression that can be evaluated as either FALSE (zero) or TRUE (non-zero).

Note: The condition should be enclosed in quotes, as shown in the syntax, or else the function will try to use the value of the condition instead.

strProcedureOnTrue

The name of the procedure (a VBScript function or subroutine defined in the VBScript Global Procedures) to run when the value of the specified tag/expression becomes TRUE.

Returned value

This function returns one of the following possible values:

Value

Description

0

Error

1

Success

Notes

Once this function is called, it is continuously executed by the project runtime client (that is, the Viewer) until either it or the project runtime server is stopped. That means every time the value of the condition becomes TRUE, the procedure is run. However, the procedure is run only once when the value of the condition becomes TRUE; it is not repeatedly run while the value of the condition is TRUE. For the procedure to run again, the value of the condition must become FALSE and then TRUE again.

Also, the function can be called more than once, so that the same procedure can be run by different triggers. The project runtime client manages the execution of all instances of the function.

The procedure is run on the client where this function was called. To run a procedure on the project server, use the function RunGlobalProcedureOnServer.

The value of strCondition is passed to the procedure as an argument, so the procedure should be written to receive it. For example:

Sub UsingOnTrue(strCondition)

.

.

.

End Sub

Please note that you do not actually have to use the argument in your procedure, only that you should write the procedure to receive it.

No other arguments can be passed to the procedure.

To ensure compatibility with previous versions of Edge HMI, passing the argument is disabled by default in existing projects and enabled by default in new projects. To change this for your project, open your project file (<project name>.APP) in a text editor and then edit the following property:

[Options]

EnableTagNameOnRunGlobalProcedureOnTag=<0 (disabled) / 1 (enabled)>

Examples

When the value of TagOnTrue becomes TRUE, run the procedure UsingOnTrue:

RunGlobalProcedureOnTrue("TagOnTrue", "UsingOnTrue")

In This Topic