mbusRecordGetBuffer (Function)

Top  Previous  Next

Architecture:

NX32L

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..255OF USINT;
END_VAR;
 
BEGIN
   ...
   // Get buffer from record
   rc := mbusRecordGetBuffer(handle:=handleindex:=idata:=ADDR(buf), maxsize:=sizeof(buf), size:=len);
   ...
END;
END_PROGRAM;