Program Flow

Macro Function

Function

Properties

Values

Comments

MACRO

Actions




Call

Call another macro. The called macro must end with a “Macro return” function, otherwise it could misbehave

Return

Return to the caller of this macro

Jump

Jump to a macro

Repeat

Repeats the current macro from the start the number of times given. 0 means repeat forever (endless loop)

End program

Example: Jump from macro #4 to macro #2 without return

image2014-1-15 16:13:51.png

If Function

Function

Properties

Values

Comments

IF

If

  • Target reached

  • Set-point acknowledge

  • Actual position

  • Actual velocity

  • Actual force

  • Digital input

  • Analog input

  • Register value

Use the IF command to execute a block of commands based on a condition that is provided.

Different 'is' properties are available based on the different 'if' conditions to evaluate.

 

Is

  • Higher

  • Lower

  • Equal

  • Unequal

  • On/ Off

Logical comparison between values

Than

Constant / variable

It can use any readable variable in the controller or an integer value

Then

  • Macro call

  • Macro jump

  • Macro return

  • Macro continue

Type of macro action. See Macro function above.

Macro number

Integer between 0 and 63

Else

  • Macro call

  • Macro jump

  • Macro return

  • Macro continue

Type of macro action. See Macro function above.

Macro number

Integer between 0 and 63

Example:

This program shows how to set a digital output depending on an analog input signal value.

Check Analog input #1 value: If greater than 100 ADC counts jump to macro #2 and set digital output #1 to ON, otherwise jumps to macro #2 and set digital output #1 to OFF.

if and setoutput.JPG

Wait Function

Function

Properties

Values

Comments

Wait

Timer

Time in ms

The macro execution waits for a given time before processing the next function.

Register Value Timer

Time in ms

Time (ms ) can be defined as constant value or read from an internal register.

This option uses the internal value of 'wait register' as variable.

Conditional

  • Target reached

  • Set point acknowledge

  • Index Pulse

  • Actual position

  • Actual Force

  • Register Value

  • Analog Input

  • Digital Input

The macro execution waits for an event, motion value or input signal status before processing the next function.

Example:

Program waits for digital input = ON before executing the next macro instruction.

wait for gpdi.JPG

Stop Function

Function

Properties

Values

Comments

Stop

Mode

  • Quick Stop

  • Halt

  • Slow Stop

Stop.JPG