PLBOBJECT


 PLBCMP GUI Only, 10.6

square.png Methods

square.png Instructions

 

The PLBOBJECT instruction declares a PL/B code object variable. The PLBOBJECT variable provides the interface to a PL/B CLASSMODULE load module using the CREATE, GETPROP, SETPROP, methods and DESTROY instructions. The PLBOBJECT object is supported in EVENTREGISTER and EVENTSEND instructions

 

(1)

[label]

PLBOBJECT

[%][CLASS={targetclassmod}][(arraysize)]

(2)

[label]

PLBOBJECT

 

(3)

[label]

PLBOBJECT

CLASS="targetclassmod"

(4)

[label]

PLBOBJECT

CLASS="targetclassmod"(arraysize)

(5)

[label]

PLBOBJECT

^

 

Where:

label

Optional. A Data Label.

%

Optional. Denotes the item as being GLOBAL.

arraysize

Required. An integer decimal constant, CONST variable, or EQUATEd value indicating the number of array items.

^

Optional. Denotes the item as being a POINTER.

targetclassmod

Optional. A string literal that identifies the CLASSMODULE load module program name to be accessed for the PLBOBJECT.

 

Flags Affected: NONE

Note the following:

  1. The {targetclassmod} string has a size limit of thirty-nine (39) characters and it can only be specified as the load module program named with the extension. The default extension is "plc".

  2. When a PLBOBJECT is declared with the CLASS keyword as shown in format (3), the {targetclassmod} specifies the CLASSMODULE load module '.plc' file name that is linked to this object.

  3. Example:

    TargetClass PLBOBJECT CLASS="classmodname.plc"

                 CREATE TargetClass

     

  4. If the CLASS keyword is not specified with the PLBOBJECT declaration as shown in format (2), the CLASS keyword must be specified on the CREATE statement for the PLBOBJECT.

  5. Example:

    TargetClass PLBOBJECT

                 CREATE TargetClass, CLASS="classmodname.plc"

     

  6. When the format (4) is used, the 'targetclassmod' string literal is used to access the target CLASSMODULE load module file name of 'targetclassmod.plc' for each PLBOBJECT array element created.

  7. Examples:

    Test1 PLBOBJECT // CLASS keyword for CREATE required

    Test2 PLBOBJECT CLASS="" // Compiler error is expected

    Test3 PLBOBJECT CLASS="MyClass" // "MyClass.plc"CLASSMODULE is used

    TestArr PLBOBJECT CLASS="XClass"(3) // "XClass.plc" CLASSMODULE is used for each PLBOBJECT array element

    gTest PLBOBJECT %CLASS="GlobClass" // "GlobClass.plc' CLASSMODULEis used for the Global PLBOBJECT

 

 

See Also: Object Definitions, Object Output Instructions



PL/B Language Reference PICT POPUPMENU