Labview code, Labview code -28 – National Instruments NI-Motion User Manual

Page 236

Advertising
background image

Chapter 14

Onboard Programs

NI-Motion User Manual

14-28

ni.com

LabVIEW Code

This example moves axis 1 between target positions of 5000 and –5000.
The host reads the target position only after the move has completed, and
the new target position has been calculated. Figure 14-17 shows the code
that runs as an onboard program.

Figure 14-17. Synchronization Onboard Code in LabVIEW

1

Load Constant to Variable

2

Load Constant to Variable

3

Begin Program Storage

4

Set Operation Mode

5

Load Velocity

6

Insert Program Label

7

Load Target Position

8

Start Motion

9

Select MOMO

10 Wait on Condition

11 Multiply Variables
12 Set User Status MOMO
13 Jump to Label on Condition
14 End Program Storage
15 Motion Error Handler

13

15

11

12

10

8

1

2

3

5

4

6

7

9

14

Advertising