SENDLIST

Concept Link IconSee also

Send a list of commands and set-points to a field device as would a recipe.

WebVue support - Yes.

This instruction, used in conjunction with the instruction SET, is designed to optimize the use of control services according to the data acquisition driver capabilities (OPC, Modbus...) as a recipe does.

The instruction SET allows adding an I/O variable and its command value (value to send) to a list hold in memory. Once the list of commands to perform is complete, you can execute it using the instruction SENDLIST.

The list of commands hold in memory is protected at the user session level, e.g. each user session benefits from its own list, and calls to SET or SENDLIST in one given user session do not affect the lists associated to other sessions.

See the topic Message exchange mechanisms in PcVue for more information.

Mode

Mnemonic

Syntax

0 BLOC 1
1 MULTIPLE 1

Syntax 1

IntVal = SENDLIST(Mode[, VarName[, OPCMode]]);

Return type: INTEGER.

Argument

Meaning

VarName

The name of a register variable with the control attribute set. It cannot be used elsewhere in the program. Type STR.

 

It will contain the status of the sending progress:

0 Sending in progress
1 Sending completed successfully
2 Sending failed

OPCMode

The sending mode for when the source of the variable is OPC.

0 Optimized serialization (default).
1 Full serialization.
2 No optimization.
3 Full optimization.

Execution

The commands and set-points int the list stored in memory are sent to the field devices.

See below for an explanation about the mode and OPCMode and how they affect the way commands and set-points are sent.

Return: 1 if successful, else 0.

To be set, variables must have the Command attribute enabled.

Understanding Send Mode

The send mode BLOC or MULTIPLE and the argument OPCMode (specific to OPC) of the SENDLIST instruction determines exactly how the writing requests are sent depending on the data acquisition driver being used.

For equipment variables

  • BLOC - The variables are sorted according to the communication frame that they belong to. All variables between the highest and lowest address (according to the list created by SET) are sent including any not in the list.
  • MULTIPLE - The variables are sorted according to the communication frame that they belong to and into contiguous blocks. Only the variables from the list created by SET are sent, but a larger number of writes may be required (one write for each block).

If the list being sent by SENDLIST contains only OPC variables either mode can be used.

For OPC variables

There are four options when sending variables to an OPC server, selected by the OPCMode parameter. The options are best illustrated by example.

The order in which the variables are declared in the list directly affects the sequence in which they are written to the OPC servers.

 PcVue is connected to two OPC servers. OPC Server 1 contains variables MV1 and MV2. OPC Server 2 contains MV3 and MV4. PcVue subscribes to MV1 and MV2 using the group Group1 and to MV3 and MV4 using Group2. A list is prepared that contains all 4 variables in the order MV3, MV1, MV2, MV4.

  • Mode 0 Optimized serialization
    • Write MV3 to OPC Server 2 and wait for the result.
    • If the result is OK, write MV1 and MV2 to OPC Server 1 and wait for the result.
    • If the result is OK, write MV4 and wait for the result.
    • The SENDLIST is completed. Three OPC writes are used.
  • Mode 1 Full serialization
    • Write MV3 to OPC Server 2 and wait for the result.
    • If the result is OK, write MV1 to OPC Server 1 and wait for the result.
    • If the result is OK, write MV2 to OPC Server 1 and wait for the result.
    • If the result is OK, write MV4 and wait for the result.
    • The SENDLIST is completed. Four OPC writes are used.
  • Mode 2 No optimization
    • Write MV3 to OPC Server 2.
    • Write MV1 to OPC Server 1.
    • Write MV2 to OPC Server 1.
    • Write MV4 to OPC Server 2.
    • Wait for all four results.
    • The SENDLIST is completed. Four OPC writes are used.
  • Mode 3 Full optimization
    • Write MV3 and MV4 to OPC Server 2.
    • Write MV1 and MV2 to OPC Server 1.
    • Wait for all two results.
    • The SENDLIST is completed. Two OPC writes are used.

If the list being sent by SENDLIST contains only OPC variables, either BLOC or MULTIPLE can be used.

Examples

Copy
SUB Send_BLOC()
    i1 = SET ("Register1",600,);    'note NOT "@Register1"
    'address of Register 1 : S1 
    i1 = SET ("Register2",700,);
    'address of Register 1 : S2
    i1 = SET ("Register3",500,);
    'address of Register 1 : S5
    i1 = SET ("Register4",400,);
    'address of Register 1 : S6
    i1 = SET ("Register5",300,);
    'address of Register 1 : S7
    SENDLIST ("BLOC"); 'Send 1 request, writing words S1 to S7, S3 and S4 will be written with their known current values
END SUB

SUB Send_MULTIPLE()
    i1 = SET ("Register1",600,);    'note NOT "@Register1"
    'address of Register 1 : S1 
    i1 = SET ("Register2",700,);
    'address of Register 1 : S2
    i1 = SET ("Register3",500,);
    'address of Register 1 : S5
    i1 = SET ("Register4",400,);
    'address of Register 1 : S6
    i1 = SET ("Register5",300,);
    'address of Register 1 : S7
    SENDLIST ("MULTIPLE"); 'Send 2 requests, one writing words S1 and S2, another one for S5 to S7, S3 and S4 are not affected
END SUB