Parker Hannifin GEM6K manual Output variable #1 This code is executed on unit #2

Page 37

Example: This example uses peer-to-peer communication with three 6K8 products.

;****

This code is executed on Peer unit #1:

**************************

NTID1

 

; This unit is the "primary unit" (unit #1)

NTRATE100

; Set the sharing

rate to 100ms and enable this unit

VARSHO1=1PE

; Store axis #1 encoder position in shared output variable #1

;*************************************************************************

;****

This code is executed on unit #3: **************************

NTID3

 

; Set unit ID to 3

rate to 100ms and enable this unit

NTRATE100

; Set the sharing

VARSHO2=4PCEA

; Store the captured encoder position of axis #4 in shared

VARSHO1=3AS

; output variable

#2

; Store axis #3's

axis status (binary data) in shared

;output variable #1

;*************************************************************************

;**** This code is executed on unit #2: **************************

NTID2

; Set unit ID to 2

NTRATE100

; Set the sharing rate to 100ms and enable this unit

VAR1=1VARSHI1

; Load the value of unit #1's first shared data (1PE) into VAR1

WRITE"AXIS 1 AT POSITION" ; Report axis 1's current position (the value of VAR1)

WRVAR1

; Calculate offset position: Subtract synch unit #3's

VAR2=8PCEA-3VARSHI2

 

; VARSHO2 (4PCEA) from the captured encoder position

IF(VAR2>10000)

; of axis #8 (8PCEA).

; If position offset by more than 10000 encoder counts

WRITE"AXIS 20 OUT OF POSITION"

NIF

; Get unit 3's VARSHO1 information (3AS)

VARB1=3VARSHI1

IF(VARB1=B1)

; If axis 3 on unit #3 (axis #19) is in motion

WRITE"AXIS 19 IN MOTION"

 

NIF

 

;*************************************************************************

page 33

Image 37
Contents Ethernet Networking for 6K and Gem6K User Information Ethernet Networking Page Overview Setup Wizard AvailableExample Direct Connect to One Server Example Direct Connect to PC Device Networking GuidelinesPing Setting TCP/IP Properties and Static Mapping Configuring the 6K for Ethernet CommunicationPreparing the Controller over RS-232 Changing the 6K’s IP Address or Subnet MaskPage Arp -s 192.168.10.30 0-90-55-0-0-1 Connecting the 6K to the PC through EthernetMilliseconds Networking with Other 6K or Gem6K Products Peer-to-PeerThen the command would be 3NTIP2,172,20,34,170 Communication according to the procedures onNetworking with OPTO22 Snap I/O Set see ER, TER, TerfInputs Ntio command to specify the type of module in that positionNetwork Server # Is set see ER, TER, Terf Networking with a DVT Vision SystemModule # on Server n Range Networking with an Allen-Bradley SLC 5/05 PLC Command would be 3NTIP1,172,20,34,124OPTO22 Ethernet I/O rack Provided below5NTCONN1 NTFEN2 ResetVARB100-VARB103 5NTPOLL50HAB79 Exchanging data automatically with the PLC. Here is how toVARB106 PLCError messages related to Ethernet networking Error ConditionsError Response Possible Cause Related Error Status register bits are noted below Network Connect NtconnER, TER, and Terf Ntid Type Syntax Units Range Default Response See AlsoNetwork Sharing Unit ID for Peer-to-Peer Communication ProductNtio Network I/O OPTO22 Configuration\OUT , \TANI, \TANO, \TIN, \TIO, \TOUT Ntip Type Syntax Units Range Default ResponseNetwork IP Address Server TypeExample Ntmprb Network Map Binary Variables for Reading from PLCNetwork Map Binary Variables for Writing to PLC NtmpwbTNTS, TNTSF, Vari Ntmpri Network Map Integer Variables for Reading from PLCNetwork Map Integer Variables for Writing to PLC NtmpwiVARI35-VARI49 WAITVARI40=22Network Polling Rate NtpollRange n = Network Sharing Rate for Peer-to-Peer Communication NtrateNtrate *NTRATE50 NTFEN, NTID, SYSPER, VARSHO, VarshiNTS Network Program Select EnableNtselp Network StatusNtwrit Default Response See AlsoNetwork Write Ascii String to DVT Camera Tntsf TntsTransfer Network Status Transfer Network Status full-text reportVarshi Default n/aShared Input Variable for Peer-to-Peer Data Exchange Varsho Range i = Default n/aShared Output Variable for Peer-to-Peer Data Exchange Output variable #1 This code is executed on unit #2 Network Analog Input Voltage Status \ANINTIO, \TANI, \TIO, VAR Network Analog Output \ANO\ANO , NTIO, \TANO, \TIO Network Analog Output Status \ANONetwork Digital Input Status \INNTIO, \TIN, \TIO, Varb Network Digital Output \OUT\OUT , NTIO, \TIO, \TOUT Network Digital Output Status \OUTVARB9=2\3OUT Transfer Network Analog Input Status \TANITransfer Network Analog Output Status \TANO\TIN Range n = Default n/a\TIO Transfer Network Digital Input StatusTransfer Network Digital Output Status \TOUTDigital Outputs Analog Outputs