//define all tags
BOOL lValue1;
long lValue2 ;
char szValue3[_MAX_PATH];
float lValue4;
char lValue5;
// Fill the tags with the values
// you want to set into the WinCC tags
...
//Set the WinCC tags
SetTagMultiStateWait(dwData,"%d%d%s%f%d","gs_tag_bit",lValue1,
"gs_tag_SByte",lValue2,
"gs_tag_char",szValue3,
"gs_tag_float",lValue4,
"gs_tag_word",lValue5);
//User defined code where the
//user can do something with the return value
...
}
Parameters of the SetTagMultiStateWait function:
"dwData" is the DWord-Array, in which the tag statuses are stored.
"%d%d%s%f%d" are the type descriptions of the tags to be written.
"gs_tag_bit" is the WinCC tag to be written.
"lValue1" is the tag to whose value the WinCC tag gs_tag_bit is to be set.
"gs_tag_SByte" is the WinCC tag to be written.
"&lValue2" is the tag to whose value the WinCC tag gs_tag_SByte is to be set.
The other parameters are to be handled in the same way as those described previously.
1. Creating a DWord-Array with the required size (Number of tags).
2. Creating tags whose values are to be written to the WinCC tags.
3. Writing the values of the previously created and filled tags to the WinCC tags.l
4. Executing user-defined code for processing return values.
SetTagMultiWait example
BOOL ok;
ok=SetTagMultiWait("%d%s%f", "Ernie_word", 16,
"Ernie_char", "Hello World",
"Ernie_double", 55.4711);
ANSI-C function descriptions
3.4 Appendix
MDM - WinCC: Scripting (VBS, ANSI-C, VBA)
System Manual, 11/2008,
1525