Hi "Antrios"
I dont know if you know about the additional OB (Organization Blocks) that are provided for restart and cold start (I think they were OB100, OB101, OB102 - but this is just out of my head, better make sure). All the code you put in there will only be processed once, before the first cycle (OB1) starts.
Maybe this helps, but of course, a PLC will never "know" if the "power-on" condition was by accident or by manual action. Yo you will have to use some tricks to determine this event.
Do not hesitate to ask more detailed questions, I can look this up for you when I am in my office.
Mike