Initial version.
This commit is contained in:
13
src/makeBaseExt/top/exampleExt/Makefile
Normal file
13
src/makeBaseExt/top/exampleExt/Makefile
Normal file
@@ -0,0 +1,13 @@
|
||||
TOP=../..
|
||||
include $(TOP)/configure/CONFIG
|
||||
|
||||
PROD_HOST = caExample
|
||||
caExample_SRCS += caExample.cc
|
||||
#caExample_CFLAGS +=
|
||||
#caExample_LDFLAGS +=
|
||||
caExample_LIBS += ca Com
|
||||
ca_LIB=$(EPICS_BASE_LIB)
|
||||
Com_LIB=$(EPICS_BASE_LIB)
|
||||
|
||||
include $(TOP)/configure/RULES
|
||||
|
||||
25
src/makeBaseExt/top/exampleExt/caExample.c
Normal file
25
src/makeBaseExt/top/exampleExt/caExample.c
Normal file
@@ -0,0 +1,25 @@
|
||||
/*caExample.c*/
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "cadef.h"
|
||||
|
||||
main(int argc,char **argv)
|
||||
{
|
||||
double data;
|
||||
chid mychid;
|
||||
|
||||
if(argc != 2) {
|
||||
fprintf(stderr,"usage: caExample pvname\n");
|
||||
exit(1);
|
||||
}
|
||||
SEVCHK(ca_task_initialize(),"ca_task_initialize");
|
||||
SEVCHK(ca_search(argv[1],&mychid),"ca_search failure");
|
||||
SEVCHK(ca_pend_io(5.0),"ca_pend_io failure");
|
||||
SEVCHK(ca_get(DBR_DOUBLE,mychid,(void *)&data),"ca_get failure");
|
||||
SEVCHK(ca_pend_io(5.0),"ca_pend_io failure");
|
||||
printf("%s %f\n",argv[1],data);
|
||||
return(0);
|
||||
}
|
||||
Reference in New Issue
Block a user