OpenPicture Subroutine

Opens the specified Picture.

Syntax

OpenPicture[Picture], [PictureAlias], [TopPosition], [LeftPosition], [intErrorMode], [CallingPicture], [TSPicType], [TagList], [bNewInstance]

Properties

The OpenPicture 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.

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.

Calling Picture

Object. (Optional) The picture whose tag status functionality will be accessed.

TSPicType

TS_PIC_TYPE (Optional) The type of Tag Status picture to open:

0 – Single Tag TS picture

1 – Quick Trend

2 – Tag Control Panel

TagList

Variant. (Optional) An array of strings to be used in the tag status picture.

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.

Tag status functionality is available only when no Picture string has been provided and if the CallingPicture and TSPicType parameters are provided. If the CallingPicture parameter is not provided, the call to OpenPicture is treated as a regular OpenPicture request. If the CallingPicture parameter is provided, but the TSPicType parameter is not, the call to OpenPicture generates an error message.

If a string has been provided via the Picture parameter, the standard OpenPicture functionality is invoked. In this case, the CallingPicture, TSPicType, and TagList parameters are ignored.

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