Run script .ctl from an graphical object event

Find and share HowTos to various installations / configurations!
2 posts • Page 1 of 1
ange.ogawin
Posts:18
Joined: Thu Mar 14, 2019 10:51 am

Run script .ctl from an graphical object event

Post by ange.ogawin »

Hi,
Is it possible to run a script located in script folder of WinCC OA project from an event of a graphical object, like "clicked" for a push button?
How?

Thank you.

leoknipp
Posts:2928
Joined: Tue Aug 24, 2010 7:28 pm

Re: Run script .ctl from an graphical object event

Post by leoknipp »

Yes it is possible to start a script which is located in the scripts folder with a system() command starting a WinCC OA CTRL Manager.
Another solution is to load the script into a string variable and call the function execScript() with the string variable as parameter.
For details please have a look at the WinCC OA Documentation.

Why do you want to start a script instead of defining the same code as function in a library and call the function?
Should the script run all the time or is it a script which runs and then stops when the execution is finished?

Best Regards
Leopold Knipp
Senior Support Specialist

2 posts • Page 1 of 1