To specify set command parameters, first, please select the batch in the corresponding batch list. You will see its properties in the right pane of the dialog.
Tag Type
Select a Tag Type to write values to the PLC.
Tag – you can write the tag straight into the Tag field; you can also click on the ‘…’ button to prompt the tag database.
Connection – set the connection to the PLC. Connection parameter is the same for all set commands in the batch.
Title – Set title for this set command. If you require a response from the user in the form of dialogue, the title of the dialogue will be this title.
Use the translation button to provide a translation for this set command.
Lock Enable – check this option if you want to use On Touch Lock for this element.
Log – check this checkbox to log this user action. The user action will be logged with the provided message.
Memory Type
Select a Memory Type to set View Script Variables.
Constants – If you select contacts you will be able to select out of constants in myDESIGNER such as “dateTo”, “dateFrom”, “dateRange”
Active Recipe – Active recipe option will let you select out of Recipe variable it’s usage is described in Recipe section
Custom – Will let you specify the custom variable
Title – Set title for this set command. If you require a response from the user in the form of dialogue, the title of the dialogue will be this title.
Use translation button to provide a translation for this set command.
Lock Enable – check this option if you want to use On Touch Lock for this element.
Log – set this checkbox to log this user action. The user action will be logged with the provided message.
SQL Type
Select SQL to write values to the database:
Connection – set connection to the database. Connection parameters are the same for all set commands in the batch.
SQL – specify SQL that will be used to write values to the PLC. The SQL parameter is the same for all set commands in the batch. When the batch is processed, all values from the batch are inserted into the specified SQL. The top set command in the batch will replace #1# keyword in the SQL; the second set command in the batch will replace #2# keyword, and so on.
Title – Set title for this set command. If you require a response from the user in the form of dialog, the title of the dialog will be this title.
Use the translation button to provide a translation for this set command.
Lock Enable – check this option if you want to use On Touch Lock for this element.
Log – check this checkbox to log this user action. The user action will be logged with the provided message.
Multiple Values Write Example
The following example will explain how to write multiple values into the SQL database with one batch set command. We will ask the user to enter two values which will be then written to the database using the SQL command.
b. Create a connection to your database.
2. In your view, navigate to the button element and in Properties -> Commands, select Write/Set Command.
3. Now in the set dialog, create two items in one batch like in the following picture:
4. Now test your project. If you click on the button, the user will be asked twice to enter the value. Once the user has entered both values, mySCADA will execute the SQL. #1# will be replaced with the first value; #2# will be replaced with the second value.
Script Type
This very useful feature allows you to oversee, set up, and enrich the whole Write/Set command functionality from the scripting level (i.e. you can freely create and add your own new arbitrary functionalities). When the set command is processed, the corresponding View Script is called.
For a detailed description of how View Scripts work, please see section View Scripts.