Experimental Physics and
| |||||||||||||||
|
I wrote a monitoring program using some of the example code from EPICS- BASE and the lecture videos. It connects to an IOC every 5 minutes for 12 PV's and write their values to a text file. The only problem is that it eventually fails with the following error message: epicsSocketEnablePortUseForDatagramFanout: unable to set SO_REUSEADDR? epicsSocketDestroy: failed to close a socket because "Bad file descriptor" CAC: unable to create virtual circuit because "Too many open files" the last line is repeated multiple times. Now the relevant code snippet is: while(1) { ... ... ... /* * Here is where the CA calls happen */ /* Initialize */ status=ca_context_create(ca_disable_preemptive_callback); if(status != ECA_NORMAL) { printf("ca_context_create failed:\n%s\n",ca_message(status)); exit(1); } /* Search */ for(i = 0; i < 12; i++) { status = ca_create_channel (pv[i],connectionChangedCB,NULL,CA_PRIORITY_DEFAULT,&pCh[i]); if(status != ECA_NORMAL) { printf("ca_create_channel for pv%d failed:\n%s\n", i, ca_message(status)); exit(1); } } /* Wait */ startTime=curTime; ca_pend_event(timeout); /* Clear the channel */ for(i = 0; i < 12; i++) { status=ca_clear_channel(pCh[i]); if(status != ECA_NORMAL) { printf("ca_clear_channel for pv%d failed:\n%s\n", i, ca_message(status)); } } /* Exit */ ca_context_destroy(); ... ... ... } I thought I had included everything I need, but apparently I missed something. Any help would be greatly appreciated, Bertrand Happy post July 4th!
| ||||||||||||||
ANJ, 02 Sep 2010 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |