mbusRecordGetBuffer (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

LX4,NX-400

Firmware version:

1.94.00


This function returns the value of a record as a buffer.

 

 

Input:

handle : SYSHANDLE

A handle to the connection

 

index : INT

The index of the record.

 

data : PTR

Pointer to the buffer to store the value in.

 

maxsize : INT

The size of the buffer.

 

Output:

size : INT

The number of bytes stored in the buffer.

 

Returns: INT

1

- Success,

0

- Not supported.

-1

- Invalid handle

-3

- No data found.

-6

- Buffer is to small. Size will contain the needed size.

 

Declaration:

FUNCTION mbusRecordGetBuffer : INT;
VAR_INPUT
  handle   : SYSHANDLE;
  index   : INT;
  data     : PTR;
  maxsize : INT;
  size     : ACCESS INT;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
VAR
  mb : SYSHANDLE;
  rc : INT;
  i   : INT;
  len : INT;
  buf : ARRAY[1..255] OF USINT;
END_VAR;
 
BEGIN
  ...
  // Get buffer from record
  rc := mbusRecordGetBuffer(handle:=handle, index:=i, data:=ADDR(buf), maxsize:=sizeof(buf), size:=len);
  ...
END;
END_PROGRAM;