DspSym
- Last UpdatedJul 18, 2023
- 3 minute read
Displays a symbol or a Genie at a specified AN. This dynamically displayed object will disappear at page navigation.
To display a Genie, the Genie should be configured to be used with this function. See "Create a New Genie" topic for more information.
Syntax
DspSym(iAN, sSymbol [, iMode] [, iType] )
iAN:
The AN where the symbol will be displayed.
sSymbol:
The name of the symbol to display in the format <[LibName.]SymName>. If you do not specify the library name, a symbol from the Global library will display (if it exists).
iMode:
Not used. The mode is always set to 1, which means do not erase the existing symbol, just draw the new symbol.
iType:
Symbol Type:
0 - Symbol. sSymbol parameter is interpreted as a symbol. If you do not specify the library name, a symbol from the Global library will display (if it exists).
1 - Dynamic Genie, sSymbol parameter is interpreted as a Genie.
2 - Priority Genie. sSymbol is interpreted as a priority which is a numeric key in the alarm priority table and the function selects "Library Name.Genie Name" from the table.
3 - Priority Genie Thumbnail. sSymbol is interpreted as a priority which is a numeric key in the alarm priority table and the function selects "Library Name.Thumbnail Name" from the table.
4 - Mode Genie. sSymbol is interpreted as a mode which is a display name in the alarm mode table. The function selects "Library Genie Name" from the table.
5 - .Mode Genie Thumbnail. sSymbol is interpreted as a mode which is a display name in the alarm mode table. The function selects "Library Genie Name" from the table.
Note: Type 0 symbols do not erase existing objects whilst type 1, 2, 3, 4, 5 symbols erase existing objects at the AN.
Return Value
0 (zero) if successful, otherwise one of the following errors will be returned. A hardware alarm is also raised against DspSym when there is an error message.
-
If an invalid type is passed, for example, DspSym(600, "lib1.genie1", 1, 99), the error 274 "Invalid Argument Passed" is returned.
-
If a genie name which does not exist is passed, or, the option "I want to use this Genie with the Cicode function DspSym" is not selected in the Graphics Builder, the error 350 "RDB file not found" is returned.
-
If an invalid animation number is passed, for example, DspSym(-99, "lib1.genie1", 1, 1), the error 274 "Invalid Argument Passed" is returned.
-
If an animation number which does not exist is passed, the error 303 "Invalid animation number" is returned.
-
If the AN where the genie will be displayed is a part (child) of the genie that was dynamically created, the error 408 "Databrowse not supported" is returned.
-
For other runtime errors, for example, it did not create an animation for one of the objects of the genie, the error 272 "Out of memory" is returned.
Related Functions
Example
! Display the centrifuge symbol (from the pumps library) at AN25.
DspSym(25,"Pumps.Centrifuge");
! Display the centrifuge symbol (from the global library) at AN26.
DspSym(26,"Centrifuge");
! Display the dspgenie1 genie from testlib library at an animation number indicated
by iAn1.
DspSym(iAn1, "testlib.dspgenie1", 1, 1)
! Display the genie specified in the record of priority 1 on alarm priority table,
specified by Library Name and Genie Name fields, at an animation number indicated
by iAn4.
iResult = DspSym(iAn4, "1", 1, 2);
! Display the genie thumbnail specified in the record of priority 1 on alarm priority
table, specified by Library Name and Thumbnail Name fields, at an animation number
indicated by iAn9.
DspSym(iAn9, "3", 1, 3);
! Display the genie specified in the record of "Shelved / Disabled" on Alarm Modes
table, specified by Library Name and Genie Name fields, at an animation number indicated
by iAn4.
iResult = DspSym(iAn4, "Shelved / Disabled", 1, 4);
! Display the genie specified in the record of "Shelved / Disabled" on Alarm Modes
table, specified by Library Name and Thumbnail Name fields, at an animation number
indicated by iAn7.
iResult = DspSym(iAn7, "Shelved / Disabled", 1, 5);