14.01.2015 Views

Gemini GV6K and Gemini GT6K Programmer's Guide

Gemini GV6K and Gemini GT6K Programmer's Guide

Gemini GV6K and Gemini GT6K Programmer's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

POUTA<br />

Output During Compiled Motion Profile:<br />

The POUTA comm<strong>and</strong> turns the programmable output bits on <strong>and</strong> off.<br />

TSEG & SEG<br />

Transfer/Display (TSEG) or Assign (SEG) the Number of Free Segment Buffers:<br />

The TSEG comm<strong>and</strong> returns the number of free segment buffers in compiled memory. The<br />

SEG comm<strong>and</strong> is used to assign the number of free segment buffers in compiled memory to a<br />

variable or to make a comparison against another value.<br />

Compiled Motion — Sample Application 1<br />

Profile<br />

A manufacturer has an application where wire is being wrapped onto a spindle. There is a<br />

motor controlling the rotational speed of the spindle. Every application of the spindle requires<br />

that the motor runs at a fast speed with a slow acceleration for the first few revolutions, a<br />

medium speed for the next couple of revolutions, <strong>and</strong> a slower speed as the spindle gets fuller<br />

to maintain somewhat of a constant velocity off the feed wire. The technician would like to<br />

use an RP240 to enter the velocity <strong>and</strong> number of revolutions for each stage of winding.<br />

Programmable outputs 1, 2 <strong>and</strong> 3 are wired to status LEDs, <strong>and</strong> should go on for the<br />

respective stages of winding (output 1 for stage 1, etc.).<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

Program DEF PROFIL ; Define motion profile program<br />

VAR10 = 4000 * VAR4 ; Get distance of first stage<br />

; (assuming 4000 steps/revolution)<br />

D(VAR10)<br />

; Set distance<br />

V(VAR1)<br />

; Set velocity of first stage<br />

POUTA.1-1<br />

; Turn output 1 on<br />

GOBUF1<br />

; Build motion<br />

VAR10 = 4000 * VAR5 ; Get distance of second stage<br />

D(VAR10)<br />

; Set distance<br />

V(VAR2)<br />

; Set velocity of second stage<br />

POUTA01<br />

; Turn output 1 off <strong>and</strong> output 2 on<br />

GOBUF1<br />

; Build motion<br />

VAR10 = 4000 * VAR6 ; Get distance of third stage<br />

D(VAR10)<br />

; Set distance<br />

V(VAR3)<br />

; Set velocity of third stage<br />

POUTAx01<br />

; Turn output 2 off <strong>and</strong> output 3 on<br />

GOBUF1<br />

; Build motion<br />

POUTA.3-0 ; Turn off output 3<br />

END<br />

; End motion profile program<br />

<br />

DEF EXMPL1 ; Define program example 1<br />

L<br />

; Continual loop of program execution<br />

DCLEAR0<br />

; Clear all lines on RP240 display<br />

DPCUR1,1 ; Position cursor at line 1, column 1<br />

DWRITE"ENTER VELOCITY STAGE 1" ; Prompt user<br />

VAR1 = DREAD<br />

; Get 1st velocity from RP240 entry<br />

DCLEAR1<br />

; Clear line 1 on RP240 display<br />

DPCUR1,1 ; Position cursor at line 1, column 1<br />

DWRITE"ENTER VELOCITY STAGE 2" ; Prompt user<br />

VAR2 = DREAD<br />

; Get 2nd velocity from RP240 entry<br />

DCLEAR1<br />

; Clear line 1 on RP240 display<br />

DPCUR1,1 ; Position cursor at line 1, column 1<br />

DWRITE"ENTER VELOCITY STAGE 3" ; Prompt user<br />

VAR3 = DREAD<br />

; Get 3rd velocity from RP240 entry<br />

DCLEAR1<br />

; Clear line 1 on RP240 display<br />

DPCUR1,1 ; Position cursor at line 1, column 1<br />

DWRITE"ENTER REVOLUTIONS STAGE 1" ; Prompt user<br />

Chapter 6. Following 147

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!