mbusSlaveConfigReset (Function)

Top  Previous  Next

Architecture:

NX32L

Firmware version:

1.94.00


This function sends an application reset request to the wired M-Bus slave.

 

 

Input:

handle : SYSHANDLE

A handle to the connection

 

pri_addr : INT default -1

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

 

sec_addr : STRING

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

 

subcode : INT default -1

Optional subcode to include in the request. It is not used if it 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 mbusSlaveConfigReset : INT;
VAR_INPUT
   handle   : SYSHANDLE;
   pri_addr : INT := -1;
   sec_addr : STRING;
   subcode  : INT := -1;
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);
   ...
   // Send reset request to device with primary address 11, with subcode 5.
   rc := mbusSlaveConfigReset(handle:=mbpri_addr:=11subcode:=5);
   ...
END;
END_PROGRAM;