OpenTGDPicture Subroutine

Opens the specified Picture with the specified tag group file.

Syntax

OpenTGDPicture[Picture], [PictureAlias], [TopPosition], [LeftPosition], [TagGroupName], [intErrorMode], [bNewInstance]

Properties

The OpenTGDPicture subroutine syntax has these parts:

Part

Description

Picture

String. (Optional) The file name of the Picture you want to open. If no file name is specified, the Open dialog is launched allowing the user to select a picture to open.

PictureAlias

String. (Optional) The alias that you want to assign to the Picture.

TopPosition

Variant. (Optional) The position at which you want to place the top of the Picture. Default = 0.

LeftPosition

Variant. (Optional) The position at which you want to place the left side of the Picture. Default = 0.

TagGroupName

String (Optional) The tag group file name. Do not specify a path for this parameter.

intErrorMode

Integer. (Optional) The error mode.
0 (default) – Allows the subroutines to provide the error messages. Errors are displayed in the form of a message box. If no entry is made for the intErrorMode parameter, the default is used.

1 – Allows the user to handle the error messages. Errors in the subroutines are passed back to the calling routine for handling.

2 – Writes errors to all destinations. No error messages display. Instead, the errors are written to all iFIX destinations, including the Alarm History window destinations using SendOperatorMessage.

bNewInstance

Boolean. (Optional) Describes whether the picture is a new instance. This field is useful when opening multiple pictures.

True – Opens a new instance of the same picture.

False – Does not open a new instance of the picture. This is the default setting.

Remarks

The alias is a user-defined generic picture name. By using aliases, you can control the opening and closing of multiple pictures without concern for the currently displayed picture.

In run mode, you can modify the VBA scripting in a new instance of a picture. However, modifications to scripts in an instance of a picture will not be saved. Saving changes to scripts in run mode is not allowed. To make changes to a script in the main picture, switch to configure mode and edit the script in the main picture (not the instance).

 

Example