Controlling the Program Order


Is there a command to stop/start strategies without having to open pac control and clicking on the stop/start buttons in debug mode?
I’m utilizing opto22 on a manufacturing assembly line. There are five machines communicating to one another via individual R1 snap pac controllers. Each machine has a unique strategy and IP address. The issue is that when one of the controllers loses power, the order of the programs changes and the operator has to manually open pac control > debug >stop/start in the order of machine 1> machine 2> machine 3> etc. for the 5 strategies running. Only when they are ran in the correct order will it not affect the communications.
My goal is to have a button on the hmi similar to “reset plc” that will do this procedure automatically.
What is your suggestion?


Hi Casey,

Welcome to the OptoForums! So, sounds like you have 5 R1s, and one (all?) of those is connected to some kind of HMI (PAC Display? groov?), is that correct?

There are a few ways for a PAC or HMI to:
a) detect that a PAC has lost power
b) restart/reboot the others

Do you have access to all the strategies?
Just curious: What’s causing this loss of power? (Machine shut off?)
Aside: Sounds like should possibly be part of one supervisory strategy…

Let’s start with those questions, and I can recommend the best way(s) to restart those machines based on your answers.



OptoMary, thank you or the quick response! Here are my answers:

  1. All of the R1s are connected to one HMI, though it is not utilizing PAC Display rather a third party software (WindowViewer).
  2. I have access to all of the strategies.
  3. The loss of power occurs when one machine needs maintenance and has to be safely locked out. Once the power is restored, it is required to restart the program order.


I am interested on how to:
a) detect that a PAC has lost power
b) restart/reboot the others
What section in the opto22 manuals are these answers located in?


Hi Casey,

Our memory map can do both of those things. The guide for that is here:

For example, using PAC Manager, you can see how long it’s been powered up (and compare that to a previous value, or see if it’s below a certain threshold). And you can also use PAC Manger/mem map writes to reboot a PAC, as shown below:

However, for your application since you have access to the strategies, I’d recommend doing something a little less brute force than a reboot like that. How many charts to your strategies have?

Also, does your HMI support Modbus? Because if it does, you could access these memory map addresses via Modbus.

But I’d recommend adding logic to your Powerup that says: “do I need to reboot myself?” (a button from the HMI) and then if it does, you can gracefully shut down whatever charts, perhaps make a log entry somewhere, etc. Do you see what I mean here?



I’m going to go the route of creating a block for “do I need to reboot myself” and I’ll make a script on the hmi to send the command in the order of machine 1, 2, 3 etc.
Thank you!