Hi Lewis,
On 2012-11-15 J. Lewis Muir wrote:
> What happens for type DBF_STRING when it is *not* fetched as a
> long-string? Is it always just sent as 40 bytes and the client has to
> figure out where the string ends based on where the NUL byte is?
Yup, a DBR_STRING request gives you a dbr_string_t which is a fixed-length 40
character array. The IOC code that copies a DBF_STRING from a record field
into the CA network buffer (or into another DBF_STRING field in the IOC) puts
a Nil byte in the last element so client code that handles strings can assume
that they are always Nil terminated.
> If a DBF_STRING includes the NUL byte over CA when *not* fetched as a
> long-string, then I would think that fetching a long-string (by using
> the '$' suffix) from a waveform record's VAL field would include a NUL
> byte over CA also.
Careful, you can only use the $ field modifier on a field that is a DBF_STRING
type, and due to the IOC code doing things in the wrong order in 3.14.12.x the
$ modifier won't work on the VAL field of a waveform record that has FTVL set
to STRING (and similar for aSub fields). Mark is talking about a waveform
record with FTVL set to CHAR so there is never any need for the field modifier
anyway.
> But for the case of just fetching an array of chars from a waveform
> record's VAL field, I would not expect to get a NUL byte in that since
> NORD is supposed to tell me the length.
That really depends on the source of the character data, and whether you're
using the dynamic array sizing features. Before 3.14.12 or if you request a
fixed size you always get an array of the size you requested, filled with Nil
bytes after the first NORD characters.
- Andrew
--
READ CAREFULLY. By reading this email, you agree, on behalf of your
employer, to release me from all obligations and waivers arising from
any and all NON-NEGOTIATED agreements, licenses, terms-of-service,
shrink-wrap, click-wrap, browse-wrap, confidentiality, non-disclosure,
non-compete and acceptable use policies ("BOGUS AGREEMENTS") that I
have entered into with your employer, its partners, licensors, agents
and assigns, in perpetuity, without prejudice to my ongoing rights
and privileges. You further represent that you have the authority to
release me from any BOGUS AGREEMENTS on behalf of your employer.
- References:
- Long string support in CA clients and device support Andrew Johnson
- Re: Long string support in CA clients and device support Andrew Johnson
- Re: Long string support in CA clients and device support J. Lewis Muir
- Navigate by Date:
- Prev:
Re: Long string support in CA clients and device support J. Lewis Muir
- Next:
DB Question Szalata, Zenon M.
- 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: Long string support in CA clients and device support J. Lewis Muir
- Next:
question of Hytec 8516 added in synApps-5.3 李芳
- 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
|