EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  <19992000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  <19992000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: String PVs and the Portable CA Server.
From: john sinclair <[email protected]>
To: Brian Tieman <[email protected]>
Cc: Tech Talk <[email protected]>
Date: Wed, 21 Jul 1999 13:45:55 -0400 (EDT)
On Wed, 21 Jul 1999, Brian Tieman wrote:

> 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]
> 
> 
> 

I have used strings by declaring them as aitFixedString and using
no more that AIT_FIXED_STRING_SIZE characters.

I do, however, return aitEnumString from the bestExternalType function.

John Sinclair
[email protected]
Oak Ridge National Lab
423-576-6362   423-574-1268 (fax)



References:
String PVs and the Portable CA Server. Brian Tieman

Navigate by Date:
Prev: Re: String PVs and the Portable CA Server. saa
Next: RE: String PVs and the Portable CA Server. Peregrine McGehee
Index: 1994  1995  1996  1997  1998  <19992000  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: String PVs and the Portable CA Server. Brian Tieman
Next: Re: String PVs and the Portable CA Server. saa
Index: 1994  1995  1996  1997  1998  <19992000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 10 Aug 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·