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
- Replies:
- 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 Ralph Lange via Tech-talk
- 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
- Navigate by Date:
- Prev:
starting ImageJ/EPICS_AD_Viewer with specified PVPrefix John Dobbins 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
<2022>
2023
2024
- Navigate by Thread:
- Prev:
Re: Question about extracting information from a bo type record in EPICS Mark Rivers 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
<2022>
2023
2024
|