Siemens Industry Online Support
Siemens AG
Entry type: FAQ, Entry ID: 39325, Entry date: 07/19/2004

Automatic Start of Programs with I/O Access in File"inittab"

  • Entry
  • Associated product(s)

Why does a user program with I/O access not start up correctly, when being started in "/etc/inittab"? However, it runs properly when being started manually from CLI.

It is not permitted to access process periphery or system ressources prior to the proper start-up of M7 and its arrival in RUN status.

Call the command "M7GetState()" within one loop, until the system status RUN has been reached, only then your start the application itself. 
If the RUN status has not been reached after some time, you can also cancel the program again.


#include <stdlib.h>
#include "m7api.h"
#include "rmapi.h"
void main()
if (M7InitAPI() != M7SUCCESS)
while (M7GetState() != M7STATE_RUN)
// Start of the user program

Security information
In order to protect plants, systems, machines and networks against cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art industrial security concept. Siemens’ products and solutions constitute one element of such a concept. For more information about industrial security, please visit
Support to the statistics
With this function the IDs found are listed according to number (format .txt).

Generate list
Copy URL
View this page in new design
mySupport Cockpit
Related links