CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Wed Apr 24, 2019 7:48 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Turn off raspberry
PostPosted: Fri May 18, 2018 11:09 am 
Offline

Joined: Tue Apr 10, 2018 7:53 am
Posts: 11
Good morning,

I'm pretty new to codesys and the programming side of raspberry.


I'm trying to power off my raspberry using my HMI.
I've found some other examples, but I couldnt get them to work:

viewtopic.php?t=8638 - Keep getting syntax errors
viewtopic.php?f=21&t=5714 - No errors, it just doesnt power off

I'm using ladder logic to program the raspberry.

Can somebody explain how to do it?


Top
   
 Post subject: Re: Turn off raspberry
PostPosted: Sun May 20, 2018 9:52 pm 
Offline

Joined: Mon Nov 20, 2017 7:40 pm
Posts: 11
http://forum.codesys.com/viewtopic.php?f=23&t=6247&p=12699#p12699

I use this:
Code:
PROGRAM power
VAR
   Result: UDINT;
END_VAR

IF GlobalVariables.resetFromVISU THEN
   GlobalVariables.power_led := FALSE;
   _ (pszComand:='sudo reboot' , pResult:= ADR(Result));
END_IF
IF GlobalVariables.poweroffFromVISU THEN
   GlobalVariables.power_led := FALSE;
   _ (pszComand:='sudo poweroff' , pResult:= ADR(Result));
END_IF



and
Code:
[SysProcess]
Command=AllowAll

in CODESYSControl_User.cfg file
I hope this will help.

When I write in code syntax _SysProcess_Execute_Command_ after submit I see only "_" why?


You do not have the required permissions to view the files attached to this post.


Top
   
 Post subject: Re: Turn off raspberry
PostPosted: Tue May 22, 2018 1:47 pm 
Offline

Joined: Tue Apr 10, 2018 7:53 am
Posts: 11
pawel3410 wrote:
http://forum.codesys.com/viewtopic.php?f=23&t=6247&p=12699#p12699

I use this:
Code:
PROGRAM power
VAR
   Result: UDINT;
END_VAR

IF GlobalVariables.resetFromVISU THEN
   GlobalVariables.power_led := FALSE;
   _ (pszComand:='sudo reboot' , pResult:= ADR(Result));
END_IF
IF GlobalVariables.poweroffFromVISU THEN
   GlobalVariables.power_led := FALSE;
   _ (pszComand:='sudo poweroff' , pResult:= ADR(Result));
END_IF



and
Code:
[SysProcess]
Command=AllowAll

in CODESYSControl_User.cfg file
I hope this will help.

When I write in code syntax _SysProcess_Execute_Command_ after submit I see only "_" why?


I've got it all working now.

Thank you for your help!


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 3 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited