OpenPicture Subroutine Example
The following example opens the Picture TestPicture, giving it an alias of Test and positioning its top left corner at (75,75).
OpenPicture "TestPicture" ,"Test", 75, 75
The following example opens another instance of a picture if it is already open in the iFIX WorkSpace:
OpenPicture "TestPicture", , , , , , , , True
The following example opens another instance of a picture if it is already open in the iFIX WorkSpace, but with a different tag group file (named taglist3):
OpenPicture "TestPicture", , , , , , , taglist3, True
The next example shows the OpenPicture subroutine using the optional intErrormode parameter, with a value of 0:
OpenPicture "BadPic", , , , 0
When you use 0 for the intErrorMode, if you try to open a picture that does not exist, a message box appears whose title is the name of the picture that made the erroneous call and whose contents are the error number and error description. This is the default. If no entry is made for the intErrorMode parameter, the default is used.
If you enter a 1 for intErrorMode the error is raised for you to handle:
OpenPicture "BadPic", , , , 1
Your error handling code would have to look something like this:
On Error Goto Errorhandler
OpenPicture "BadPic", , , , 1
End Sub
Errorhandler:
Msgbox "my error message" + Chr(13) + Cstr(Err.Number) + Chr(13) + Err.Description, , Err.Source
If you enter a 2 for intErrorMode, the error is sent to all typers, including the Alarm History window using the SendOperatorMessage method:
OpenPicture "BadPic", , , , 2
When you use 2 for the intErrorMode, you provide for silent error tracking.
The following example allows the calling PictureTest to open a Quick Trend Picture and display the tag list Strings1.
OpenPicture , , , , , Test, QuickTrend, Strings1
The following example allows the calling picture Test to open a Tag Status Picture and display the tag list Strings2.
OpenPicture , , , , , Test, TagStatus, Strings2
The following example allows the calling picture Test to open a Tag Control Panel Picture and display the tag list Strings3.
OpenPicture , , , , , Test, TagControlPanel, Strings3