Editing a macro
You must be an administrator or technician to edit a macro.
Editing options and macro version control 
The macro library stores the latest version of a macro that has been edited in the macro editor tab. You can use different versions of a given macro in your protocols, but the different versions reside only in the protocols.
You can edit the VWorks macros in the following ways:
Editing a macro from the macro library in the macro editor tab. Replaces the version of the same name in the macro library, incrementing the version number by 1.
Later, if you open a protocol that has an earlier macro version than the macro in the macro library, the following Macro Change History dialog box opens. You can choose whether to update the macros in the protocol to match the definition in the macro library.
 
Editing a macro directly in the protocol tab. Updates the macro in the protocol only. Macros in the macro library remain unchanged. Instead, you have the following options:
Keep a derivative of the definition from the macro library in the selected protocol.
Replace the modified instances in the protocol with the definition from the macro library.
Add the modified definition under a new name in the macro library.
The software does not maintain a change history of the macros that are edited in the protocol tab. However, you can easily update all instances of a macro in a protocol to match the version of the same name in the macro library. See Updating instances of a macro to match the version in the macro library.
Editing a macro from the library in the macro editor tab 
To edit a macro from the library in the macro editor tab:
1 In the Available Macros tab, right-click the macro icon, and then choose Edit from the shortcut menu.
A macro editor tab opens in protocol area and displays the contents of the macro as the following figure shows.
Figure Macro editor tab
 
2 To add or delete a task:
Add a task. Either drag the task icon from the Available Tasks area to the macro editor tab, or double-click the task icon in the Available Tasks area to add the task to the macro editor tab.
Delete a task. In the macro editor tab, right-click the task icon, and then choose Delete from the shortcut menu.
Change a task’s parameter values. Click the task icon in the macro editor tab. In the Task Parameters area, edit the task parameters as you typically would when creating a protocol.
Associate a custom icon with the macro. See Associating a custom icon with the macro.
Associate custom parameters with the macro. See Adding parameter variables and scripting to a macro.
3 Choose File > Save. The Macro Change Notes dialog box opens:
 
4 Type a description of your edits, and then click OK.
Later, if you open a protocol containing a different version of this macro, the software displays this change history for reference.
5 VWorks Plus only. If an audit trail is being logged for the macro library, the Audit Comment dialog box opens. Select or type a reason for the change, and then click OK.
6 When the message appears, asking if you want to update the macro in the protocol:
Click Yes to update all instances of the macro with the same name in the specified protocol, regardless of version number. The software increments the macro version number by 1 in the macro library.
Click No to increment the macro version number by 1 in the macro library only. Any previous versions of the macro in the protocol with the same macro name remain in the protocol intact.
If any unopened protocols also contain the previous version of the macro, you have the option to update the macros when you open each protocol.
Associating a custom icon with the macro 
To associate a custom icon with the macro:
1 Ensure that the image file (.bmp, .jpg, or .gif) has been imported into VWorks file storage. For details, see Importing and exporting miscellaneous files.
2 In the macro editor tab or protocol area, right-click the macro icon, and then choose Add Custom Icon from the shortcut menu. The Edit Macro Icon dialog box opens.
 
3 In the Edit Macro Icon dialog box, click the button, the Open File dialog box opens.
4 In the Open File dialog box, select the image file, and then click Open.
 
5 In the Edit Macro Icon dialog box, click OK. The selected image replaces the macro icon in the macro editor tab.
Figure Macro before (top) and after (bottom) adding custom icon in macro editor tab
 
Editing a macro directly in the protocol tab 
Macros in the macro library remain unchanged when you edit an instance of a macro in the protocol.
To edit a macro in the protocol tab:
1 In the protocol, expand the macro icon so that you can view the macro task contents.
2 Edit the tasks as desired:
Add a task. Drag the task icon from the Available Tasks area to the macro in the protocol, or double-click the task icon in the Available Tasks area.
Alternatively, you can copy a task icon from elsewhere in the protocol. To do this, right-click the task icon, and then choose Copy. Click the target location in the macro, right-click, and then choose Paste.
Change task parameter values. Click the task icon. Edit the values in the Task Parameters area as you typically would when creating a protocol.
Delete a task. Right-click the task icon, and then choose Delete from the shortcut menu.
Associate a custom icon with the macro. See Associating a custom icon with the macro.
Add custom parameters and scripting to the macro. See Adding parameter variables and scripting to a macro.
3 Do one of the following:
To rename the edited macro and add it to the macro library. In the protocol, right-click the icon of the edited macro, and then choose Save macro as. The Add to Macro Library dialog box opens.
To keep the edited macro definition in the protocol only. Choose File > Save. The changes are applied to all instances in the protocol that have the same name and version number. The name of the edited instance changes to “macro_name Derived from Version n”.
Note: If you subsequently add an additional macro of the same name from the macro library to this protocol, the Add macro to protocol dialog box opens. You can choose which definition to use for all the macros in the protocol that have the same name.
 
Updating instances of a macro to match the version in the macro library 
If a protocol contains a derivative version of a macro or a different version than one of the same name in the macro library, you can choose to update all instances in the open protocol to the definition in the macro library or to keep the definition from the protocol.
To update a macro in the protocol tab to the current version in the macro library:
In the protocol tab, right-click the macro icon, and then choose one of the following:
Update this macro. Replaces the selected macro instance in the open protocol with the definition from the macro library.
Update all revisions of this macro. Replaces all macro instances of the same name with the definition from the macro library, regardless of the version number of the other macro instances in the protocol.
Renaming a macro in the macro library 
 
*Renaming a macro in the macro library removes any association to the macro instances of the former name that are in the protocols.
 
To rename a macro in the macro library:
1 In the Available Macros tab, right-click the macro icon, and then choose Rename from the shortcut menu.
2 In the Rename Macro dialog box, type the new name and click OK.
3 VWorks Plus only. If an audit trail is being logged for the macro library, the Audit Comment dialog box opens. Select or type a reason for the change, and then click OK.
Related information
 
For information about...
See...
Adding macros and removing macros from the macro library
Using macros in protocols
Exporting the macro library
Creating a basic protocol
Using JavaScript