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.

unit, the ERRLVL1 comm<strong>and</strong> should be placed in the program that is defined as the STARTP<br />

program:<br />

Program:<br />

DEF chain ; Begin definition of program chain<br />

ERRLVL1 ; Set error level to 1<br />

GOTO main ; Go to program main<br />

END<br />

; End definition of program chain<br />

STARTP chain ; Designates program chain as the power-up program<br />

To define program main for unit #0:<br />

Program:<br />

0_DEF main ; Begin definition of program main on unit #0<br />

0_GO<br />

; Start motion<br />

0_END ; End definition of program main on unit #0<br />

Step 4<br />

After all programming is completed, program execution may be controlled by either a master<br />

terminal, or by a Gem6K Series controller used as a master.<br />

Daisy-Chaining<br />

from a Computer or<br />

Terminal<br />

Controlling the daisy-chain from a master computer or terminal follows the examples above:<br />

Comm<strong>and</strong>s:<br />

0_RUN main ; Run program main on unit #0<br />

1_RUN main ; Run program main on unit #1<br />

2_GO1 ; Start motion on unit #2<br />

3_A ; Get A comm<strong>and</strong> response from unit #3<br />

Daisy-Chaining<br />

from a Master<br />

Gem6K Controller<br />

Controlling the daisy-chain from a master Gem6K controller (the first unit on the daisy-chain)<br />

requires the programs stored in the master controller to control program <strong>and</strong> comm<strong>and</strong><br />

execution on the slave controllers. The example below demonstrates the use of the WRITE<br />

comm<strong>and</strong> to send comm<strong>and</strong>s to other units on the daisy chain.<br />

NOTE<br />

The last unit on the daisy-chain must have RS-232C echo disabled (ECHOØ comm<strong>and</strong>).<br />

Master controller's main program:<br />

Program:<br />

DEF main<br />

L<br />

WHILE (IN.1 = b0)<br />

NWHILE<br />

GO<br />

WHILE (IN.1 = b1)<br />

NWHILE<br />

WRITE"2_D2000"<br />

WRITE"2_ACK"<br />

LN<br />

END<br />

Controller unit #2 ack program:<br />

Program:<br />

DEF ack<br />

GO1<br />

END<br />

; Program main<br />

; Indefinite loop<br />

; Wait for input #1 to go active<br />

; Initiate move<br />

; Wait for input #1 to go inactive<br />

; Send message "2_D2000" down daisy chain<br />

; Send message "2_ACK" down the daisy chain<br />

; End of loop<br />

; End of program main<br />

; Program ack<br />

; Start motion<br />

; End of program ack<br />

Chapter 2. Communication 59

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

Saved successfully!

Ooh no, something went wrong!