Handling Strings in WinCC Scripts

G

Thread Starter

Gavin Goldsworthy

I need to manipulate a string tag before showing it on the screen. I cannot find a function which loads a 8 bit character string so I am trying to do it as a raw data type using GetTagRaw() The compiler requires a byte pointer as a parameter type but does not recognize byte as a data type. Does anyone have an example using this function ??
 
S

Steve Snodgrass

The C function, GetTagChar("8BitTextTag"); will return the text value contained in the tag you can then use srtcat,sprintf, etc. to manipulate the string.
 
S

Shahid Waqas Chaudhry

You can use the WinCC Script to automate this task using some of the following functions: 1) Read the string tag using GetTagChar(Tag_Name) 2) The read string could be manipulated using one of the many standard C functions provided as a library. These can be found in Internal Functions -> c_bib -> string Some of them are: a) String concatenante b) String compare c) String Copy d) String Error e) and other String operation as listed in ANSI C specs As for the byte type, try writing BYTE as the data type. e.g: BYTE byte_variable; // BYTE is the data type and the byte_variable is the variable name Happy C-ing with WinCC :) Shahid
 
Top