DTMreadDataset(3DTM)

NAME
DTMreadDataset, DTMwriteDataset - Read/Write data from/via the specified port.

SYNOPSIS
#include <dtm.h>

int DTMreadDataset(int portid, char *buffer, int num_elements, DTMTYPE type)

int DTMwriteDataset(int portid, void *buffer, int num_elements, DTMTYPE type)

DESCRIPTION
DTMreadDataset reads the data of a message from the input port portid. This call is optional, but if it is used it must be preceeded by a call to DTMbeginRead. DTMreadDataset will attempt to fill the buffer with num_elements elements of the specified type, with automatic type conversion performed when necessary. Buffer is assumed to be large enough to hold the amount of data requested.

In the absence of errors, DTMreadDataset returns the number of elements actually read. DTMreadDataset may be called as often as required to receive a message in its entirety. When no further data can be read at the end of the message, the value returned by DTMreadDataset will equal 0.

DTMwriteDataset writes the data of a message to the output port portid. This call is optional, but if it is used it must be preceeded by a call to DTMbeginWrite. DTMwriteDataset will write num_elements elements of the specified type from the buffer, and automatic type conversion to the specified type will be performed where necessary. DTMwriteDataset may be called any number of times between the DTMbeginWrite/DTMendWrite pair - there is no limit to the amount of data that can be sent at any one time.

SEE ALSO
DTM

DIAGNOSTICS
Possible values of DTMerrno upon return of an error:

	DTMCALL	DTMbeginRead (DTMbeginWrite) must preceed this call.
	DTMREAD	Error reading message.