for ( i=0u; i < 1000; i++ ) {
result = ca_context_create(ca_disable_preemptive_callback);
if (result != ECA_NORMAL) { fprintf(stderr, "CA error %s occurred while trying to start channel access.n", ca_message(result)); return(1);
}
result = ca_search(name1, &chid1);
if (result != ECA_NORMAL) { fprintf(stderr, "error: problem doing search for %sn", name1); return(1);
}
result = ca_search(name2, &chid2);
if (result != ECA_NORMAL) { fprintf(stderr, "error: problem doing search for %sn", name2); return(1);
}
result = ca_pend_io(10);
if (result != ECA_NORMAL) { fprintf(stderr, "warning: problem doing search for PVsn");
}
result = ca_state(chid1);
if (result != cs_conn) {
result = ca_put(DBR_STRING, chid1, "0");
if (result != ECA_NORMAL) { fprintf(stderr, "error: problem doing put for %sn", name1); return(1);
}
}
result = ca_state(chid2);
if (result != cs_conn) {
result = ca_put(DBR_STRING, chid2, "0");
if (result != ECA_NORMAL) { fprintf(stderr, "error: problem doing put for %sn", name2); return(1);
}
}
result = ca_pend_io(10);
result = ca_pend_io(10);
if (result != ECA_NORMAL) { fprintf(stderr, "error: problem doing put for PVsn");
}
Some source code for my test:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <cadef.h>
#include <epicsVersion.h>
#include <epicsThread.h>
int main(int argc, char **argv)
{
char name1[40], name2[40];
chid chid1, chid2;
long result;
unsigned i;
sprintf(name1, "joh:fred");
sprintf(name2, "joh:jane");
for ( i=0u; i < 1000; i++ ) { create( ca_disable_ preemptive_ callback) ;
fprintf( stderr, "CA error %s occurred while trying to start channel access.n", ca_message( result) );
return( 1);
result = ca_context_
if (result != ECA_NORMAL) {
}
result = ca_search(name1, &chid1);
fprintf( stderr, "error: problem doing search for %sn", name1);
return( 1);
if (result != ECA_NORMAL) {
}
result = ca_search(name2, &chid2);
fprintf( stderr, "error: problem doing search for %sn", name2);
return( 1);
if (result != ECA_NORMAL) {
}
result = ca_pend_io(10);
fprintf( stderr, "warning: problem doing search for PVsn");
if (result != ECA_NORMAL) {
}
result = ca_state(chid1);
fprintf( stderr, "error: problem doing put for %sn", name1);
return( 1);
if (result != cs_conn) {
result = ca_put(DBR_STRING, chid1, "0");
if (result != ECA_NORMAL) {
}
}
result = ca_state(chid2);
fprintf( stderr, "error: problem doing put for %sn", name2);
return( 1);
if (result != cs_conn) {
result = ca_put(DBR_STRING, chid2, "0");
if (result != ECA_NORMAL) {
}
}
result = ca_pend_io(10);
result = ca_pend_io(10);
fprintf( stderr, "error: problem doing put for PVsn");
if (result != ECA_NORMAL) {
}
}
return(0);
}