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

Edge HMI

RunGlobalProcedureAsyncGetStatus

  • Last UpdatedOct 29, 2026
  • 3 minute read

This function gets the status of one or more global procedures that were run asynchronously by calling the RunGlobalProcedureAsync function. Each procedure is run in its own thread, so that it does not slow down or interfere with other threads.

Function

Group

Execution

String Exp.

Windows

Windows Embedded

IoT View

Thin Clients

Mobile Access

RunGlobalProcedureAsyncGetStatus

Module Activity

Synchronous

No

Supported

Supported

Not supported

Not supported (see Notes below)

Not supported

Syntax

RunGlobalProcedureAsyncGetStatus ( { | optNumThreadID | "optTagThreadIDs","optTagStatus","optTagParameters" } )

RunGlobalProcedureAsyncGetStatus( ) RunGlobalProcedureAsyncGetStatus( optNumThreadID ) RunGlobalProcedureAsyncGetStatus( "optTagThreadIDs", "optTagStatus", "optTagParameters" )

optNumThreadID

The thread ID returned by the RunGlobalProcedureAsync function, if the procedure was successfully executed.

optTagThreadIDs

The name of an Array tag that will receive the thread IDs of all currently running and recently completed threads.

Note: If this parameter is enclosed in quotes, the string literal will be used. Otherwise, the value of the tag/expression will be used.

optTagStatus

The name of an Array tag that will receive the statuses of all currently running and recently completed threads.

Note: If this parameter is enclosed in quotes, the string literal will be used. Otherwise, the value of the tag/expression will be used.

optTagParameters

The name of an Array tag that will receive the parameters of all currently running and recently completed threads.

Note: If this parameter is enclosed in quotes, the string literal will be used. Otherwise, the value of the tag/expression will be used.

Returned value

If the function succeeds, then the possible returned values depend on how the function was called:

  • If the function was called with no parameters…

    RunGlobalProcedureAsyncGetStatus( )

…then the returned value is the total number of threads that are currently running.

  • If the function was called with only the optNumThreadID parameter…

    RunGlobalProcedureAsyncGetStatus( optNumThreadID )

…then the returned value is either 0, indicating that the thread is still running, or the value that was returned by the procedure.

  • If the function was called with the Array tags…

    RunGlobalProcedureAsyncGetStatus( "optTagThreadIDs", "optTagStatus", "optTagParameters" )

…then the tags will receive the appropriate values for all currently running and recently completed threads.

  • If the function fails, then it returns one of the following errors:

    Value

    Description

    -1

    Function is not supported by thin clients.

    -2

    Invalid thread ID.

    -3

    Invalid optTagThreadIDs.

    -4

    Invalid optTagStatus.

    -5

    Invalid optTagParameters.

    -100

    Internal error. Please contact technical support.

Notes

It is important to note this function can be called only in background tasks (such as Math, Scheduler, and VBScript Script) by the project runtime server. It cannot be directly called by any project viewer or thin client, even if it is on the same computer or device as the server, because the project viewer runs in its own thread separate from the project runtime server. To indirectly call this function, configure a Math or VBScript scripts (script groups) worksheet to execute on a tag/expression trigger, and then configure a project screen to activate the trigger when needed. For example, configure the worksheet to execute when the value of MyTag is 1, and then configure a Button object in a project screen to toggle the value of MyTag.

Also, when the call to RunGlobalProcedureAsync succeeds, it returns an ID for the thread created and starts running the procedure in that thread. The status of the thread is stored in an internal buffer and can be retrieved using the RunGlobalProcedureAsyncGetStatus function. The buffer gets cleared when:

  • The RunGlobalProcedureAsyncGetStatus function has been called and the thread status is different from 0 (thread is running); or

  • The maximum buffer size has been exceeded, the thread is no longer running, and a call to start a new thread has been made.

In This Topic