Start/Stop CodesysControlService.exe from command prompt

AlfredoQuintero

Lifetime Supporting Member
Join Date
Feb 2015
Location
Yokohama
Posts
1,544
Hello.
I need to be able to put CodesysControlService.exe (Windows) in stop mode from the Codesys PLC application "itself". I have searched in Codesys documentation and forums but cannot find any examples.
I do not need to kill CodesysControlService.exe, rather make it go into STOP mode. With the "SysProcess_ExecuteCommand()" function I have been able to start other Windows application so I was wondering whether using this function and using the string below as an argument, whether there is a switch that would set the PLC application into stop.
↓↓↓↓↓↓ argument for function (minus switch) ↓↓↓↓↓↓
"C:\Program Files\CODESYS 3.5.17.10\GatewayPLC\CODESYSControlService.exe" -(Some kind of swtich)

(note: the actual function name does not have underscore, but the "s*x" (capital 'E' instead of '*') text gets automatically replaced by "***" when publishing.)

Of course if the application needs to be restarted, the only way to do it would be through the task bar. I hope the above question does not sound too weird. Thanks for reading and if you have any hint it will be most welcome.
 
I actually wrote code to place the plc in stop from an hmi. (I believe that the hmi just toggles a bit that runs the code in the plc).
I'm not sure if this is what you are looking for. But if it is, I'll post it when I get to work tomorrow.
 
I'm using a Wago 750-862
There is a built in function called SysLibPlcCtrl.lib
My hmi sets a tag called bStopPlc
In the plc, my code is:
Code:
IF bStopPlc THEN
	SysStopPlcProgram(bDummy);
	bStopPlc:= FALSE;
END_IF;
 
Thank you very much for this information. I am able to find documentation for this library, but I cannot find the library itself. It is not posted in the Codesys Store (or I was unable to find it). Can you please tell me where you got the library from?


Thanks again
 
By the way, all the documents I managed to find about this library seem to indicate that this library was available in Codesys v2.3. I am using v3.5. Are you using 2.3 or 3.5?
 
Thank you very much for this information. I am able to find documentation for this library, but I cannot find the library itself. It is not posted in the Codesys Store (or I was unable to find it). Can you please tell me where you got the library from?


Thanks again

I actually searched my email. I found the email where tech support told me about the library, but no link.
I would have to search for it on the web site.
I'd contact tech support for it.
 
Research results point to having two applications running on the same device and using one to retrieve information from the other or control it, including stopping the application.


Link1

Link2

Link3

Link4


+1 for kalabdel, if you want to stop the application but leave the PLC on.


Otherwise you have:
Code:
net start  “CODESYS Control Win V3”
net stop  “CODESYS Control Win V3”
or for 64 bit:
Code:
net start “CODESYS Control Win V3 - x64"
net stop “CODESYS Control Win V3 - x64"
 
Code:
net start “CODESYS Control Win V3 - x64"
net stop “CODESYS Control Win V3 - x64"
Hello AustralIan. Thanks very muhc for this information.
One quick additional question. I have experience with net start and net stop on other use cases, and in that case one needs to call these commands in elevated mode.
Do you think it would be possible to issue net stop “CODESYS Control Win V3 - x64" from the PLC application using the "SysProcess_ExecuteCommand()" system function?
 
Hello AustralIan:
You came to my rescue again. I was able to write a program that can stop itself, just like I needed. Thanks a lot, again and again, over and over. Wish you a happy weekend. I really needed to crack this. Below I illustrate what I did, not for you because I know you already understand this, but for somebody else who may find a similar requirement.

20210924_PLC_StopFromProgram.jpg
 

Similar Topics

Hello I am trying to make a program work with a sqo instruction .The process has 5 steps ,and a starting step of zero.There should be 8 sec...
Replies
17
Views
1,033
Good morning to everyone on the forum and happy new year. I'm trying to use the following functions in sysmac studio, because I need to enable one...
Replies
1
Views
319
Good Morning , I would like to start a Powerflex 525 with a N.O. Start Pushbutton , and when the N.O. Start Pushbutton is released I would...
Replies
3
Views
1,617
Hello, I am trying to detect when the PLC changes from STOP to START mode. This can be considered an edge case scenario, but I would to analyze...
Replies
4
Views
1,547
Hello Everyone! It has been a while since I used the method of drawing a state diagram, converting that to Boolean algebra, and translating that...
Replies
13
Views
2,958
Back
Top Bottom