Difference between revisions of "NVGate Macro"

Jump to navigation Jump to search
68 bytes removed ,  10:06, 7 January 2022
Line 81: Line 81:
- stop the "record on line".<br>
- stop the "record on line".<br>


===Parameters of the Macros===
===Macros group===


<Youtube>https://www.youtube.com/watch?v=6IIKsHwZi2Y</Youtube>
<Youtube>https://www.youtube.com/watch?v=6IIKsHwZi2Y</Youtube>


====Macros Tab====
The macros group is used to create/manage macros that perform automatically recurrent operations.
The macro Tab is used to create/manage macros that perform automatically recurrent operations.


[[Image:Reports_Tools_Ribbons_58.png|200px|none]]
[[Image:Reports_Tools_Ribbons_58.png|200px|none]]
Line 126: Line 125:
|}
|}


Note: Click on the record button to stop recording the macro. The macro is saved with the name specified in the "Record" dialog.
''Note: Click on the record button to stop recording the macro. The macro is saved with the name specified in the "Record" dialog.''




Line 141: Line 140:
|}<br clear="all">
|}<br clear="all">


=====Macros Manager=====
====Macros Manager====


Display the macros list and the associated hot-keys. A hot-key is a shortcut to run the macro.<br><br>
Display the macros list and the associated hot-keys. A hot-key is a shortcut to run the macro.<br><br>
Line 147: Line 146:
[[Image:Reports_Tools_Ribbons_60.png|300px|none]]
[[Image:Reports_Tools_Ribbons_60.png|300px|none]]


Note that the three first hot keys are automatically assigned in the "Macro" menu from the OR38/OR36 Front Panel, labeled as "0", "1" and "2".
''Note: the three first hot keys are automatically assigned in the "Macro" menu from the OR38/OR36 Front Panel, labeled as "0", "1" and "2".''


* '''Edit: '''Edits the macro selected. Available if no macro is being edited, recorded, or executed.
* '''Edit: '''Edits the macro selected. Available if no macro is being edited, recorded, or executed.
Line 232: Line 231:




=====Algorithmic commands=====
====Algorithmic commands====
======Affectation======
=====Affectation=====
   
   


Line 240: Line 239:
Sets a value to a parameter. The new value can be defined by a parameter.
Sets a value to a parameter. The new value can be defined by a parameter.


======Break======
=====Break=====


[[Image:macro_break.png|border|500px]]
[[Image:macro_break.png|border|500px]]
Line 246: Line 245:
Used to exit a loop. It can be used inside a "for" loop to stop before the end of the iteration, inside a "while" loop to exit the loop without fulfilling the condition. It is the only way to exit a "Periodic loop".
Used to exit a loop. It can be used inside a "for" loop to stop before the end of the iteration, inside a "while" loop to exit the loop without fulfilling the condition. It is the only way to exit a "Periodic loop".


======Call Macro======
=====Call Macro=====
Calls another macro.
Calls another macro.


Line 253: Line 252:
The only parameter is the name of the macro that is called. The body of the command is divided into three steps in order to exchange parameters between the calling macro and the called macro.
The only parameter is the name of the macro that is called. The body of the command is divided into three steps in order to exchange parameters between the calling macro and the called macro.


======Comment======
=====Comment=====
The purpose of this command is to facilitate understanding of the macro. It is used to add a comment line to the body of the macro.
The purpose of this command is to facilitate understanding of the macro. It is used to add a comment line to the body of the macro.


Line 260: Line 259:
The only parameter is the comment.
The only parameter is the comment.


======"For" loop======
====="For" loop=====


[[Image:macro_for_loop.png|border|500px]]
[[Image:macro_for_loop.png|border|500px]]
Line 266: Line 265:
Runs a set of commands several times. The number of iterations can be defined by an integer value or by an integer parameter.
Runs a set of commands several times. The number of iterations can be defined by an integer value or by an integer parameter.


======Get Current Time======
=====Get Current Time=====
This command retrieves the time and stores it in a string parameter. This string may be use to send a trace, to create a measurement name...
This command retrieves the time and stores it in a string parameter. This string may be use to send a trace, to create a measurement name...


Line 273: Line 272:
The "Time format" specifies the way in which the time should be written. "Date", "Time" and "Date and Time" use the regional settings of the host computer while the three other formats are fixed formats.
The "Time format" specifies the way in which the time should be written. "Date", "Time" and "Date and Time" use the regional settings of the host computer while the three other formats are fixed formats.


======Get Macro Parameter======
=====Get Macro Parameter=====
Gets the value of a parameter of a called macro. This command must be inserted between the "Exit macro" and the "Execute macro" commands, inside the body of the "Call Macro" command.
Gets the value of a parameter of a called macro. This command must be inserted between the "Exit macro" and the "Execute macro" commands, inside the body of the "Call Macro" command.


