Hello, I am (re)writing a handler in MS Visual C++ 6.0 for some specific cards. I used to have all the parameters available for all cards, even though it didn't apply for an specific card. I used the msginst.dll approach of using a Dialog Box to select the type of card prior the definition of Parameters, and now I have only the ones I need. In order for the init and the rest of the function to work, I need to know which type of card it is and act accordingly. I found the UtaHwModDeclarePrivateParmso I can fill this up whenever the user selects the type of card when registering. Documentation shows that this function works just as UtaHwModDeclareParm but its hidden to the user in the topology editor. If I declare any parm with the Private one, the Parm will not be found through UtaPbGetString. I wonder if there are special functions that have to be called to read Parms that are declared Private, or there is something I am doing wrong, or that is not the use for the UtaHwModDeclarePrivateParm function, or its just broken in the UTA version I have?
uta.h ver 1.92 UtaCore.h ver 1.116
PS I compared the uta.h version from txsl 4, 5 6 and 7, they all have the same version number although the length is different, also the .lib for utacore has different sizes among the 4 versions.
I cannot quite get you when you mention that UtaHwModDeclareParm is hidden to the user at topology. Perhaps you could give us some snapshot or show us some portion of ur codes that you were working on with this function " UtaHwModDeclareParm".
Hello Cynthia, Please see the definition of both functions in uta.h below
/* Used when writing the DeclareParms instrument/switch handler routine. This API defines a parameter by providing its name, the data type and, optionally, its description. The hModule and hPbDef is passed into the DeclareParms and is to be passed on unchanged Parameters and their meanings are defined by the instrument/switch handler writer. The topology editor will prompt the user to provide the parameters values when adding a module to the topology.
Valid Data Types ----------------
CUtaReal64 64 bit real CUtaInt32 32 bit integer CUtaString String CUtaComplex Complex (imag, real) CUtaInst Instrument data structure CUtaRange Range (start, stop, steps) CUtaPoint Point (x, y) CUtaReal64Array 64 bit real array CUtaInt32Array 32 bit integer array CUtaStringArray String Array CUtaPointArray Point Array CUtaRangeArray Range Array CUtaWaveform Waveform (start, stop)
/ Same as above but parms are not presented to user in Topology Editor */ HUTADATA UTAAPI UtaHwModDeclarePrivateParm (HUTAHWMOD hModule, HUTAPBDEF hPbDef, LPCSTR lpszParmName, LPCSTR lpszType, LPCSTR lpszDescription UTACPP_DEFAULT(NULL));
What I want to do is have a Hardware handler for different cards that are similar, although I need them to have a parameter that is not shown to the user in the topology editor. I just want to have it automatically filled when the instrument is created in the topology editor, and use it when the instrument is initialized and closed.
// Action passes in an instrument, so retrieve that first
HUTAINST hInst = UtaPbGetInst (hPB, "Instrument", &viSession );
// From instrument get access to the module handle
HUTAHWMOD hModule = UtaInstGetModule(hInst);
// The UtaHwModDeclarePrivateParm function adds parameters to a private ParameterBlock object, so retrieve that first.
HUTAPBDEF hPrivatePB = UtaHwModGetPrivateParmBlock(hModule);
// Find the parameter you are looking for in the private parameter block definition (HUTAPBDEF)
HUTAPARM hPrivateParm = UtaPbDefFindParm(hPrivatePB, "PrivateParameter");
// The HUTAPARM data type contains the real, underlying data, so extract it using UtaParmGetData.
HUTASTRING hPrivString = (HUTASTRING) UtaParmGetData(hPrivateParm);
// Now you can use the standard Uta functions
UtaPbSetString(hPB, "PrivateParameter", UtaStringGetValue(hPrivString));