1、Siemens - Automation and Drives - Service入一个结构名并给它加上一个事例名。然后该变量的值从 一个最终变量读出。 下面的脚本由鼠标在一个按钮上单击触发。 Program listing: = #include “apdefap.h“ void OnClick(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName) char* InstanceNameA; DWORD VarContA; / Presetting of internal variable with struc
2、ture name, / this can also have happened at a different point SetTagChar(“VariableFlag“,“TriangleEnvelopeCurve“); / Reservation of memory InstanceNameA = SysMalloc(200); / Read in structure name strcpy(InstanceNameA,GetTagChar(“VariableFlag“); / Test output in diagnostic window printf(“Contents Poin
3、ter Position 1: %srn“, InstanceNameA); / Add instance name to variable name strcat(InstanceNameA,“.Triangle_1“); / Test output in diagnostic window printf(“Contents Pointer Position 2: %srn“, InstanceNameA); / Read in variable value VarInhA = GetTagWord(InstanceNameA); / Test output in diagnostic window printf(“VariableContents: %drn“, VarContA); / Release of reserved memory SysFree(InstanceNameA); 条目号:条目号:218537 日期:日期:04/15/2003 Siemens AG 2005版权所有 - 法人信息 - 保密政策 - 应用条款