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  2025  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  2025 
<== 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:43:39 +0000
Please show the complete output when you run your program.


Sent from my iPhone

> On Oct 20, 2022, at 10:32 AM, Meddage, Varuna <meddage at phys.ksu.edu> wrote:
> 
> Yes,
> 
> 
> I can compile it, and no run time error either. But I cannot extract the desired value from the PV using ca_get command.
> 
> 
> ________________________________
> From: Mark Rivers <rivers at cars.uchicago.edu>
> Sent: Thursday, October 20, 2022 10:13:00 AM
> To: Meddage, Varuna
> Cc: tech-talk at aps.anl.gov
> Subject: Re: Question about extracting information from a bo type record in EPICS
> 
> 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

References:
Question about extracting information from a bo type record in EPICS Meddage, Varuna via Tech-talk
Re: Question about extracting information from a bo type record in EPICS Mark Rivers via Tech-talk
Re: Question about extracting information from a bo type record in EPICS Meddage, Varuna via Tech-talk

Navigate by Date:
Prev: Re: Question about extracting information from a bo type record in EPICS Meddage, Varuna via Tech-talk
Next: Re: starting ImageJ/EPICS_AD_Viewer with specified PVPrefix 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  2025 
Navigate by Thread:
Prev: Re: 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 Ralph Lange 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  2025 
ANJ, 20 Oct 2022 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions ·
· Download · Search · IRMIS · Talk · Documents · Links · Licensing ·