EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  <20222023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  <20222023  2024 
<== Date ==> <== Thread ==>

Subject: Question about extracting information from a bo type record in EPICS
From: "Meddage, Varuna via Tech-talk" <tech-talk at aps.anl.gov>
To: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Thu, 20 Oct 2022 13:51:00 +0000
Hi,


I have question about extracting PV value from a bo type record in EPICS through an external C++ program.


If I explain the issue in detail,


First I created a bo type record in one of the .db files. Then I was able to successfully change the value of this record using CS - studio GUI using an on/off switch. (used ca_get command to confirm whether the PV value is changed, when I toggle the on/off switch in CSS GUI)


////////////////////////////////////////// This is the b0 type record in my .db file ///////////////////////


record(bo,"$(detector)_wib$(crate)0$(wib)_femb$(femb)/switch")

{

field(DTYP,"")

        field(OUT,"CA_LINK")

        field(SCAN,"Passive")

        field(DESC,"Status")

field(ZSV,"MAJOR")

field(OSV,"NO_ALARM")

field(ZNAM,"Off")

field(ONAM,"On")

}


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


But when I try to extract the value of this PV through an external C++ program, using ca_get command, I cannot do that successfully.



/////////////////////////////////////////////////// rough outline of the C++ program used to extract PV value ///////////////


chid femb[N_FEMB_PV];

int status;


std::cout << "********************** FEMB sensor summmary ************************** \n";



for(int i=0; i<N_FEMB_PV; i++) {

     sprintf(femb_pv[i], femb_pv_pattern[i]);

     printf("%s\n", femb_pv[i]);

     status = ca_create_channel(femb_pv[i], NULL, NULL, 0, &femb[i]);

     SEVCHK(status,"ca_create_channel error");

     status = ca_pend_io(1.0);

     SEVCHK(status,"ca_pend_io error");



     printf("PV:    %s\n", ca_name(femb[i]));

     printf("State: %d\n", ca_state(femb[i]));

     printf("Host   %s\n", ca_host_name(femb[i]));

     printf("Read:  %d\n", ca_read_access(femb[i]));

     printf("Write: %d\n", ca_write_access(femb[i]));

     printf("Type:  %s\n", dbr_type_to_text(ca_field_type(femb[i])));

     printf("Count: %d\n", ca_element_count(femb[i]));

     printf("State: %d\n", ca_state(femb[i]));

}


double femb_power_commands[96];


for (int entry=0; entry<some_number; entry++){

  status = ca_get(DBR_DOUBLE,femb[entry],&femb_power_commands[entry]);

}


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


Any advice to solve this issue is really appreciated.


Thanks

Varuna Meddage

Replies:
Re: Question about extracting information from a bo type record in EPICS Mark Rivers via Tech-talk

Navigate by Date:
Prev: Re: Db/Makefile infinite loop Simon Rose via Tech-talk
Next: RE: Db/Makefile infinite loop Pearson, Matthew via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  <20222023  2024 
Navigate by Thread:
Prev: Re: integration with GroovEPIC PLC? Ralph Lange via Tech-talk
Next: Re: Question about extracting information from a bo type record in EPICS Mark Rivers via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  <20222023  2024 
ANJ, 20 Oct 2022 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·