×
Siemens Industry Online Support
Siemens AG
Entry type: FAQ, Entry ID: 39325, Entry date: 07/19/2004
(0)
Rate

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

  • Entry
  • Associated product(s)

QUESTION:  
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.

ANSWER:
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.

Remedy:
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.

Example:

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



Support to the statistics
With this function the IDs found are listed according to number (format .txt).

Generate list
Copy URL
Display page in new design
mySupport Cockpit