Line 286: Line 285:
In this example, the command gets the value of the parameter nNumberOfLoop of the macro CheckInput and sets this value to the parameter nCount of the calling macro.
In this example, the command gets the value of the parameter nNumberOfLoop of the macro CheckInput and sets this value to the parameter nCount of the calling macro.


======Group======
=====Group=====
The purpose of this command is to facilitate understanding of the macro. It creates a branch that contains a set of instructions. It has no effect during execution, but it helps to organize the macro and facilitates copying and pasting, since all commands are copied at once.
The purpose of this command is to facilitate understanding of the macro. It creates a branch that contains a set of instructions. It has no effect during execution, but it helps to organize the macro and facilitates copying and pasting, since all commands are copied at once.


Line 293: Line 292:
[[Image:Reports_Tools_Ribbons_89.png|border|none]]
[[Image:Reports_Tools_Ribbons_89.png|border|none]]


======If…Then…======
=====If…Then…=====


[[Image:macro_if_then.png|border|500px]]
[[Image:macro_if_then.png|border|500px]]
Line 524: Line 523:
|}<br clear="all">
|}<br clear="all">


======Incrementation======
=====Incrementation=====


[[Image:macro_incrementation.png|border|500px]]
[[Image:macro_incrementation.png|border|500px]]
Line 534: Line 533:
Available if one or more integer or float parameter is defined.
Available if one or more integer or float parameter is defined.


======Make String======
=====Make String=====
Command used to create a string.
Command used to create a string.


Line 545: Line 544:
"Add to existing string" is a Boolean parameter that indicates if the second parameter replaces or is added to first one. If the value is false, the command behaves like the Affectation command
"Add to existing string" is a Boolean parameter that indicates if the second parameter replaces or is added to first one. If the value is false, the command behaves like the Affectation command


======Message box======
=====Message box=====


[[Image:macro_message_box.png|border|500px]]
[[Image:macro_message_box.png|border|500px]]
Line 553: Line 552:
When the command is executed, the box is displayed. A click on one of the buttons closes the message box and sets the Boolean parameter value.
When the command is executed, the box is displayed. A click on one of the buttons closes the message box and sets the Boolean parameter value.


======Periodic loop======
=====Periodic loop=====


[[Image:macro_periodic_loop.png|border|500px]]
[[Image:macro_periodic_loop.png|border|500px]]
Line 559: Line 558:
Runs a set of commands at each interval of time specified in the "Time lap" parameter. The time lap is specified in seconds, the "Break" command must be used to exit the loop.
Runs a set of commands at each interval of time specified in the "Time lap" parameter. The time lap is specified in seconds, the "Break" command must be used to exit the loop.


======Set Macro parameter======
=====Set Macro parameter=====
Sets the parameter value of a called macro. This command must be inserted between the "Open macro" and the "Execute macro" commands, inside the body of the "Call Macro" command.
Sets the parameter value of a called macro. This command must be inserted between the "Open macro" and the "Execute macro" commands, inside the body of the "Call Macro" command.


Line 580: Line 579:
The message generated in the top of the dialog box can be defined in the "command properties". A control is used to edit the parameter value. A click on the OK button changes the parameter value, and closes the dialog box. A click on the Cancel button closes the dialog box without changing parameter value.
The message generated in the top of the dialog box can be defined in the "command properties". A control is used to edit the parameter value. A click on the OK button changes the parameter value, and closes the dialog box. A click on the Cancel button closes the dialog box without changing parameter value.


======Set Parameter Value======
=====Set Parameter Value=====


[[Image:macro_set_parameter_value.png|border|500px]]
[[Image:macro_set_parameter_value.png|border|500px]]


======Trace======
=====Trace=====
Command used to send a message in the log window.
Command used to send a message in the log window.


Line 593: Line 592:
"Play sound" is used to play a sound when the message is sent. The host computer must have speakers connected.
"Play sound" is used to play a sound when the message is sent. The host computer must have speakers connected.


======Wait======
=====Wait=====


[[Image:macro_wait.png|border|500px]]
[[Image:macro_wait.png|border|500px]]
Line 599: Line 598:
Waits for a given time. The wait time is specified in seconds.
Waits for a given time. The wait time is specified in seconds.


======"While" loop======
====="While" loop=====


[[Image:macro_while.png|border|500px]]
[[Image:macro_while.png|border|500px]]
Line 833: Line 832:
|}<br clear="all">
|}<br clear="all">


=====Editor contextual menu=====
====Editor contextual menu====
======Setting properties======
=====Setting properties=====
* '''Cut: '''Removes the command selected and copies it to the clipboard.
* '''Cut: '''Removes the command selected and copies it to the clipboard.
* '''Copy: '''Copies the command selected in the clipboard.
* '''Copy: '''Copies the command selected in the clipboard.

Navigation menu