1/14/2014 6:20 PM | |
Posts: 165 Rating: (2) |
Myuser must in very specific situations be able to shut down WinCC from the HMI. |
1/15/2014 2:25 AM | |
Joined: 11/26/2011 Last visit: 6/29/2023 Posts: 508 Rating: (22) |
Use this script in VBS action |
2/27/2014 11:10 AM | |
Joined: 12/12/2011 Last visit: 12/30/2020 Posts: 821 Rating: (39)
|
Hi, |
Grundkurs/Systemkurs WinCC V7: |
|
3/1/2014 8:04 AM | |
Joined: 10/31/2006 Last visit: 9/21/2022 Posts: 134 Rating: (33) |
To shutdown Windows you can do the following Dim objShell I would call this first before the WinCC shutdown command because I am not sure if you call the shutdown first wether this will still run. You can test this though. The -t 60 gives it 60 seconds before the shutdown starts. Hopefully this is enough time for WinCC to shutdown properly. If you use the -t or if the value is greater than 0 it assumes the -f option which forces the shutdown meaning all aplications will be forcably closed. -r means restart Please be careful with this and make sure there is enough time to shutdown WinCC properly because you can get unexpected results when forceably shutting WinCC even damaging the project to a state where it cannot be opened again. Shutdown Coammands No args Display help. This is the same as typing /?. |
3/1/2014 5:50 PM | |
Joined: 10/3/2010 Last visit: 3/14/2024 Posts: 1552 Rating: (188) |
Rather sooner than later, you risk destroying your project like this, you can tell upfront how long it'll take for WinCC to shutdown completely. One time it can be 60 seconds, the next time it might be 120 seconds. Dangerous way I think an dnot recommended. Try looking around to forum and FAQ's for a built-in c-function instead, you'll find examples that you might use safely: DMExitWinCCEx(DM_SDMODE_POWEROFF) |
B r g d s , |
|
This contribution was helpful to1 thankful Users |
3/3/2014 12:10 PM | |
Joined: 10/3/2010 Last visit: 3/14/2024 Posts: 1552 Rating: (188) |
Shutdown and reboot a PC without being certain that WinCC has been stopped and closed completely is in my opinion never acceptable. A stronger command is using "C:\Program Files\Siemens\WinCC\bin\Reset_WinCC.vbs" but it has an msgbox at the end, you might edit a copy of this script, remove the msgbox line and add the shutdown option from CromptonS Dim objShell Set objShell = CreateObject("WScript.Shell") objShell.Run "shutdown.exe -r -t 60" |
B r g d s , |
|
Follow us on