status.i4.v = logger_return_data(request_reply.s.r)
This routine returns logged data from a specific lumberjack.
request_reply request and reply data
(structure of type LOGGER_DATA)
typedef struct LOGGER_DATA
unsigned int start_time;
unsigned int stop_time;
unsigned int first_time;
unsigned int data;
Since a time retrieval window may result in the return of thousands of
points, repetitive calls to logger_return_data are made to return all
the data. The user initializes the "request_reply" structure once to
begin the retrieval and thereafter provides the structure as a seed to
continue the retrieval. The request typecode should have a value of
LOGGER_REQUEST_DATA, the number of devices may be 1-5, the total
structure size should not exceed ACNET_PACKET_SIZE bytes, and the start
and stop times are specified in the form of the C language time()
routine (seconds since January 1, 1970). The caller will be returned
the number of found points and alternating timestamp and data
beginning at "data". If the returned count is less than requested, the
structure may be reused without modification to collect another
portion of data within the specified time window. The user should note
that the timestamps have a resolution of one second though the
datalogger is capable of logging data as fast as 15 times per second.
This implies that duplicate timestamps may be returned. If the user
has specified more than one device for retrieval, the logger assumes
that only time correlated values are of interest. The logger discards
any data point whose timestamp/data does not exist for all devices.
If a single device is requested, the returned data consists of
repeating integer timestamps and floating point readings beginning at
the address of "->data". Likewise, if multiple devices are
requested, the returned data consists of repeating unsigned integer
timestamps and an array of floating point values. The best example
of how to use this routine is found in the source code for the
Lumberjack plotter application (D44). The field "min_delta_time"
is the number of seconds of minimum time separation between points.
This should normally be zero. The archiver uses this field to
compress data returns.
This function returns ACNET status values as follows:
LJ_INVLEN invalid number of points requested
LJ_INVTC invalid type code
LJ_MEMFAIL dynamic memory allocation failure
ACNET_xxx error in communicating with Lumberjack
This function requires the following include files:
cnsparam_h, cns_data_structs_h, clib_h, acnet_errors_h
logger_get_device_list_c, logger_setnode, logger_return_names,
logger_check_alive, logger_restart_lists, logger_shutdown,
status = logger_return_data(&request_reply);