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.

Example<br />

NTADDR172,34,54,123 ; Set the IP address of the Gem6K<br />

OPTEN0<br />

; Disable the option card (for Fieldbus units<br />

only)<br />

RESET<br />

NTFEN2<br />

; Enable network function on Gem6K<br />

RESET<br />

5NTIP1,172,34,54,124 ; Identify network server #5 as an Allen Bradley<br />

PLC<br />

; at IP address 172.34.54.124<br />

5NTCONN1 ; Connect to network server #5<br />

5NTMPRB11,7,1,106 ; File 11, element 7 in the AB PLC is mapped to<br />

the Gem6K's<br />

; binary variable VARB106<br />

5NTMPRI20,5,2,128 ; File 20, elements 5-6 in the AB PLC are mapped<br />

to<br />

; the Gem6K's integer variables VARI128-VARI129,<br />

respectively<br />

5NTMPWB11,3,4,100 ; File 11, elements 3-6, in the AB PLC are<br />

mapped to<br />

; the Gem6K's binary variables VARB100-VARB103<br />

5NTMPWI20,3,2,120 ; File 20, elements 3-4, in the AB PLC are<br />

mapped to<br />

; the Gem6K's integer variables VARI120-VARB121<br />

5NTPOLL50<br />

; Start polling network server #5, set interval<br />

to 50 ms.<br />

;<br />

*********************************************<br />

************************<br />

; The Gem6K's VARB106 will read from the PLC's File 11, element 7.<br />

; The Gem6K's VARI128-VARI129 will read from the PLC's File 20,<br />

elements 5-6.<br />

; The PLC's File 11, elements 3-6 will read from the Gem6K's<br />

VARB100-VARB103.<br />

; The PLC's File 20, elements 3-4 will read from the Gem6K's<br />

VARI120-VARB121.<br />

;<br />

*********************************************<br />

************************<br />

Program<br />

Interaction<br />

After the connection is established, mapping has been set up, <strong>and</strong> polling enabled, the Gem6K<br />

starts exchanging data automatically with the PLC. Here is how to:<br />

• Write a binary variable to the PLC: Simply write a value to one of the VARB variables in<br />

the NTMPWB mapping. The new data will be written to the binary file during the next poll.<br />

• Write an integer variable to the PLC: Simply write a value to one of the VARI variables in<br />

the NTMPWI mapping. The new data will be written to the integer file during the next poll.<br />

• Read a binary variable from the PLC: The VARB variables in the NTMPRB mapping<br />

correspond to the values in the binary file in the PLC.<br />

• Read an integer variable from the PLC: The VARI variables in the NTMPRI mapping<br />

correspond to the values in the integer file in the PLC.<br />

Chapter 2. Communication 53

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

Saved successfully!

Ooh no, something went wrong!