Working with Set Background Var Process

Navigation:  How to Work with Processes > Working with the Variable Processes Group >

Working with Set Background Var Process

Previous pageReturn to chapter overviewNext page

 

Process Purpose

 

The "Set Background Variable" process assigns a value to background variables which are, ONLY, used in a background procedure context, meaning, they store the values to be shared between the background and the foreground.

This process is available within a background procedure so you can assign values to output background variables or to another type of unspecified background variable.

 

The purpose of background variables is to exchange data between background procedures and the running foreground program so this process is also available in the foreground, meaning, the running program can assign/update background variables as well (ex: the foreground program can assign a command to a background variable so it is executed by the selected background procedure once it detects an update using the "Wait for Variable Update" process).

 

This process is only executed if the selected background procedure is running.

If the targeted background procedure is restarted after this process is executed, the assigned values are lost.

You can assign values to up to 40 variables with a single "Variable Assign" process.

 

Check the Background Procedure Examples provided in the topic "How to Work with Background Procedures".

 

When developing a project with background procedures, be sure to define which entity is in charge of the background variables' update, since you can update these variables within the background procedure but also have value updates provided by the program running in the foreground.

 

Due to the nature/purpose of the background variables (data exchange between the foreground and the background), we recommend you let the foreground program handle the generic background variable updates - use the "Set Background Var" process in the foreground program and let the background procedure handle the output background variable updates.

If you need extra variables to comply with background procedure business logic, you should use program variables to store/update those values instead of background variables.

 

 

When you add a process, you are required to define its settings. This occurs in the process's properties window which is displayed automatically after having added the "Set Background Variable" process.

If any subsequent edition is required, double-click the process to open its properties window and enter the necessary modifications.

 

 

Fill in the following options:

 

Variables to Assign

Store into Variable column

Click and select the background variable that receives the assigned value. See To Select/Create a Variable.

Data column

Enter a value OR  click to select the variable that contains the value to be assigned. See Variable Usage.

 

Use the editing icons to the right of the table to move the rows up and down and to delete or add more rows.

 

If required, click (on the upper right corner) and enter info about this process in the resulting text box. These notes will be displayed in the corresponding "Actions" tab or "Process" window (in the "Notes" field) and in the "Developer Report".

 

After filling in the required options, click to conclude or to abort the operation.

The added process is displayed in the corresponding "Actions" tab or "Process" window.

 

 

Use the right-click in MCL-Designer's input boxes to access some related options as well as the general "Cut", "Copy"; "Paste"; "Search" actions (active/inactive according to the current context).

Ex: If you right-click the "Variable" input box (included in a "Conversion's" properties window), you are provided with general editing/search actions and other more specific options such as "Variable Select" (see "Variable Select"); "Variable Insert" (see "Variable Insert"); "Insert Special Character" (see To Insert Special Characters into a Control's Text Input Field) and "Localization Select" (see Localization List).

If you right-click another input box, it may provide other possibilities.