12/4/2008 3:30 PM | |
Posts: 31 Rating:
|
Hi, everyone! First I'd like to say: Thank you all for your posts. I have got many good answers to my questions by reading this forum. To my problem: I have a problem with faceplates and can't find any solutions just by searching the forum. The problem is that the C-script I have written makes WinCC really unstable! I get a script error allmost evert time I try to run RunTime. If the error does not occur during loading it comes (sometimes) when I try to execute the script (by pushing a button, changing an I/O-field etc.). What I am trying to say is that sometimes the script error occurs and sometimes it does not. Everything seems to be working fine (the color change) as long as the script error does not appear. After it has occured everything stops and I can no longer change the tag (by writing in the I/O field). The script it set to change the color of a faceplate to indicate different statuses in a tag (DWord). The faceplate contains a circle, a rectangle and a picture. The script is placed outside the faceplate in the custom properties (UserDefined2) picture and the trigger is the tag I'm displaying (upon change). Is there any way to go around this error or any way to fix it? Thanks in advance!
AttachmentDiagnose.zip (368 Downloads) |
Last edited by: bugmenot at: 1/19/2009 8:02 AMLast edited by: bugmenot at: 1/12/2009 2:02 PMLast edited by: bugmenot at: 12/5/2008 1:21 PMAdded diagnosisfolder (zipped) |
|
This contribution was helpful to
1 thankful Users |
12/10/2008 10:02 AM | |
Joined: 9/27/2007 Last visit: 12/18/2020 Posts: 993 Rating:
|
Hello bugmenot I think you create with your scripts one or more memory overflows (like strcat). In your UserDefined-Script line 19 you use strcat, please use strncat. other things i could not find. You should create outputs (printf) to contain the error(s). regards cumulus |
Learn more about visualization - visit the HMI courses of Siemens AG! |
|
1/7/2009 5:03 PM | |
Joined: 9/27/2007 Last visit: 12/18/2020 Posts: 993 Rating:
|
Hi bugmenot Your printf using is wrong. This comand should look like that: printf ("ToolTipPrefix: %s TAG: %sFarge: %s \r\n",ToolTipPrefix,TAG,Farge); %s= the place were the variables are insert. \r\n= first position in new line. a memory overflow you get wenn the memory-space of the tag not big enouth. Thats possibel when you copy, add ect. strings. Also the printf-function can case memory overflows. imagination. for all variables, you define, it will be space reserved in the RAM. If you overwritethe tag with a bigger size, you overwrite thespace behind the reserved space. In my experience, mostly that damage the skript.exe . But notallways alone. regards cumulus |
Learn more about visualization - visit the HMI courses of Siemens AG! |
|
Follow us on