Macros and multi-tasking
FactoryTalk View
has multi-tasking capabilities that you can take advantage of when you create macros. Generally, the commands in a macro are run in the order in which they are listed; one command ends before the next begins execution.Some commands (such as
Print
) finish quickly and the next command can start. Other commands, such as Set
, take longer. Set
does not finish until the message goes to the programmable controller. In cases like this, set up the macro so that the next command can be run before the previous command finishes. Use the ampersand character (&
) to do this.For example, to have a command immediately following a
Set
command start before the Set
command finishes, place an &
(ampersand character) in front of the Set
command.&Set tag1
The timing of commands can also be an issue where a command sets something in motion that needs to end before the subsequent command can be run. This occurs most commonly with the
Display
command where a subsequent command is intended to act on objects in the display. In such cases, the next command will attempt to run although the objects in the display might not yet be initialized. For example, if you use the Invoke
command to run a method on an ActiveX
object in a display, the Invoke
command will fail if the object is not yet initialized. You can use the Pause
command to give the objects in the display time to initialize before the next command is given.Provide Feedback