DOCA0091EN-08

Command Examples

Open Circuit Breaker

The following table details the steps to perform in the master remote device to send a remote command to the BSCM circuit breaker status control module to open the circuit breaker. The command itself has no parameters.

Step

Action

1

Load a buffer of 20 registers, word0 to word19.

  • Load into word0 the value 904, the code corresponding to the open circuit breaker command.

  • Load into word1 the value 10, the length of the input parameters. The command itself has no parameters, 10 is the length of the fixed part.

  • Load into word2 the value 4353 (0x1101), the destination. This value is a constant for the command. It is provided in the command description.

  • Load into word3 the value 1.

  • Load into word4 and word5 the 4 ASCII bytes of the Administrator or Operator password. Assuming this password is ‘ABcd’, load 16706 (0x4142) into word #4 and 25444 (0x6364) into word #5.

  • Load into word6 to word16 the value 0.

  • Load into word17 the value 8019, a command setup constant.

  • Load into word18 the value 8020, a command setup constant.

  • Load into word19 the value 8021, a command setup constant.

2

Write this buffer with a write request (Modbus function 16) of 20 registers, starting at register 8000.

3

Read the command status register 8021, and wait while its content shows that the command is still in progress (0x0003). If the command status does not change after a timeout (1 s), check the Modbus connection.

4

Read the command status register 8020:

  • If content of register 8020 is the command code entered in register 8000 at step 2, go to next step.

  • If content of register 8020 is different from the command code entered in register 8000 at step 2, restart at step 1.

5

Read the error code in the LSB of register 8021:

  • If LSB ≠ 0, then the command failed. Check the error code to understand the cause (see next paragraph). For example, if register 8021 returns 4609 (0x1201), then the error code is 1, which means that the password is not correct (insufficient user rights).

  • If LSB = 0, then the command was executed with no errors.

Reset Energy Measurements

The following table details the steps to perform to send a command to the MicroLogic trip unit to reset the minimum/maximum energy measurements. The command itself has one parameter.

Step

Action

1

Load a buffer of 20 registers, word0 to word19.

  • Load into word0 the value 46728, the code corresponding to the reset minimum/maximum command.

  • Load into word1 the value 12, the length of the input parameters. The command itself has one parameter, add 2 bytes to 10 which is the length of the fixed part.

  • Load into word2 the value 5121 (0x1401), the destination. This value is a constant for the command. It is provided in the command description.

  • Load into word3 the value 1.

  • Load into word4 and word5 the 4 ASCII bytes of the Administrator or Operator password. Assuming this password is ‘Pw57’, load 20599 (0x5077) into word #4 and 13623 (0x3537) into word #5.

  • Load into word6 the value 512 (bit 9 set to one). This value requests that the energy measurement minimum/maximum be reset.

  • Load into word7 to word16 the value 0.

  • Load into word17 the value 8019, a command setup constant.

  • Load into word18 the value 8020, a command setup constant.

  • Load into word19 the value 8021, a command setup constant.

2

Write this buffer with a write request (Modbus function 16) of 20 registers, starting at register 8000.

3

Read the command status register 8021, and wait while its content shows that the command is still in progress (0x0003). If the command status does not change after a timeout (1 s), check the Modbus connection.

4

Read the command status register 8020:

  • If content of register 8020 is the command code entered in register 8000 at step 2, go to next step.

  • If content of register 8020 is different from the command code entered in register 8000 at step 2, restart at step 1.

5

Read the error code in the LSB of register 8021:

  • If LSB ≠ 0, then the command failed. Check the error code to understand the cause (see next paragraph). For example, if register 8021 returns 4609 (0x1201), then the error code is 1, which means that the password is not correct (insufficient user rights).

  • If LSB = 0, then the command was executed with no errors.

Read Date and Time

The following table details the steps to perform to send a command to the IFM interface to read the date and time. The command itself has no parameters. The date and time are returned in a buffer.

Step

Action

1

Load a buffer of 20 registers, word0 to word19.

  • Load into word0 the value 768, the code corresponding to the read date/time command.

  • Load into word1 the value 10, the length of the input parameters. The command itself has no parameters, the length is the length of the fixed part which is 10.

  • Load into word2 the value 768 (0x0300), the destination. This value is a constant for the command. It is provided in the command description.

    NOTE: Load into word2 the value 8704 (0x2200) for IFE interface as destination.
  • Load into word3 the value 0.

  • Load into word4 and word5 the value 0x0000 (no password required).

  • Load into word6 to word16 the value 0.

  • Load into word17 the value 8019, a command setup constant.

  • Load into word18 the value 8020, a command setup constant.

  • Load into word19 the value 8021, a command setup constant.

2

Write this buffer with a write request (Modbus function 16) of 20 registers, starting at register 8000.

3

Read the command status register 8021, and wait while its content shows that the command is still in progress (0x0003). If the command status does not change after a timeout (1 s), check the Modbus connection.

4

Read the command status register 8020:

  • If content of register 8020 is the command code entered in register 8000 at step 2, go to next step.

  • If content of register 8020 is different from the command code entered in register 8000 at step 2, restart at step 1.

5

Read the error code in the LSB of register 8021:

  • If LSB ≠ 0, then the command failed. Check the error code to understand the cause (see next paragraph). For example, if register 8021 returns 783 (0x030F), then the error code is 15 (0x0F), which means that the input argument is out of range (too many parameters).

  • If LSB = 0, then the command was executed with no errors.

6

If there were no errors, read the data buffer length in register 8022. Its value must be 8 for this command.

7

In the data buffer:

  • register 8023 holds the month in the MSB, the day in the LSB.

  • register 8024 holds the year offset in the MSB (add 2000 to get the year) and the hour in the LSB.

  • register 8025 holds the minutes in the MSB, the seconds in the LSB.

  • register 8026 holds the milliseconds.