Hey all,
Hopefully there's someone out there who can help me. We've been using
the portable CA Server on Windows for close to a year now for several
projects. What I did was to take the simple example program and modify
it so it had the hooks we needed to serve PVs from code we wrote to
control CCD cameras. The one bit of functionality I have yet to be able
to get working is the proper serving of string PVs.
I can declare a PV as type aitEnumString of length 1 and my defined
callback routine will get the proper "Put" string, however, I can not
get the "Scan" method to take a string from my process and display it in
the served PV. This would be handy for reporting error strings, for
instance.
Below is the scan method for a scalar pv declared as aitFloat32.
PVtypes is a union of all supported pvtypes. newValue is the value from
my process which is to be "scanned" into the server and made availiable
to client through caget calls.
void exScalarPV::scanFloat32 (PVtypes *newValue)
{
caStatus status;
smartGDDPointer pDD;
aitFloat32 limit;
int gddStatus;
pDD = new gddScalar (gddAppType_value, aitEnumFloat32);
if (pDD==NULL) {
return;
}
//
// smart pointer class manages reference count after this point
//
gddStatus = pDD->unreference();
assert (!gddStatus);
if (newValue != NULL)
{
limit = (aitFloat32) this->info.getHopr();
newValue->pvfloat32 = tsMin (newValue->pvfloat32, limit);
limit = (aitFloat32) this->info.getLopr();
newValue->pvfloat32 = tsMax (newValue->pvfloat32, limit);
*pDD = newValue->pvfloat32;
status = this->update (*pDD);
if (status!=S_casApp_success)
errMessage (status, "scalar scan update failed\n");
}
}
This code works fine. When the PV is of type aitEnumString, however, I
get the correct value in newValue as a char*, but I can't figure out how
to properly scan that value into the smartGDDPointer so my clients can
see it.
If anyone has done this or knows how to do it, I'd much appreciate your
help.
Thanks!
Brian Tieman
APS
[email protected]
- Replies:
- Re: String PVs and the Portable CA Server. john sinclair
- Navigate by Date:
- Prev:
channel access time response Dale L. Brewe
- Next:
RE: channel access time response Jeff Hill
- 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: channel access time response Frank Lenkszus
- Next:
Re: String PVs and the Portable CA Server. john sinclair
- 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
|