ADVANCED: mbusSelectSecondary (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

LX4

Firmware version:

1.94.00


This function is used to select a slave based on the secondary address and makes it available using primary address 253.

This can be used in combination with mbusSend to send raw M-Bus frames when the normal primary address can not be used.

 

Input:

handle : SYSHANDLE

A handle to the connection

 

sec_addr : STRING

The secondary address for the slave. See mbusScan for details about the format of the secondary address.

 

 

Returns: INT

1

- Success

0

- Not supported

-1

- Invalid handle

-5

- Invalid interface type.

-6

- Invalid address

-9

- Communication error

 

Declaration:

FUNCTION mbusSelectSecondary : INT;
VAR_INPUT
  handle   : SYSHANDLE;
  sec_addr : STRING;
END_VAR;

 

 

Example:

  ...
  // Make the device with secondary address 1234567812345678 available as primary address 253.
  rc := mbusSelectSecondary(handle:=mb, sec_addr := "1234567812345678");
  DebugFmt(message:="SelectSecondary(): \1", v1:=rc);
  ...