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  <20182019  2020  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  <20182019  2020 
<== Date ==> <== Thread ==>

Subject: How to get string array data of waveform record using ca_create_subscription
From: Yasutaka Yamamoto <yamamo@rcnp.osaka-u.ac.jp>
To: tech-talk@aps.anl.gov
Date: Tue, 18 Sep 2018 13:31:18 +0900
Dear All,

I have a question about how to access the string array data of waveform record in the callback function.
In order to read a waveform record, I register a callback function using the ca_create_subscription function.

static void eventCallback(struct event_handler_args eha) {
chid chid = eha.chid;

if (eha.status != ECA_NORMAL) {
printChidInfo(chid, "eventCallback");
}
else {
char *pdata = (char *)eha.dbr;
printf("Event Callback: %s = %s\n",ca_name(eha.chid),pdata);
}
}

SEVCHK(ca_create_subscription(DBR_STRING, 1, pvlist[i]->mychid, DBE_VALUE, eventCallback, pvlist[i], &pvlist[i]->myevid), "ca_create_subscription");


But, print the ascii character code of the first element of the string array.
How to access the string array data ?


When I use caget command line tool, the following message appears.
caget Test
Test 100 69 80 73 67 83 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

When the eventCallback function is called, the following message appears.
Event Callback: Test = 69

Best regards,

Navigate by Date:
Prev: Re: Question about importing data from a Windows PC to a Linux PC Mark Rivers
Next: Job opening @ Helmholtz-Zentrum Berlin Joachim Rahn
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  <20182019  2020 
Navigate by Thread:
Prev: Re: Can't open Data browser in CSS Kasemir, Kay
Next: Job opening @ Helmholtz-Zentrum Berlin Joachim Rahn
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  <20182019  2020 
ANJ, 18 Sep 2018 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·