@@ -2212,7 +2225,7 @@ a structured CA data type.
#include "cadef.h"
int main ( int argc, char ** argv )
-{
+{
struct dbr_time_double * pTD;
const dbr_double_t * pValue;
unsigned nBytes;
@@ -2222,12 +2235,12 @@ int main ( int argc, char ** argv )
chid chan;
double sum;
int status;
-
+
if ( argc != 2 ) {
fprintf ( stderr, "usage: %s <channel name>", argv[0] );
return -1;
}
-
+
status = ca_create_channel ( argv[1], 0, 0, 0, & chan );
SEVCHK ( status, "ca_create_channel()" );
status = ca_pend_io ( 15.0 );
@@ -2243,7 +2256,7 @@ int main ( int argc, char ** argv )
fprintf ( stderr, "insufficient memory to complete request\n" );
return -1;
}
-
+
status = ca_array_get ( DBR_TIME_DOUBLE, elementCount, chan, pTD );
SEVCHK ( status, "ca_array_get()" );
status = ca_pend_io ( 15.0 );
@@ -2251,23 +2264,23 @@ int main ( int argc, char ** argv )
fprintf ( stderr, "\"%s\" didnt return a value.\n", argv[1] );
return -1;
}
-
- pValue = & pTD->value;
- sum = 0.0;
- for ( i = 0; i < elementCount; i++ ) {
- sum += pValue[i];
+
+ pValue = & pTD->value;
+ sum = 0.0;
+ for ( i = 0; i < elementCount; i++ ) {
+ sum += pValue[i];
}
-
+
epicsTimeToStrftime ( timeString, sizeof ( timeString ),
"%a %b %d %Y %H:%M:%S.%f", & pTD->stamp );
printf ( "The sum of elements in %s at %s was %f\n",
argv[1], timeString, sum );
-
+
ca_clear_channel ( chan );
ca_task_exit ();
free ( pTD );
-
+
return 0;
}
@@ -2310,7 +2323,7 @@ void myCallback ( struct event_handler_args args )
When the server detects a failure, and there is no client call back function
-attached to the request, then�an exception handler is executed in the client.
+attached to the request, an exception handler is executed in the client.
The default exception handler prints a message on the console and exits if the
exception condition is severe. Certain internal exceptions within the CA client
library, and failures detected by the SEVCHK macro may also cause the exception
@@ -2332,8 +2345,8 @@ library functions that request them.
For routines that require an argument specifying the number of array
-elements, no more than the�process variable's maximum�native element count may
-be requested. The process variable's�maximum native element count is available
+elements, no more than the process variable's maximum native element count may
+be requested. The process variable's maximum native element count is available
from ca_element_count() when the channel is connected. If less elements than
the process variable's native element count are requested the requested values
will be fetched beginning at element zero. By default CA limits the number of
@@ -2376,19 +2389,19 @@ same process).
Starting with EPICS R3.14 the CA client libraries are fully thread safe on
all OS (in past releases the library was thread safe only on vxWorks). When the
-client library is initialized the programmer may specify if preemptive call
-back is enabled. Preemptive call back is disabled by default. If preemptive
-call back is enabled then the user's call back functions might be called by
+client library is initialized the programmer may specify if preemptive callback
+is to be enabled. Preemptive callback is disabled by default. If preemptive
+callback is enabled, then the user's callback functions might be called by
CA's auxiliary threads when the main initiating channel access thread is not
inside of a function in the channel access client library. Otherwise, the
-user's call back functions will be called only when the main initiating channel
+user's callback functions will be called only when the main initiating channel
access thread is executing inside of the CA client library. When the CA client
-library invokes a user's�call back function it will always wait for the current
-callback to complete prior to executing another call back function. Programmers
+library invokes a user's callback function, it will always wait for the current
+callback to complete prior to executing another callback function. Programmers
enabling preemptive callback should be familiar with using mutex locks to
create a reliable multi-threaded program.
-To set up a traditional single threaded client you will need code like this
+
To set up a traditional single threaded client, you will need code like this
(see ca_context_create and CA Client Contexts and Application Specific Auxiliary
Threads) .
@@ -2412,7 +2425,7 @@ address space (process) to be independent of each other. For example, the
database CA links and the sequencer are designed to not use the same CA client
library threads, network circuits, and data structures. Each thread that calls
ca_context_create() for the first time either
-directly, or implicitly when calling any CA library function for the first
+directly or implicitly when calling any CA library function for the first
time, creates a CA client library context. A CA client library context contains
all of the threads, network circuits, and data structures required to connect
and communicate with the channels that a CA client application has created. The
@@ -2585,7 +2598,7 @@ void ca_context_destroy();
Description
-Shut down the calling thread's�channel access client context and free any
+
Shut down the calling thread's channel access client context and free any
resources allocated. Detach the calling thread from any CA client context.
Any user-created threads that have attached themselves to the CA context
@@ -2638,8 +2651,8 @@ the routine writes a channel identifier into the user's variable of type
on a channel.
The circuit may be initially connected or disconnected depending on the
-state of the network and the location of the channel. A channel will only�enter
-a�connected state after server's address is determined, and only if channel
+state of the network and the location of the channel. A channel will only enter
+a connected state after server's address is determined, and only if channel
access successfully establishes a virtual circuit through the network to the
server. Channel access routines that send a request to a server will return
ECA_DISCONNCHID if the channel is currently disconnected.
@@ -2744,7 +2757,7 @@ int ca_clear_channel (chid CHID);
Description
-Shutdown and reclaim resources�associated with a channel created by
+
Shutdown and reclaim resources associated with a channel created by
ca_create_channel().
All remote operation requests such as the above are accumulated (buffered)
@@ -2754,7 +2767,7 @@ efficiently sent over the network in one message.
Clearing a channel does not cause its disconnect handler to be called, but
clearing a channel does shutdown and reclaim any channel state change event
-subscriptions�(monitors) registered�with the�channel.
+subscriptions (monitors) registered with the channel.
Arguments
@@ -2788,9 +2801,9 @@ int ca_array_put_callback ( chtype TYPE,
Write a scalar or array value to a process variable.
-When ca_array_put� or ca_put are invoked the client will receive no response
+
When ca_array_put or ca_put are invoked the client will receive no response
unless the request can not be fulfilled in the server. If unsuccessful an
-exception handler is run on the client side.
+exception handler is run on the client side.
When ca_array_put_callback are invoked the user supplied asynchronous call
back is called only after the initiated write operation, and all actions
@@ -2861,7 +2874,7 @@ do not cause the record to be processed.
PFUNC
- - address of user supplied�callback function to be
+
- address of user supplied callback function to be
run when the requested operation completes
@@ -2916,12 +2929,13 @@ int ca_array_get_callback ( chtype TYPE, unsigned long COUNT,
assumed to be stable in the application supplied buffer until after ECA_NORMAL
is returned from ca_pend_io. If a connection is lost outstanding ca get
requests are not automatically reissued following reconnect.
-When ca_get_callback or ca_array_get_callback are invoked a value is read
+
+When ca_get_callback or ca_array_get_callback are invoked a value is read
from the channel and then the user's callback is invoked with a pointer to the
retrieved value. Note that ca_pend_io will not block for the delivery of values
requested by ca_get_callback. If the channel disconnects before a ca get
callback request can be completed, then the clients call back function is
-called with failure status.
+called with failure status.
All of these functions return ECA_DISCONN if the channel is currently
disconnected.
@@ -3067,7 +3081,7 @@ indicating the current state of the channel.
USRERFUNC
- - The address of user supplied callback�function to
+
- The address of user supplied callback function to
be invoked with each subscription update.
@@ -3131,7 +3145,7 @@ int ca_clear_subscription ( evid EVID );
Cancel a subscription.
All ca_clear_event() requests such as the above are accumulated (buffered)
-and not forwarded to the�server until one of ca_flush_io, ca_pend_io,
+and not forwarded to the server until one of ca_flush_io, ca_pend_io,
ca_pend_event, or ca_sg_pend are called. This allows several requests to be
efficiently sent together in one message.
@@ -3281,8 +3295,8 @@ int ca_flush_io();
Description
-Flush�outstanding IO requests to the server.�This routine might be useful
-to�users�who need�to flush requests�prior to�performing client side labor in
+
Flush outstanding IO requests to the server. This routine might be useful
+to users who need to flush requests prior to performing client side labor in
parallel with labor performed in the server.
Outstanding requests are also sent whenever the buffer which holds them
@@ -3388,23 +3402,22 @@ field should not be used.
Example
void ca_exception_handler (
- struct exception_handler_args args)
+ struct exception_handler_args args)
{
- char buf[512];
- char *pName;
+ char buf[512];
+ char *pName;
- if ( args.chid ) {
- pName = ca_name ( args.chid );
- }
- else{
- pName = "?";
- }
- sprintf ( buf,
- "%s - with request chan=%s op=%d data type=%s count=%d",
- args.ctx, pName, args.op, dbr_type_to_text ( args.type ), args.count );
- ca_signal ( args.stat, buf );
-
-}
+ if ( args.chid ) {
+ pName = ca_name ( args.chid );
+ }
+ else {
+ pName = "?";
+ }
+ sprintf ( buf,
+ "%s - with request chan=%s op=%d data type=%s count=%d",
+ args.ctx, pName, args.op, dbr_type_to_text ( args.type ), args.count );
+ ca_signal ( args.stat, buf );
+}
ca_add_exception_event ( ca_exception_handler , 0 );
Returns
@@ -3536,7 +3549,7 @@ specified channel.
whenever the access rights state of a connected channel changes
-When a channel is created�no access rights handler is installed.
+When a channel is created no access rights handler is installed.
Arguments
@@ -3588,7 +3601,7 @@ chtype ca_field_type ( CHID );
Returns
TYPE
- - The data type code will be�a member of the�set of DBF_XXXX in
+
- The data type code will be a member of the set of DBF_XXXX in
db_access.h. The constant TYPENOTCONN is returned if the channel is
disconnected.
@@ -3599,7 +3612,7 @@ unsigned ca_element_count ( CHID );
Description
-Return the maximum array element count in� the server for the specified IO
+
Return the maximum array element count in the server for the specified IO
channel.
Arguments
@@ -3611,7 +3624,7 @@ channel.
Returns
COUNT
- - The�maximum array element count in� the server. An element count of
+
- The maximum array element count in the server. An element count of
zero is returned if the channel is disconnected.
@@ -3751,8 +3764,8 @@ int ca_read_access ( CHID );
Description
-Returns�boolean true�if the client currently has read access to the
-specified channel and�boolean false�otherwise.
+Returns boolean true if the client currently has read access to the
+specified channel and boolean false otherwise.
Arguments
@@ -3763,8 +3776,8 @@ specified channel and�boolean false�otherwise.
Returns
STRING
- - boolean true�if the client currently has read access to the specified
- channel and�boolean false�otherwise
+ - boolean true if the client currently has read access to the specified
+ channel and boolean false otherwise
@@ -3773,8 +3786,8 @@ int ca_write_access ( CHID );
Description
-Returns�boolean true�if the client currently has�write access to the
-specified channel and�boolean false�otherwise.
+Returns boolean true if the client currently has write access to the
+specified channel and boolean false otherwise.
Arguments
@@ -3815,7 +3828,7 @@ unsigned dbr_size_n ( TYPE, COUNT );
Description
-Returns the size in bytes for a DBR_XXXX type with�COUNT elements.�If the
+
Returns the size in bytes for a DBR_XXXX type with COUNT elements. If the
DBR type is a structure then the value field is the last field in the
structure. If COUNT is greater than one then COUNT-1 elements are appended to
the end of the structure so that they can be addressed as an array through a
@@ -4029,7 +4042,7 @@ SEVCHK(status, Sync group block failed);
#include <cadef.h>
-int ca_sg_test� ( CA_SYNC_GID GID )
+int ca_sg_test ( CA_SYNC_GID GID )
Description
@@ -4187,7 +4200,7 @@ reissued.
CHID
- - channel�identifier
+ - channel identifier
PVALUE