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 Fri Sep 20, 2019 9:36 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Tue Sep 03, 2019 12:04 pm 
Offline

Joined: Mon Nov 20, 2017 7:40 pm
Posts: 16
If its possible to start linux programs from
Quote:
SysProcess.SysProcess.ExecuteCommand2
function?
Simple command like
Code:
sudo reboot
is working but when I try to use program
Quote:
netcat
then nothing happen. Even when I create script with netcat command and I will run this script from codesys its not working. When I run this script from shell its working properly.
This is some codesys limitation or I am doing something wrong?
Somebody try to start any linux program from codesys?


Top
   
PostPosted: Wed Sep 04, 2019 9:45 am 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3451
Hi,
hm.. looks like a bug,
I see if I add the command to /etc/CODESYSControl_User.cfg:

[SysProcess]
Command.0=shutdown
Command.1=netcat

and start the runtime manually ( to have more debug info), we see that netcat is executed, anyway somehow the result is not delivered to the SysProcessCommand2 in the IEC code.
Seems a to be a bug.
Please add a bugreport with your application attached to the store -> my question -> bugreport

BR
Edwin


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


Top
   
PostPosted: Wed Sep 04, 2019 10:12 am 
Offline

Joined: Mon Nov 20, 2017 7:40 pm
Posts: 16
Thank you for your response.

How do you get this debug info?

Can You try command
Quote:
"echo message `date +%s` | nc -u -w 0 192.168.1.1 2000"

This should send UDP message "message `date +%s`" to 192.168.1.1 on port 2000.
In Your test program netcat was executed, but I cant send UDP message.
If somethisg is not clear feel free to ask.


Top
   
PostPosted: Thu Sep 05, 2019 7:49 am 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3451
Hi,
not sure what exactly you want to archive but I would recommend to send or receive UDP frames
that way:
viewtopic.php?t=6625#p13743

BR
Edwin


Top
   
PostPosted: Thu Sep 05, 2019 8:14 am 
Offline

Joined: Mon Nov 20, 2017 7:40 pm
Posts: 16
In Your test program netcat was executed but the result was not delivered to the SysProcessCommand2 in the IEC code.
Can You test again program netcat to for example send some UDP packet, it will be for shure that it was executed properly or not.
When I try command
Code:
"echo message `date +%s` | nc -u -w 0 192.168.1.1 2000"
UDP packet is not sended, probably netcat with this parameter is not executed.
Can You explain how to run this debug mode from previous post?

In CODESYSControl_User.cfg I have:
[SysProcess]
Command=AllowAll


Top
   
PostPosted: Fri Sep 06, 2019 8:12 am 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3451
Hi,
I think it is not allowed to combine commands / echo + netcat

stop the service by:
sudo /etc/init.d/codesyscontrol stop

start it manually by
cd /var/opt/codesys
sudo /opt/codesys/bin/codesyscontrol_armv6l_raspberry.bin -d /etc/CODESYSControl.cfg

Once again I would recommend to do this UDP sending stuff by netbase services library like in the link in the upper post.

BR
Edwin


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

All times are UTC+01:00


Who is online

Users browsing this forum: ThomasFick and 8 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