Please enable JavaScript to view this site.

DAQFactory User's Guide

Navigation: 5 Sequences & Scripting

5.5 More advanced assignment operators

Scroll Prev Top Next More

Sequences have several more advanced assignment statements.  The first two are called increment and decrement:

 

MyOutputChannel++

X--

 

The first line sets MyOutputChannel to its current value plus 1.  The second, sets X to its current value minus 1.  These are the same as:

 

MyOutputChannel = MyOutputChannel[0] + 1

X = X + 1

 

If you need to increment or decrement by larger amounts, you can use the following notation:

 

MyOutputChannel+=2

This will set MyOutputChannel to its current value plus 2 and is the same as:

 

MyOutputChannel = MyOutputChannel[0] + 2

This notation can be used for more advanced assignment as well:

 

MyOutputChannel += InputChannel[0] / 2

This will set MyOutputChannel to its current value plus the latest value of InputChannel[0] divided by 2.  This is the same as:

 

MyOutputChannel = MyOutputChannel[0] + InputChannel[0] / 2

There are equivalent operators for subtraction, multiplication, and division:

 

X -= 3

Y *= InputChannel[0]

Z /= 10

 

which is the same as:

 

X = X - 3

Y = Y * InputChannel[0]

Z = Z / 10