Assigning commands to objects

Introduction

Hello and welcome to a new guide on how to best use Movicon.NExT™.

In this technote, we will show you how to assign a command to a graphical object by using an example.

Example

In this example we will create a button assigned with a command to stop project runtime and another button to open a popup screen.

Screens creation

After having launched the Movicon.NExT development environment and created, or loaded, a project, proceed with creating a screen in the following way if not already done so:

Once the screen has been created, you can then change the project's properties by inserting the screen as the project's Main screen which will show when the project starts up. To do this:

Once you have finished configuring the project startup page, click on the Save All icon located on the toolbar at the top to save the project.

Now that the main screen has been created, you can continue with creating a popup screen as follows:

Select the Popup screen and open its Properties window to configure it in the following way:

Save the project by clicking on the Save All icon found in the Movicon.NExT editor toolbar.

Make sure that the Main screen is open, click on the Toolbox tab on the editor’s far right, next to the properties window, to open the Toolbox library offered by Movicon.NExT.
Go to the Buttons folder and open the Standard subfolder and select and drag the Standard Metro Style button onto the screen.
Insert the Close Runtime string in its Text property and adapt the button’s size to fit in all the string.
Select the button and click on the Commands tab at the bottom of the Movicon.NExT’s development environment window.
Once the Commands pane has opened, search for the System Commands from the list of commands available. Click to add it to the Commands List associated to the button.
Once the command has been added, change the Command Type property by click on the arrow on the far right and selecting the Quit Runtime Execution option from the drop-down menu which appears.
Re-open the Toolbox library and drag another Standard Metro Style button from the Buttons/Standard folder onto the Main screen.
Drag the Popup screen from the Screens section in the project tree onto the button you have just created. This operation will automatically assign the Screens command with the Normal Opening Command Type property.
Now, select the button you have just configured and open the Commands tab at the bottom of the editor.
Once opened, check that the Screens command has been included on the commands list associated to the button, and change the Normal opening Command Type to Open Non Modal Popup Screen using the drop-down menu which appears when clicking the arrow on the far right.

Save the project by clicking on the Save All icon on the Movicon.NExT Editor’s toolbar.

Test Runtime

Check to see if everything is working by clicking on the Start Runtime icon.
Clicking on the Popup button while in runtime should open the Popup screen in non modal mode, and clicking on the Close Runtime button should terminate project runtime.