ID: kb000034.htm
Question:

How can dependencies be set in the Movicon Service?

Answer:

The Movicon service dependency configuration  is executed like all other Windows services. Above all, the dependency configuration permits you to establish a list of system components or other services that Movicon as service will depend upon when put into execution. The operating system will not startup Movicon as Service until all the system components or services it depends on have been started up first. When starting up a Movicon project as service involving the use of programs or communication cards managed by other system services (i.e. SQL Server, Applicom cards, etc.)for example, it is essential that you set the list of these components in the Movicon Service depend-on list so that they can to be started up before Movicon is.

In order to set the desired dependencies you will need to add the specific dependency services in the appropriate Windows registry key. Before doing this you must first install Movicon as Windows Service. This is done by clicking on the "Install this project as Windows service" command which is made available by right clicking on the project name within the Movicon "Project Explorer" window:

 

 

Once the project has been installed as service, 'Service' within brackets will appear written at the side after the project name. The "MOVICON" service can also be found in the Windows Service window when opened from the Control Panel-Administrative Tools-Services.

The dependency configuration of the service just installed requires you to use the Windows configuration registry editor. This tool can be launched by entering the "RegEdit" command from the Windows command line.

 

CAUTION! The incorrect use of the Windows Registry editor might cause serious problems requiring you to reinstall Windows. Microsoft cannot guarantee remedies for problems caused by incorrect Windows Registry editor use. It is therefore advised to make a backup copy of the Windows Registry before using its editor.

 

Below are step-by-step instructions on how to insert the "RPC (Remote Procedure Call)" and "SQL Server (SQL2008)" components as Movicon service dependencies. These two components have been used as examples only and can be substituted with any other operating system component.

 

  1. Select the "Run" command from the Windows application bar's "Start" menu.

  2. Type in the "RegEdit" command and press the "OK" button.

 

 

  1. The Windows configuration registry editor will startup displaying a window divided into two panes.  The pane on the left displays a well organized tree structure with different levels, subdivided by main keys, keys and sub-keys, while the pane on the right displays the values for each key being "string" (REG_SZ), "binary" (REG_BINARY), "DWORD" (REG_DWORD), "multi string" (REG_MULTI_SZ) or "expandable string" (REG_EXPAND_SZ) types.

  2. To insert service dependencies, in this case with Movicon as Service, you will need to insert a new "multi string" value type within the key situated in the following path if not already done so:

    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MOVICON]

    Search for the above path in the editor's left pane in order to insert a new value in the right pane.

 

 

  1. Right click on the right side of the window and select the "New->Multistring value" command from the menu which appears. At this point the "REG_MULTI_SZ" type "New valore #1" will be added. Change the new value's name to  "DependOnService".

  2. All that remains left is to insert the list of system components, desired as Movicon service dependencies, in this new value. This is done by double clicking on the  "DependOnService" value to open a dialog window through which the list of components can be inserted.  In our example we have inserted the "RpcSs" and "MSSQL$SQL2008" strings but obviously this list will differ based on your own specific needs.

 

 

  1. The name of a service usually coincides with the text displayed in the "Service Name" item belonging to the "General" property group in the service's property window. When double clicking on a Service name from the Windows Services list, accessed from the Control Panel-Administrative Tools-Services, the relating property window will open.

 

 

However, this may not be the case for all the services listed and therefore always check whether the "Service Name" field coincides with that one actually used by the operating system by using the appropriate Windows command to view the list of tasks currently run with their relating service listed in a separate column. This command is called "TaskList /SVC" and can be executed from the Windows dos command window (execute the cmd command to open the dos window).  When executing  the "TaskList /SVC" command a list showing all the tasks being run in the computer will display indicating also the name of the service being used. The name which represents the service is highlighted in red in the image below.

 

 

 

  1. After the dependency services have been inserted in the "DependOnService" registry key, the Windows registry editor can then be closed and will be automatically saved by the system. When opening the Movicon Service property window and selecting the "Dependencies" Tab, the two services that have just been inserted should now appear on the list.

 

 

 

References:

Additional query words:

Services, Dependency, DependOnService