DspInfoNew
Creates an object information block. Use this function with the associated low-level animation information functions to get and process object information on an AN.
Note: When you have finished with the object information block, you need to destroy it with the DspInfoDestroy() function. There are limited number of info 383 blocks that can be allocated, if they are not freed properly DspInfoNew will return -1.
If you need simple animation help, use the InfoForm() or the InfoFormAn() functions.
Syntax
DspInfoNew(AN)
AN:
The AN for which object information is provided.
Return Value
The object information block handle. If no object data is available, then -1 is returned.
Related Functions
DspInfo, DspInfoField, DspInfoDestroy, InfoForm, InfoFormAn
Example
/*This example creates a form, with the title "Tag Info" and a size of 25 x 5 characters. It creates an information block for the AN closest to the mouse cursor and then extracts the name, I/O device, and engineering value for the first tag in the object expression.*/
INT hInfo;
STRING sTag;
hInfo=DspInfoNew(DspGetNearestAN());
IF hInfo>-1 THEN
FormNew("Tag Info",25,5,2);
sTag=DspInfo(hInfo,3,0);
FormPrompt(0,0,sTag);
FormPrompt(0,16,DspInfoField(hInfo,sTag,"Unit"));
FormPrompt(0,32,DspInfoField(hInfo,sTag,"Eng_Value"));
FormRead(0);
DspInfoDestroy(hInfo);
END
See Also