EPICS Home

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: Re: Question about extracting information from a bo type record in EPICS
From: Mark Rivers via Tech-talk <tech-talk at aps.anl.gov>
To: "Meddage, Varuna" <meddage at phys.ksu.edu>
Cc: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Thu, 20 Oct 2022 15:13:00 +0000
You did not tell us what the actual problem is. Does it fail to compile, or give a runtime error, or give the “wrong” result?

Mark


Sent from my iPhone

> On Oct 20, 2022, at 10:06 AM, Meddage, Varuna via Tech-talk <tech-talk at aps.anl.gov> wrote:
> 
> 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 Meddage, Varuna via Tech-talk
References:
Question about extracting information from a bo type record in EPICS Meddage, Varuna via Tech-talk

Navigate by Date:
Prev: RE: Db/Makefile infinite loop Pearson, Matthew via Tech-talk
Next: starting ImageJ/EPICS_AD_Viewer with specified PVPrefix John Dobbins 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: Question about extracting information from a bo type record in EPICS Meddage, Varuna via Tech-talk
Next: Re: Question about extracting information from a bo type record in EPICS Meddage, Varuna 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