scalib Simple Channel Access Library scalib NAME scalib - Simple Channel Access (SCA) Library SYNOPSIS que_get() - queue a get do_get() - flush queued gets and wait for callbacks do_getbyname( ) - queue and flush a get and wait for callback que_put() - queue a put do_put() - flush queued puts and, optionally, wait for callbacks do_putbyname() - queue and flush a put and wait for callback set_min_time_between_do_gets() set_min_time_between_do_puts() SCAap() - allocate an acceleration control block SCAFree() - free an acceleration control block SCAget() - queue, flush and wait for a get callback SCAput() - queue and flush a put and wait for callback group_addchannel() - add channel to group group_removechannelbyname() - remove channel from group by name group_removechannel() - remove channel from group using channel pointer group_freebyname() - free group & all its channels by name group_free() - free group & all its channels using group pointer group_refreshbyname() - refresh group data cache by name. group_refresh() - refresh group data cache using group pointer group_getchannelbyname() - get channel value(s) from group cache by name group_getchannel() - get channel value from group cache using pointers group_getfirstchannelbyname() - get values(s) of 1st channel by name group_getnextchannelbyname() - get values(s) of next channel by name group_getfirstchannel() - get values(s) of 1st channel by group pointer group_getnextchannel() - get values(s) of next channel by group pointer group_printbyname() - print group and its channel structures by name group_print() - print group and its channel structures by group pointer group_printchannel() - print a channel by channel pointer groups_print() - print m groups starting with nth group_set_refresh_period() - set refresh period for a group group_get_refresh_period() - get refresh period for a group group_get_default_refresh_period() - get this constant group_get_refresh_period_lower_limit() - get this constant group_get_refresh_period_upper_limit() - get this constant group_set_do_get_timeout() - set do_get_timeout for a group group_get_do_get_timeout() - get do_get_timeout for a group cache_set() - create a cache element and activate monitor cache_get() - get value from cache using cache pointer cache_getbyname() - get value from cache by name cache_put() - put value using cache pointer cache_putbyname() - put value by cached name set_noflush_after_cache_put() - set to skip the pend_io after put clear_noflush_after_cache_put() - restore the pend_io after put sca_getap() - create a cache element and activate monitor sca_get() - get value from cache using cache pointer sca_getbyname() - get value from cache by name sca_put() - put value using cache pointer sca_putbyname() - put value by cached name ********** int sca_setup_aliases( path, timeout ) int que_get( channel_name, scatype, nelm, pdest, pstatus ) int do_get( timeout ) int do_getbyname( channel_name, scatype, nelm, pdest, pstatus ) int que_put( channel_name, scatype, nelm, psrc, pstatus ) int do_put( timeout ) int do_putbyname( channel_name, scatype, nelm, psrc, pstatus ) int set_min_time_between_do_gets( double time ) int set_min_time_between_do_puts( double time ) void *SCAap() void *SCAFree() int SCAget( channel_name, ap, af, scatype, nelm, pdest ) int SCAput( channel_name, ap, af, scatype, nelm, psrc ) int group_addchannel( group_name, channel_name, scatype, nmax, ppgroup, ppchan ) int group_removechannelbyname( group_name, channel_name, scatype ) int group_removechannel( pchan ) int group_freebyname( group_name ) int group_free( pgroup ) int group_refreshbyname( group_name ) int group_refresh( pgroup ) int group_getchannelbyname( group_name, channel_name, scatype, nelm, pdest, pstatus ) int group_getchannel(pchan, nelm, pdest, pstatus ) int group_getfirstchannelbyname( group_name, nelm, pdest, pstatus ) int group_getnextchannelbyname( group_name, nelm, pdest, pstatus ) int group_getfirstchannel( pgroup, nelm, pdest, pstatus ) int group_getnextchannel( pgroup, nelm, pdest, pstatus ) int group_printbyname( group_name ) int group_print( pgroup ) int group_printchannel( pchan ) int groups_print( first_group, num_wanted ) int group_set_refresh_period( group_name, period ) int group_get_refresh_period( group_name, period ) double group_get_default_refresh_period() - get this constant double group_get_refresh_period_lower_limit() - get this constant double group_get_refresh_period_upper_limit() - get this constant int group_set_do_get_timeout( group_name, timeout ) int group_get_do_get_timeout( group_name, timeout, time ) int cache_set( channel_name, scatype, nmax, pap ) int cache_get( ap, pdest, nelm ) int cache_getbyname( channel_name, scatype, pdest, nelm ) int cache_put( ap, psrc, nelm ) int cache_putbyname( channel_name, scatype, psrc, nelm ) int set_noflush_after_cache_put( ap ) int clear_noflush_after_cache_put( ap ) int sca_getap( channel_name, scatype, nmax, pap ) int sca_get( ap, pdest, nelm ) int sca_getbyname( channel_name, scatype, pdest, nelm ) int sca_put( ap, psrc, nelm ) int sca_putbyname( channel_name, scatype, psrc, nelm ) char *path /* Path to a file */ char *group_name /* Group name */ char *channel_name /* Field name */ void *pgroup; /* Pointer to a group */ void *pchan; /* Pointer to a channel in a group */ double period; /* Group refresh period in seconds */ void *ap; /* Pointer to acceleration control block */ void **pap; /* Pointer to acceleration control block ptr* int scatype; /* Data type, e.g. SCA_STRING */ int nmax; /* Maximum number of data elements */ int nelm; /* Number of data elements */ void *pdest; /* Pointer to array to receive data */ void *psrc; /* Pointer to array containing data */ int *pstatus; /* Pointer to int to receive status */ double timeout; /* Maximum wait for completion in seconds */ double time; /* In seconds */ DESCRIPTION scalib provides routines for accessing process variable fields in IOCs. do_get(), do_getbyname(), do_put() and do_putbyname() directly get from and put to the IOC using Channel Access (CA) callbacks(optional for put). SCAap(), ..., SCAput() exist for backward compatibility with the original version of SCA and are implemented with calls to do_getbyname() and do_putbyname(). The grouping functions provide for caching of named groups of channels whose values are updated with que_get(), do_get() calls. When a group channel value is requested, e.g. by group_getchannelbyname, the value is taken from the cache. If the value is older than the group refresh period, all channels in the group are first updated. cache_get() gets the value from a cache which is kept up-to-date by CA monitors. cache_put() does a put directly to the IOC without waiting for confirmation by a callback. sca_getap(), ..., sca_putbyname() exist for backward compatibility and just call cache_set(), ..., cache_putbyname(). sca macros Simple Channel Access Library sca macros NAME sca macros - macros for testing status returned by scalib routines. SYNOPSIS The following macros return true or false can be used to test the status when it is returned by a function call and/or the pstatus argument. sca_error( status ) test error code field sca_no_error( status ) sca_connected( status ) test connection state field sca_not_connected( status ) sca_disconnected( status ) sca_never_connected( status ) sca_no_connection_state( status ) sca_monitor_active( status ) test monitor state field sca_monitor_on_standby( status ) sca_never_monitored( status ) sca_monitor_corrupted( status ) sca_no_monitor_state( status ) sca_fresh_value( status ) test value state field sca_old_value( status ) sca_no_value( status ) sca_no_value_state( status ) sca_connected_fresh_value( status ) combined tests sca_connected_old_value( status ) sca_connected_no_value( status ) sca_standby_old_value( status ) sca_standby_no_value( status ) sca_disconnected_old_value( status ) sca_disconnected_no_value( status ) sca_never_connected_no_value( status ) DESCRIPTION The status is an int with an error code( 0 = no error ) in the upper half and the connection, monitor and values states in the lower half. The sca error codes are found in scalib_shared.h sca_setup_aliases() Simple Channel Access Library sca_setup_aliases() NAME sca_setup_aliases() - establish aliases for channels SYNOPSIS int sca_setup_aliases ( char *path; /* path to an alias definition file */ double timeout; /* max time in sec. to wait for connections */ ) DESCRIPTION This routine reads the alias definition file specified by path, builds control blocks for the real channels and aliases and waits up to timeout seconds for the connections to the real channels to be established. The alias definition file may be read more than once. The existing control blocks will be found and used. If timeout is not between 0.0 and 5.0, it is set to 1.0. Aliasing is not available for for channels to be cached(monitored). RETURNS The number of real channels which did not connect or -100000 if the alias definition file could not be opened or -line_number if a line in alias definition file has an error. Processing stops at first error. Alias definitions on subsequent lines in the file are ignored. FILES The alias definition file specified by path has the following format. #define scatype SCA_DOUBLE #define nmax 1 pvname alias [scatype][nmax] with fields separated by space[s] and/or tab[s]. #define scatype sets a new default for scatype. #define nmax sets a new default for number of elements The defaults may be overridden by specifying scatype and nmax on the alias definition line. The defaults are initially scatype = SCA_FLOAT nmax = 1 SEE ALSO que_get() Simple Channel Access Library que_get() NAME que_get() - queue a get SYNOPSIS int que_get ( char *name, /* process variable field name */ int scatype, /* SCA type of variable to receive value */ int n, /* maximum number of elements to get */ void *pdest, /* address of where to store value */ int *pstatus /* address of where to store status */ ) DESCRIPTION This routine adds the get of a process variable field to the get queue. The actual get is deferred until the next call to do_get(). Repeated calls to que_get() build the get queue. The get queue is purged and rebuilding is started by the first call to que_get() following a call to do_get(). RETURNS A status value containing error number and state of CA connection, CA monitor and value. Macros are provided for checking status. SEE ALSO do_get(), sca_macros, sca_examples do_get() Simple Channel Access Library do_get() NAME do_get() - flush queued gets and wait for callbacks SYNOPSIS int do_get ( double maxtime /* max time in sec. to wait for callbacks */ ) DESCRIPTION This routine performs all the gets requested in the get queue and waits for all data, but not longer than maxtime. The get queue remains intact for subsequent do_gets until the next que_get() call is made. The data is explicitly gotten from the IOC, NOT from a cache. RETURNS The number of errors encountered. Which gets had errors can be determined by examining the status word associated with each get when it was queued. -1 is returned if the get queue is empty. SEE ALSO que_get(), sca_macros, sca_examples que_put() Simple Channel Access Library que_put() NAME que_put() - queue a put SYNOPSIS int que_put ( char *name, /* process variable field to receive data */ int scatype, /* SCA type of data pointed to by psrc */ int n, /* number of elements to put */ void *psrc, /* pointer to array of data to be put*/ int *pstatus /* address of where to store status */ ) DESCRIPTION This routine adds the put to a process variable field to the put queue. The actual put is deferred until the next call to do_put(). Repeated calls to que_put() build the put queue. The put queue is purged and rebuilding is started by the first call to que_put() following a call to do_put(). RETURNS A status value containing error number and state of CA connection, CA monitor and value. Macros are provided for checking status. SEE ALSO do_put(), sca_macros, sca_examples do_put() Simple Channel Access Library do_put() NAME do_put() - flush queued puts and wait for callbacks SYNOPSIS int do_put ( double maxtime /* max time in sec. to wait for callbacks */ ) DESCRIPTION This routine performs all the puts requested in the put queue. If maxtime > 0.0, do_put() waits up to maxtime seconds for cannel connections and callbacks confirming data put. If maxtime <= 0.0, do_put() waits up to maxtime seconds for channel connections and returns immeditately there after. There are no callbacks. The put queue remains intact for subsequent do_puts until the next que_put() call is made. RETURNS The number of errors encountered. Which puts had errors can be determined by examining the status word associated with each put when it was queued. -1 is returned if the put queue is empty. SEE ALSO que_put(), sca_macros, sca_examples do_getbyname() Simple Channel Access Library do_getbyname() NAME do_getbyname() - do a get by name using callback SYNOPSIS int do_getbyname ( char *name, /* process variable field- source of data */ int scatype, /* SCA type of data pointed to by pdest */ int n, /* number of elements to get */ void *pdest /* pointer to array to receive data */ int *pstatus /* address of where to store status */ ) DESCRIPTION This routine gets data from the field whose name is given. Set n = 1 except for waveforms where it may be set from 1 to the full size of the waveform. The first n elements of the waveform are returned. do_getbyname() calls que_get() and do_get(). RETURNS The number of errors ( 0/1) encountered. SEE ALSO do_get(), sca_macros, sca_examples do_putbyname() Simple Channel Access Library do_putbyname() NAME do_putbyname() - do a confirmed put by name SYNOPSIS int do_putbyname ( char *name, /* process variable field to receive data */ int scatype, /* SCA type of data pointed to by psrc */ int n, /* number of elements to put */ void *psrc, /* pointer to array of data to be put*/ int *pstatus /* address of where to store status */ ) DESCRIPTION This routine puts data pointed to by psrc to the field whose name is given by name. The type of data to be put is given by scatype. Set n = 1 except for waveforms where it may be set from 1 to the full size of the waveform. The first n elements of the waveform are set. do_putbyname() calls que_put() and do_put(). RETURNS The number of errors ( 0/1) encountered. SEE ALSO do_put(), sca_macros, sca_examples group_addchannel() Simple Channel Access Library group_addchannel() NAME group_addchannel() - add channel to group SYNOPSIS int group_addchannel ( char *group_name; /* group name */ char *channel_name; /* pvname[.fieldname] */ int scatype; /* data type, e.g. SCA_STRING */ int nmax; /* max number of data elements */ void **ppgroup; /* returns group ptr. Pass NULL to ignore */ void **ppchan; /* returns channel ptr. Pass NULL to ignore */ ) DESCRIPTION This routine adds a channel to a group. If the group does not exist, it is created. If all subsequent references to the channel will be by name, set the last two arguments( ppgroup and ppchan ) to (void **)NULL. RETURNS A status value containing error number and state of CA connection, SEE ALSO group_getchannel(), group_getchannelbyname(), ..., sca_macros group_removechannelbyname() SCA Library group_removechannelbyname() NAME group_removechannelbyname() - remove channel from group by name SYNOPSIS int group_removechannel ( char *group_name; /* group name */ char *channel_name; /* pvname[.fieldname] */ int scatype; /* data type, e.g. SCA_STRING */ ) DESCRIPTION This routine removes a channel from a group. If the channel has been accessed, the CA connection will persist. RETURNS A status value containing error number and state of CA connection, CA monitor and value. The latter three states will always be SCA_STATES_IRRELEVANT. Macros are provided for checking status. SEE ALSO group_addchannel(), ..., sca_macros group_removechannel() Simple Channel Access Library group_removechannel() NAME group_removechannel() - remove channel from group SYNOPSIS int group_removechannel ( void *pchan; /* pointer to channel */ ) DESCRIPTION This routine removes the channel pointed to by pchan from its group. pchan is the pointer returned by the call to group_addchannel() which added the channel to the group. If the channel has been accessed, the CA connection will persist. RETURNS A status value containing error number and state of CA connection, CA monitor and value. The latter three states will always be SCA_STATES_IRRELEVANT. Macros are provided for checking status. SEE ALSO group_addchannel(), ..., sca_macros group_freebyname() SCA Library group_freebyname() NAME group_freebyname() - remove group by name SYNOPSIS int group_freebyname ( char *group_name; /* group name */ ) DESCRIPTION This routine removes a group, including all channels associated with it. If the channels have been accessed, the CA connections will persist. RETURNS A status value containing error number and state of CA connection, CA monitor and value. The latter three states will always be SCA_STATES_IRRELEVANT. Macros are provided for checking status. SEE ALSO group_addchannel(), ..., sca_macros group_free() SCA Library group_free() NAME group_free() - remove group SYNOPSIS int group_free ( void *pgroup; /* pointer to group from group_addchannel()*/ ) DESCRIPTION This routine removes the group pointed to by pgroup, including all channels associated with it. pgroup is the group pointer returned by previous calls to group_addchannel(). RETURNS A status value containing error number and state of CA connection, CA monitor and value. The latter three states will always be SCA_STATES_IRRELEVANT. Macros are provided for checking status. SEE ALSO group_addchannel(), ..., sca_macros ^^ group_refreshbyname() SCA Library group_refreshbyname() NAME group_refreshbyname() - refresh group by name SYNOPSIS int group_refreshbyname ( char *group_name; /* group name */ ) DESCRIPTION This routine updates the cached values of all channels in the named group. If the cache has been updated within the last group_refresh_period_lower_limit seconds, this routine pends until it has been that long. RETURNS A status value containing error number and state of CA connection, CA monitor and value. The latter three states will always be SCA_STATES_IRRELEVANT. Macros are provided for checking status. SEE ALSO group_set_refresh_period(), ..., sca_macros group_refresh() SCA Library group_refresh() NAME group_refresh() - refresh group SYNOPSIS int group_refresh ( void *pgroup; /* pointer to group from group_addchannel()*/ ) DESCRIPTION This routine updates the cached values of all channels in the pointed to group. If the cache has been updated within the last group_refresh_period_lower_limit seconds, this routine pends until it has been that long. pgroup is the group pointer returned by previous calls to group_addchannel(). If the group's do_get_timeout is set( > 0.0) group_refresh waits up to that long for its call to do_get() to complete. If it is not not set group_refresh waits for .020 + .010 * num_channels sec. for the do_get() to complete. See group_set_do_get_timeout(). RETURNS A status value containing error number and state of CA connection, CA monitor and value. The latter three states will always be SCA_STATES_IRRELEVANT. Macros are provided for checking status. SEE ALSO group_set_refresh_period(), group_set_do_get_timeout90, ..., sca_macros group_getchannelbyname() Simple Channel Access Library group_getchannelbyname() NAME group_getchannelbyname() - get channel value(s) from group cache by name SYNOPSIS int group_getchannelbyname( ( char *group_name; /* group name */ char *channel_name; /* pvname[.fieldname] */ int scatype; /* data type, e.g. SCA_STRING */ int nelm; /* number of channel values to return */ void *pdest; /* where to return channel values */ int *pstatus; /* where to return channel status */ ) DESCRIPTION This routine gets the cached value(s) for a channel in a group. If the group does not exist, it is created. If the channel does not exist, it is created. If the group channel values have not been updated within the last group_refresh_period seconds, group_refresh() is called first to update the cache. RETURNS This function returns a status value containing error number and state of CA connection, CA monitor and value. The latter three states will always be SCA_STATES_IRRELEVANT. *pstatus will contain the real CA connection, CA monitor and value states of the channel. SEE ALSO group_addchannel(), group_getchannel(), ..., sca_macros group_getchannel() Simple Channel Access Library group_getchannel() NAME group_getchannel() - get channel value(s) from group cache by pointer SYNOPSIS int group_getchannel( ( void *pchan; /* pointer to channel */ int scatype; /* data type, e.g. SCA_STRING */ int nelm; /* number of channel values to return */ void *pdest; /* where to return channel values */ int *pstatus; /* where to return channel status */ ) DESCRIPTION This routine gets the cached value(s) for a channel using the pointer returned by the call to group_addchannel() which created it. If the group channel values have not been updated within the last group_refresh_period seconds, group_refresh() is called first to update the cache. RETURNS This function returns a status value containing error number and state of CA connection, CA monitor and value. The latter three states will always be SCA_STATES_IRRELEVANT. *pstatus will contain the real CA connection, CA monitor and value states of the channel. SEE ALSO group_addchannel(), group_getchannelbyname(), ..., sca_macros Simple Channel Access Library group_getfirstchannelbyname() group_getfirstchannelbyname() NAME group_getfirstchannelbyname() - get value(s) from cache for first channel in group by name SYNOPSIS int group_getfirstchannelbyname( ( char *group_name; /* group name */ int nelm; /* number of channel values to return */ void *pdest; /* where to return channel values */ int *pstatus; /* where to return channel status */ ) DESCRIPTION This routine gets the cached value(s) for the first channel in a group. If the group channel values have not been updated within the last group_refresh_period seconds, group_refresh() is called first to update the cache. RETURNS This function returns a status value containing error number and state of CA connection, CA monitor and value. The latter three states will always be SCA_STATES_IRRELEVANT. *pstatus will contain the real CA connection, CA monitor and value states of the channel. SEE ALSO group_addchannel(), group_getchannel(), ..., sca_macros Simple Channel Access Library group_getnextchannelbyname() group_getnextchannelbyname() NAME group_getnextchannelbyname() - get value(s) from cache for next channel in group by name SYNOPSIS int group_getnextchannelbyname( ( char *group_name; /* group name */ int nelm; /* number of channel values to return */ void *pdest; /* where to return channel values */ int *pstatus; /* where to return channel status */ ) DESCRIPTION This routine gets the cached value(s) for the next channel in a group. If the group channel values have not been updated within the last group_refresh_period seconds, group_refresh() is called first to update the cache. Typical usage is i = 1; status = group_getfirstchannelbyname( group_name, nelm, pdest[0], pstatus[0] ) while( sca_no_error( ( status = group_getnextchannelbyname( group_name, nelm, pdest[i], pstatus[i] ) ) ) ) { ... ++i; } RETURNS This function returns a status value containing error number and state of CA connection, CA monitor and value. The latter three states will always be SCA_STATES_IRRELEVANT. *pstatus will contain the real CA connection, CA monitor and value states of the channel. SEE ALSO group_addchannel(), group_getchannel(), ..., sca_macros Simple Channel Access Library group_getfirstchannel() group_getfirstchannelbyname() NAME group_getfirstchannel() - get value(s) from cache for first channel in group by pointer SYNOPSIS int group_getfirstchannel( ( void *pgroup; /* pointer to group from group_addchannel()*/ int nelm; /* number of channel values to return */ void *pdest; /* where to return channel values */ int *pstatus; /* where to return channel status */ ) DESCRIPTION This routine gets the cached value(s) for the first channel in a group. If the group channel values have not been updated within the last group_refresh_period seconds, group_refresh() is called first to update the cache. RETURNS This function returns a status value containing error number and state of CA connection, CA monitor and value. The latter three states will always be SCA_STATES_IRRELEVANT. *pstatus will contain the real CA connection, CA monitor and value states of the channel. SEE ALSO group_addchannel(), group_getchannel(), ..., sca_macros Simple Channel Access Library group_getnextchannel() group_getnextchannel() NAME group_getnextchannel() - get value(s) from cache for next channel in group by pointer SYNOPSIS int group_getnextchannel( ( void *pgroup; /* pointer to group from group_addchannel()*/ int nelm; /* number of channel values to return */ void *pdest; /* where to return channel values */ int *pstatus; /* where to return channel status */ ) DESCRIPTION This routine gets the cached value(s) for the next channel in a group. If the group channel values have not been updated within the last group_refresh_period seconds, group_refresh() is called first to update the cache. Typical usage is i = 1; status = group_getfirstchannel( pgroup, nelm, pdest[0], pstatus[0] ) while( sca_no_error( ( status = group_getnextchannel( pgroup, nelm, pdest[i], pstatus[i] ) ) ) ) { ... ++i; } RETURNS This function returns a status value containing error number and state of CA connection, CA monitor and value. The latter three states will always be SCA_STATES_IRRELEVANT. *pstatus will contain the real CA connection, CA monitor and value states of the channel. SEE ALSO group_addchannel(), group_getchannel(), ..., sca_macros Simple Channel Access Library group_set_refresh_period() group_set_refresh_period() NAME group_set_refresh_period() - set refresh period for a group SYNOPSIS int group_set_refresh_period( ( char *group_name; /* group name */ double period; /* period in seconds */ ) DESCRIPTION This routine sets the refresh period for the named group. If period is less than GROUP_REFRESH_PERIOD_LOWER_LIMIT or greater than GROUP_REFRESH_PERIOD_UPPER_LIMIT, an error is returned. RETURNS This function returns a status value containing error number and state of CA connection, CA monitor and value. The latter three states will always be SCA_STATES_IRRELEVANT. SEE ALSO group_get_refresh_period(), group_get_refresh_period_lower_limit(), group_get_refresh_period_upper_limit(), ..., sca_macros Simple Channel Access Library group_get_refresh_period() group_get_refresh_period() NAME group_get_refresh_period() - get refresh period for a group SYNOPSIS int group_get_refresh_period( ( char *group_name; /* group name */ double *period; /* period in seconds */ ) DESCRIPTION This routine gets the refresh period for the named group. RETURNS This function returns a status value containing error number and state of CA connection, CA monitor and value. The latter three states will always be SCA_STATES_IRRELEVANT. SEE ALSO group_set_refresh_period(), group_get_refresh_period_lower_limit(), group_get_refresh_period_upper_limit(), ..., sca_macros Simple Channel Access Library group_set_do_get_timeout() group_set_do_get_timeout() NAME group_set_do_get_timeout() - set do_get_timeout for a group SYNOPSIS int group_set_do_get_timeout( ( char *group_name; /* group name */ double timeout; /* timeout in seconds */ ) DESCRIPTION This routine sets the do_get_timout for the named group. timeout is the length of time in seconds that group_refresh() has its call to do_get() wait for completion. RETURNS This function returns a status value containing error number and state of CA connection, CA monitor and value. The latter three states will always be SCA_STATES_IRRELEVANT. SEE ALSO group_get_do_get_timeout() , ..., sca_macros Simple Channel Access Library group_get_do_get_timeout() group_get_do_get_timeout() NAME group_get_do_get_timeout() - get do_get_timeout for a group SYNOPSIS int group_get_do_get_timeout( ( char *group_name; /* group name */ double *timeout; /* timeout in seconds */ double *time; /* last actual do_get time in seconds */ ) DESCRIPTION This routine gets the do_get_timeout and the acutal time required for the last do_get() for the named group. RETURNS This function returns a status value containing error number and state of CA connection, CA monitor and value. The latter three states will always be SCA_STATES_IRRELEVANT. SEE ALSO group_set_do_get_timeout(), ..., sca_macros Simple Channel Access Library get grouping constants() get grouping constants() NAME group_get_default_refresh_period() - get constant group_get_refresh_period_lower_limit() - get constant group_get_refresh_period_upper_limit() - get constant SYNOPSIS double group_get_default_refresh_period() double group_get_refresh_period_lower_limit() double group_get_refresh_period_upper_limit() DESCRIPTION These routines get the refresh period constants. RETURNS This function returns the value of the grouping constant. SEE ALSO group_set_refresh_period(), group_getchannel(), group_refresh() cache_set() Simple Channel Access Library cache_set() NAME cache_set() - create a cache entry SYNOPSIS int cache_set ( char *name, /* process variable field name */ int scatype, /* SCA type of variable to receive value */ int nmax, /* maximum number of elements to get */ void *pap /* address of where to store acceleration pointer */ ) DESCRIPTION This routine creates an acceleration control block for the field and initiates the establishment of the channel access connection to the field. Subseqent calls to cache_get() and cache_put() acquire and set the field value using the ap returned in the location given in pap. RETURNS A status value containing error number and state of CA connection, CA monitor and value. Macros are provided for checking status. SEE ALSO cache_get(), cache_put(), sca_macros, sca_examples cache_get() Simple Channel Access Library cache_get() NAME cache_get() - get value from cache SYNOPSIS int cache_get ( ap, /* acceleration pointer-from cache_set() */ void *pdest, /* pointer to array to receive data */ int n /* number of data elements */ ) DESCRIPTION This routine gets data from the cache for the field whose acceleration pointer is ap. Only n = 1 is implemented i.e., waveforms are not implemented. pdest points to an variable of scatype given in the call to cache_set() which created ap. RETURNS A status value containing error number and state of CA connection, CA monitor and value. Macros are provided for checking status. SEE ALSO cache_set(), cache_put(), sca_macros, sca_examples cache_put() Simple Channel Access Library cache_put() NAME cache_put() - put value to field defined in cache SYNOPSIS int cache_put ( void *ap, /* acceleration pointer-from cache_set() */ void *psrc, /* pointer to array with data */ int n /* number of data elements */ ) DESCRIPTION This routine sets the value of the field whose acceleration pointer is ap. Set n = 1 except for waveforms where it may be set from 1 to the full size of the waveform. The first n elements of the waveform are set. The put is initiated and control is returned to the caller. The success of the put is not confirmed. psrc points to an array of scatype given in the call to cache_set() which created ap. RETURNS A status value containing error number and state of CA connection, CA monitor and value. Macros are provided for checking status. SEE ALSO cache_set(), cache_get(), sca_macros, sca_examples cache_getbyname() Simple Channel Access Library cache_getbyname() NAME cache_getbyname() - get value from cache by name SYNOPSIS int cache_getbyname ( char *name, /* process variable field name */ int scatype, /* SCA type of variable to receive value */ void *pdest, /* pointer to array to receive data */ int n /* number of elements to get */ ) DESCRIPTION This routine gets data from the cache for the field whose name is given. The type of data to be put is given by scatype. Set n = 1 except for waveforms where it may be set from 1 to the full size of the waveform. The first n elements of the waveform are returned. cache_getbyname() calls cache_set() once to establish the channel access connection. Subsequent calls just require a name lookup. RETURNS A status value containing error number and state of CA connection, CA monitor and value. Macros are provided for checking status. SEE ALSO cache_set(), cache_get(), sca_macros, sca_examples cache_putbyname() Simple Channel Access Library cache_putbyname() NAME cache_putbyname() - put value by name SYNOPSIS int cache_putbyname ( char *name, /* process variable field to receive data */ int scatype, /* SCA type of data pointed to by psrc */ void *psrc, /* pointer to array of data to be put*/ int n /* number of elements to put */ ) DESCRIPTION This routine puts data pointed to by psrc to the field whose name is given by name. The type of data to be put is given by scatype. Set n = 1 except for waveforms where it may be set from 1 to the full size of the waveform. The first n elements of the waveform are set. cache_putbyname() calls cache_set() once to establish the channel access connection. Subsequent calls just require a name lookup. RETURNS A status value containing error number and state of CA connection, CA monitor and value. Macros are provided for checking status. SEE ALSO cache_set(), cache_put(), sca_macros, sca_examples