kernelv_sync_read_request()

Prototype

signed long int

SyncReadRequest<T>(

ushort port,

uint indexGroup,

uint indexOffset,

ref uint length,

out T value);

Description

Synchronous reading of variables. The variables are identified by Port, indexGroup and indexOffset.

At present, the following ports are supported:

Port number

CNC task

551

GEO task

552

SDA task

553

COM task

The meaning of indexGroup and indexOffset depends on the addressed port and can be found in the documentation.

An error code is returned if the function is called while the CNC kernel has not yet started.

Parameter

Name

Type

Meaning

port

ushort

Port from which the data is to be read.

indexGroup

uint

Index group of the data item to be read.

indexOffset

uint

Index offset of the data item to be read.

length

ref uint

Maximum size of the buffer at call, actual number of bytes read after call.

value

out T

Returns the value read. Type T must be a string or a bittable structure

Return values

Symbol

Value

Meaning

 

0

The function was executed without error.

 

-3

The simulation CNC kernel was not yet initialised.

 

6

The transferred port number is not known.

 

0x701

The requested service is not supported.

 

0x702

Index group is invalid.

 

0x703

Index offset is invalid

 

0x704

The variable addressed must not be read.

 

0x705

The memory provided is too small for the value to be returned.

 

0x706

The job cannot be executed.

Possible reasons are:

  • invalid data on write accesses or
  • invalid state of kernelv, e.g. list updating while CNC channel is in error.