3/22/2022 2:44 PM | |
Joined: 5/13/2021 Last visit: 4/26/2022 Posts: 11 Rating: (0) |
Hi Murof, This is the only C-Script that is run in the SCADA, the rest of the scripts are all done in VBS. If I am not mistaken, the script should not crash, since the process "Script.exe" (in Task Manager) is still active (from what I read, this process is the one that runs the C-Scripts). I do not work with any array but I do read some string (even though I don't think that's the problem, since when the runtime of the SCADA is restarted it just works without any modification). I attach the code used. It prints a report as PDF if it's a Backup, or as PDF and as paper if it's a Current report (that's why there are up to two RPTJobPrint). Any feedback will be much appreaciated. Thanks, Mikel AttachmentC-Code_WinCC.txt (292 Downloads) |
3/28/2022 10:40 AM | |
Joined: 8/3/2009 Last visit: 5/23/2024 Posts: 12975 Rating: (1653) |
Hello MikeApp you are doing a memory access violation in your script using the char* (the Char* is only a pointer where the memory address is,but the memory where the pointer points to has to be allocated) You have to allocate the memory. (its only important in C Script in WinCC; in VBS the variant Datatype manages this for you) If you write in an unallocated memory area then this could be work for some time if you do not overwrite systemrelevant memory. But if so then the script context you are using will crash. Please have a look at these two FAQs for better understanding: https://support.industry.siemens.com/cs/ww/en/view/22727197 https://support.industry.siemens.com/cs/ww/en/view/7929092 (I think in the second FAQ is an example that expains exact your situation) Bye Murof |
Last edited by: Murof at: 03/28/2022 10:40:51If this Information really helps, you could use the Rate function |
|
This contribution was helpful to1 thankful Users |
Follow us on