Siemens 317T PLC power off/on

As far as I know, the 300 PLCs treat a power cycle and Stop->Run transition the same in the program. I'm not sure how it would look in the diagnostic buffer.

However, you could potentially look at the behavior of the devices external to the PLC. Something like a managed Ethernet switch will usually have a longer boot up time than the PLC will. If they are controlled by the same circuit and the PLC is plugged directly into the switch, you could do a test in OB100 to see if the port on the PLC is active or not.

In a run->stop->Run transition, the ethernet connection will never be lost.

In a power cycle, the port might still be waiting for the partner to come online.

You'd have to test the power on behavior of your system to see which components to monitor for your test.
 
The cyclic overrun of encoders on the system is lost when the power to the CPU is lost. Therefore I want run a routine only when the power is lost and regained
 
Look in the tempstack of OB100

I think the variable #OB100_STRTUP is what you looking for

Code:
// Check if startup from power failure
      L     #OB100_STRTUP
      L     B#16#82
      ==I   
      =     StartupFromPowerFailure
Other possible values·
B#16#81:Manual warm restart·Switch/Pg
B#16#82:Automatic warm restart. Power failure
B#16#83:Request for manual hot restart
B#16#84:Request for automatic hot restart
B#16#85:Request for manual cold restart
B#16#86:Request for automatic cold restart
 
Sounds very promising.

You don't know by any chance if the bit is set even if the plc is: put into stop, powered down, powered up, put into start?

I don't have a plc to hand for testing right now

Thanks
 
Its in ob100 and its a byte not a bit. OB100 is only executed once just before the PLC goes into run after power on.

I have used this in the passed to check if the run/stop switch was used to trigger the stop and that worked out fine.
 

Similar Topics

G
I just ordered a 317T processor using 611U servo's. Has anyone out there used this??
Replies
11
Views
2,991
Hello everyone, I've had this issue for the last 2 days where I try to assign the profisafe address to an IO block (6ES7 146-6FF00-0AB0) but when...
Replies
4
Views
69
Hello, good morning, I have been having two problems with the Tia Portal software. The first is that I have installed it on my computer and...
Replies
5
Views
107
Hello to all, I'm just starting with using CodeSys. Immediately, I have noticed that Codesys doesn't use data blocks like for example S7 does...
Replies
11
Views
164
Hi, I'm setting up a modbus master on an S7-300. It seems to work in OB1 but not when I use it in OB35. Does anyone have any ideas why? Could...
Replies
10
Views
111
Back
Top Bottom