mbusSlaveConfigAddress (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

LX4

Firmware version:

1.94.00


This function is used to change the primary address of a wired M-Bus slave.

 

 

Input:

handle : SYSHANDLE

A handle to the connection

 

new_addr : INT (1..250)

The new address  to use.

 

pri_addr : INT default -1

The primary address for the slave to configure. Use -1 to use the secondary address instead.

 

sec_addr : STRING

The secondary address for the slave to configure. Used if the primary address is  -1.

 

 

Returns: INT

1

- Success

0

- Not supported

-1

- Invalid handle

-5

- Invalid interface type.

-6

- Invalid address

-9

- Communication error

-10

- Communication timeout

-11

- Invalid reply

 

Declaration:

FUNCTION mbusSlaveConfigAddress : INT;
VAR_INPUT
  handle   : SYSHANDLE;
  pri_addr : INT := -1;
  sec_addr : STRING;
  new_addr : INT;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
VAR
  mb : SYSHANDLE;
  rc : INT;
END_VAR;
 
BEGIN
  ...
  // Open wired M-Bus interface @2400 baud
  rc := mbusOpen(handle := mb);
  ...
  // Change primary address for the device with secondary address 637145452d2c1b16
  rc := mbusSlaveConfigAddress(handle:=mb, new_addr:=11, sec_addr:="637145452d2c1b16");
  ...
END;
END_PROGRAM;