Troubleshoot: Control Center producing an ‘There is already an instance running of service’ error

Scenario: You try to restart your Control Center application but Control Center only produces the error message in Figure 1.

code9
Figure 1: Control center error
  1. Open the Services application on your host server and check the status of the Control Center application – it should be status Stopping.
  2. Open Task Manager and select the Processes tab and view the CommunicationServer.exe process (see Figure 2) – This process needs to be killed.
  3. To kill this process, right-click on the process and select End Process.
  4. Start your application and it should run normally.
30
Figure 2: Task Manager process view

How to output all subsequent characters following a particular character in a string

Scenario: You have to output all the subsequent characters following the ‘-‘ character of a field value coming from a datastream however, the string length of the value can vary from 3 characters on-wards, i.e.  the value is never fixed.

    1. Open the process.
    2. Add the variable version of the field you wish to format.
    3. Right-click on the variable and select Edit Script…
    4. Insert the following code:

    $a = $lotnumber;

    //searches string of $a for ‘-‘ and gets a position number
    $b=stridx($a,”-“);

    //adds 1 to the ‘-‘ position number to get next position
    $c = num($b)+ 1;

    //gets substring starting at ‘next’ position
    $lotnumber = substr($lotnumber,$c);

    1. Click OK.

    Export, deploy and test!

    • If the field value is 1234-567 you will output 567
    • IF the field value is -123 you will output 123
    • If the field value is 34-4533345689 you will output 4533345689

How to output the final x number of characters in a variable-length string

Scenario: You have to output the final three characters of a field value coming from a datastream however, the string of the value can vary from 3 characters on-wards, i.e.  the value is never fixed.

    1. Open the process.
    2. Add the variable version of the field you wish to format.
    3. Right-click on the variable and select Edit Script…
    4. Insert the following code:

    //Places the length of the string into variable $a
    $a=strlen($1MWWBANO);

    // Subtracts 2 from the length
    $b = num($a) – 2;

    //Variable $1MWWBANO takes the substring of its value based on the subtracted //variable $b as the position and ‘3’ as the number of subsequent places that are //outputted
    $1MWWBANO = substr($1MWWBANO,$b,3);

    1. Click OK.

    Export, deploy and test!

    • If the field value is 1234567 you will output 567
    • IF the field value is 123 you will output 123
    • If the field value is 34-4533345689 you will output 689