Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched.
Close
Das einzige was ich noch nicht ganz weiss ist der Wert 'pszStdOut' und 'udiStdOutLen'
PROGRAMShutDownVAR  xStartProc    :BOOL;  stdout    :STRING(1000):='';    udiError    :UDINT;END_VAR
(* start an external process on target *)//ImportantentryinLINUX:  '/etc/CODESYSControl.cfg'//      //      [SysProcess]                    //      Command=AllowAllIFxStartProcTHEN  xStartProc:=FALSE;  SysProcessExecuteCommand2(pszCommand:='/home/pi/ShutDown.sh',                    pszStdOut:=stdout,                    udiStdOutLen:=SIZEOF(stdout),                    pResult:=ADR(udiError));END_IF
(*ShutDown.sh:\#!/bin/bashsudo shutdown -h now*)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2016-03-31
Originally created by: PI-Beginner
Hallo,
auch ein Interessanter Weg.
Hab es mir etwas einfacher gemacht und den Linuxbefehl direkt in eine Variable gepackt.:
command1:='shutdown -h 0';IFxExecuteSysPTHEN
  xExecuteSysP :=FALSE;
  SysProcess._(pszCommand:=command1, pszStdOut:=stdout, udiStdOutLen:=SIZEOF(stdout),pResult :=ADR(Result));END_IF
Die Rückgabe von 'pszStdOut' und 'udiStdOutLen' ist bei einem shutdown nicht wichtig. Ausser natürlich bei anderen Skripten die einen Wert zurückliefern.
Gruß
Jan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hallo,
Ich möchte gerne aus einer Webvisualisierung den Raspberry ausschalten (herrunterfahren).
Ist dies möglich ?
Funktioniert dann dieser Befehlssatz auch bei Windowssystemen ???
Gruß
Hi,
1) hier in der FAQ Section dieses Beispiel abändern und einen 'shutdown -h now' aufrufen:
http://forum.codesys.com/viewtopic.php? ... 699#p12711
2) ja das würde auch unter Windows gehen.
Grüße
Edwin
Hallo,
Habe es geschafft....
Das einzige was ich noch nicht ganz weiss ist der Wert 'pszStdOut' und 'udiStdOutLen'
Originally created by: PI-Beginner
Hallo,
auch ein Interessanter Weg.
Hab es mir etwas einfacher gemacht und den Linuxbefehl direkt in eine Variable gepackt.:
Die Rückgabe von 'pszStdOut' und 'udiStdOutLen' ist bei einem shutdown nicht wichtig. Ausser natürlich bei anderen Skripten die einen Wert zurückliefern.
Gruß
Jan
Perfekt.
Hab es auf dein smartes Programm abgeändert. TOP Danke.
Funktioniert "shutdown -h 0" auch bei Windows ???