mbusBaudSet (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

LX4

Firmware version:

1.94.00


This function is used to change the baud rate of a wired M-Bus connection.

 

 

Input:

handle : SYSHANDLE

A handle to the connection

 

baud : DINT (300,600,1200,2400,4800,9600,19200,38400) (default 2400)

The new baud rate to use.

 

Returns: INT

1

- Success

0

- Not supported

-1

- Invalid handle

-4

- Invalid baud rate

-5

- Invalid interface type.

-20

- Generic error

 

Declaration:

FUNCTION mbusBaudSet : INT;
VAR_INPUT
  handle   : SYSHANDLE;
  baud     : DINT;
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);
  ...
  // Increase speed to 9600 baud
  rc := mbusBaudSet(handle := mb, baud := 9600);
  ...
END;
END_PROGRAM;