Nexus question/suggestion.

Ray Osborn ROsborn at anl.gov
Wed Apr 15 19:28:51 BST 1998


I should leave the real programmers to verify this, but I'm pretty sure your
solution is the correct one, and that it should be incorporated into the
NAPI code.  In fact, there is no reason to return iType at all if we don't
allow different attribute types.  One of the first versions of the NeXus API
only allowed character attributes, but, following a brief debate, we decided
that we needed to allow other data types as well.  For example, the "axis"
attribute should be an integer which defines which array index a particular
dimension scale describes.  I would guess that the bug you report is a
hangover from those days, and reflects the fact that we haven't started
writing the general purpose NXdata read routines that would need to query
the axis attribute.

Thanks for the question.
-- 
Dr Ray Osborn                Tel: +1 (630) 252-9011
Materials Science Division   Fax: +1 (630) 252-7777
Argonne National Laboratory  E-mail: ROsborn at anl.gov
Argonne, IL 60439-4845



>Hello,
>
>I work at the APS and am currently tring to add nexus support to some
>aqcuisition software we're developing and what I've come across is this:
>
>If I write an attribute that is of a data type other than CHAR, I have
>problems reading it back.  The problem, I believe, is due to the
>defenition of NXgetattr.  NXputattr accepts a void * to the value to
>write for the attribute, however, NXgetattr only allows for a CHAR * to
>retrieve the value.
>
>By changing the defenition for NXgetattr from
>
>NXstatus  NXgetattr(NXhandle handle, char* name, char* data, int*
>iDataLen, int* iType);
>
>to
>
>NXstatus  NXgetattr(NXhandle handle, char* name, void* data, int*
>iDataLen, int* iType);
>
>I can retrieve int, floats, ect...
>
>My question is, are attributes supposed to be restricted to char data
>only in the Nexus specification?  If so, not a problem, I can make the
>necessary changes.  If not, then can we get the function declaration
>changed to allow for the other data types?
>
>Thanks!
>
>Brian Tieman
>SRICAT--APS
>(630)252-0141
>





More information about the NeXus mailing list