Nematron Pointe Controller User Manual

Page 152

Advertising
background image

Chapter 5: Developing Controller Programs

Pointe Controller User Guide

150

A Note on Arguments

When you define an argument in the Subchart’s

Start block

, you are merely

setting it up to receive some value or variable that will be passed from the calling
Flow Chart. The actual value of that argument is defined in the Flow Chart’s

Subchart block

.

Also, arguments can be passed either “by value” or “by reference”:

An Argument by value is the calculated value of the argument’s

logical

expression

at the moment the Subchart is called. The value is then

operated on locally within the Subchart – as if it was a literal – without
affecting the tag or expression from which the value was calculated.

An Argument by reference is a pointer to a tag in Logic Memory.

Operations on the pointer within the Subchart read from and write to the
tag as if it was referenced directly by the Subchart. The pointer is used so
that a different tag can be referenced each time the Subchart is called. It
all depends on what tag reference is passed by the calling Flow Chart.

If the Subchart needs to read from or write to the same Logic Memory tag
every time it is called, then the tag can be directly referenced the same
way it is in a regular Flow Chart.

Make sure you select the right variable type – by value or by reference – from the
type menu (step 4c above).

Calling the Subchart

For a complete description of how to call a Subchart from within a Flow Chart,
see “

Subchart Block

” on page 161

.

Advertising