logger_get_device_c
status.i4.v = logger_get_device_c(device_index.i4.v, property.i4.v,
node.u2.v, start_time.u4.v,
end_time.u4.v, min_delta_time.u4.v,
timestamps.u4p.r, values.r4p.r,
num_points.u4.r, update_func.f.v,
array_index.i4.v [,num_skip.i4.v]
[,skip_offset.i4.v]
[,sample_spec.g.v] [,sample_type.i4.]
[,sda_case.i4.v] [,sda_set.i4.v]
[,sda_final_data.i4.v]
[,options.u4.v] [,actual_node.u2.r])
This routine returns logged data for a given device and property
from a specific Lumberjack process.
device_index device index of desired device
property property index
(PRREAD -> reading property,
PRSET -> setting property,
PRBSTS -> basic status property,
PRBCTL -> basic control property)
node Lumberjack source node
(LOGGER_ANY_NODE -> routine picks a node logging this
device and property,
LOGGER_FASTEST_NODE -> routine picks node which is
logging this device and
property at the fastest rate,
LOGGER_COLLIDER_SDA_NODE -> Collider SDA node,
LOGGER_PBAR_SDA_NODE -> Pbar SDA node,
otherwise -> Lumberjack node value
(constants are in nodedefs))
start_time starting data acquisition time
(seconds since January 1, 1970 UTC)
end_time ending data acquisition time
(seconds since January 1, 1970 UTC)
min_delta_time minimum delta time between adjacent points in seconds
timestamps returned array of timestamp values (Note: This is
a pointer to a buffer allocated by this routine.
The caller should neither allocate or free this buffer.)
(seconds since January 1, 1970 UTC)
values returned array of device values (Note: This is
a pointer to a buffer allocated by this routine.
The caller should neither allocate or free this buffer.)
num_points number of points returned
update_func function to be called periodically during data
retrieval to give information about the progress
of the data acquisition (a value of NULL may be
passed if no update function is desired)
(called as follows:
status.i4.v = update_func(update_data.s.r)
("update_data" is a structure of type
LOGGER_UPDATE_DATA)
(Note: If a status of LJ_ABORT is returned by this
function, logger_get_device_c will return immediately
to the caller.))
array_index index into array device (starts at 0)
[num_skip] number of points to skip (default is 0)
[skip_offset] offset number of points to begin skipping points
(default is 0)
[sample_spec] data sample specifier whose type depends on the
value of the "sample_type" argument
(LOGGER_SAMPLE_TYPE_DATA_EVENT -> string describing
data event,
LOGGER_SAMPLE_TYPE_LIST_ID -> integer containing
list ID number)
(default is NULL)
[sample_type] type of sample specifier
(LOGGER_SAMPLE_TYPE_NONE -> don't use the sample
specifier (default),
LOGGER_SAMPLE_TYPE_DATA_EVENT -> return data sampled
on a particular
data event,
LOGGER_SAMPLE_TYPE_LIST_ID -> return data from a
particular list)
[sda_case] SDA case to return data for (A value of
LOGGER_ALL_SDA_CASES indicates that all cases
should be returned.)
(default is LOGGER_ALL_SDA_CASES)
[sda_set] SDA set to return data for (A value of
LOGGER_ALL_SDA_SETS indicates that all sets
should be returned.)
(default is LOGGER_ALL_SDA_SETS)
[sda_final_data] indicates whether or not to return only the
final data samples
(LOGGER_ANY_SDA_DATA -> return all SDA data values,
LOGGER_FINAL_SDA_DATA -> only return the final data
values (default))
[options] read options
(LOGGER_OPT_NONE -> no options selected (default),
LOGGER_OPT_SDA_DATA -> read SDA data)
[actual_node] returned node actually used for data acquisition
This function returns ACNET status values as follows:
LJ_OK success
LJ_INV_TIMES end time is less than start time
DBM_NOREC invalid device index
LJ_INVARG invalid property or array index
LJ_NO_SUCH requested Lumberjack does not have the
requested device and property
LJ_MEMFAIL dynamic memory allocation failure
LJ_ABORT caller aborted data acquisition
LJ_INVALID_SDA_CASE invalid SDA case requested
LJ_INVALID_SDA_SET invalid SDA set requested
ACNET_xxx error in communicating with Lumberjack
This function requires the following include files:
dbprops_h, nodedefs_h, clib_h, acnet_errors_h
Related functions:
logger_get_device_by_name_c, logger_get_array_device_c,
logger_get_device_list_c, logger_read_device_c,
logger_read_device_by_name_c, logger_return_data, logger_setnode,
logger_return_names, logger_check_alive, logger_restart_lists,
logger_shutdown, logger_find_device_c, logger_name_to_node,
logger_set_remaining_memory_limit_c, logger_free_memory
C/C++ usage:
unsigned short node = LOGGER_FASTEST_NODE;
unsigned short actual_node;
int status;
int device_index = 27235;
int property = PRREAD;
int array_index = 0;
int num_skip = 0;
int skip_offset = 0;
int sample_type = LOGGER_SAMPLE_TYPE_NONE;
int sda_case = LOGGER_ALL_SDA_CASES;
int sda_set = LOGGER_ALL_SDA_SETS;
int sda_final_data = LOGGER_FINAL_SDA_DATA;
unsigned int start_time;
unsigned int end_time;
unsigned int min_delta_time = 0;
unsigned int num_points;
unsigned int options = LOGGER_OPT_NONE;
unsigned int *timestamps;
float *values;
void update_func(LOGGER_UPDATE_DATA *update_data);
void *sample_spec = (void *) NULL;
start_time = date_to_clinks("01-JAN-2006 12:00",&status);
start_time = convert_seconds_c(start_time,DATE_CLINKS_TO_GMT);
end_time = date_to_clinks("01-MAR-2006 12:00",&status);
end_time = convert_seconds_c(end_time,DATE_CLINKS_TO_GMT);
status = logger_get_device_c(device_index,property,node,
start_time,end_time,min_delta_time,
×tamps,&values,&num_points,
update_func,array_index,num_skip,
skip_offset,sample_spec,sample_type,
sda_case,sda_set,sda_final_data,options,
&actual_node);