Parker Hannifin GEM6K manual Varsho, Shared Output Variable for Peer-to-Peer Data Exchange

Page 36

;**** 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

 

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

VARSHO

Shared Output Variable for Peer-to-Peer Data Exchange

 

 

Type:

Variable; Network

Product

Rev

Syntax:

<!>VARSHO<i><=xx>

6K

5.3

Units:

i = variable number

 

 

xx= 32-bit data operand (see list below)

Range: i = 1-8

Default: n/a

Response: VARSHO1: *VARSHO1=PME

See Also: NTRATE, VAR, VARB, VARI, VARSHI

The VARSHO command is used to set up data to be shared over a peer-to-peer Ethernet connection (i.e., connection between other 6K or Gem6K products).

Each unit on the Ethernet peer-to-peer network has eight “shared output” variables (VARSHO1 through VARSHO8) with which it can share with other units the values of its motion attributes, controller status, variables, etc. (see list below). The type of data can be either binary, as in the AS (axis status) operand, or a 32-bit unscaled integer, as in PE (encoder position) operand. The data stored in the VARSHO is not scaled.

For example, unit #2 could execute VARSHO1=3PE to share the encoder position of axis #3 in shared output variable #1.

Each unit will re-broadcast its updated VARSHO data at a rate set with the NTRATE command. RECOMMENDATION: Set all devices to broadcast at the same NTRATE rate of 50 milliseconds.

The Implementation Process, beginning on page 8, identifies how to use the VARSHO command in context with the process of setting up the peer-to-peer Ethernet data sharing.

Options for shared data in the VARSHO variable:

A

Acceleration

NMCY ...

Master cycle number

SS

System status

AD

Deceleration

OUT

Output status

SWAP

Task swap assignment

ANI

Analog input voltage

PANI ...

Analog input position

TASK

Task number

ANO

Analog output voltage

PC

Commanded position

TIM

Timer value

AS

Axis status

PCC

Captured command pos.

TRIG

Trigger interrupt status

ASX

Extended axis status

PCE

Captured encoder pos.

US

User-defined status

D

Distance

PCME ...

Captured master enc. pos.

V

Velocity

DAC

DAC output value

PE

Encoder position

VARI

Integer variable

DKEY ...

RP240 keypad value

PER

Position error

VARB

Binary variable

ER

Error status

PMAS ...

Position of Master

VEL

Commanded velocity

FB

Feedback device pos.

PME

Master encoder pos.

VELA

Actual velocity

FS

Following status

PSHF ...

Net position shift

VMAS

Velocity of the master

IN

Input status

PSLV ...

Follower pos. command

VARSHI.Shared input variable

INO

Enable input status

SC

Controller status

 

 

LIM

Limit input status

SCAN ...

PLC scan time

 

 

MOV

Axis moving status

SEG

Free segment buffers

 

 

page 32

Image 36
Contents Ethernet Networking for 6K and Gem6K User Information Ethernet Networking Page Setup Wizard Available OverviewExample Direct Connect to One Server Example Direct Connect to PC Networking Guidelines DevicePing Configuring the 6K for Ethernet Communication Setting TCP/IP Properties and Static MappingPreparing the Controller over RS-232 Changing the 6K’s IP Address or Subnet MaskPage Connecting the 6K to the PC through Ethernet Arp -s 192.168.10.30 0-90-55-0-0-1Networking with Other 6K or Gem6K Products Peer-to-Peer MillisecondsCommunication according to the procedures on Then the command would be 3NTIP2,172,20,34,170Networking with OPTO22 Snap I/O Set see ER, TER, TerfNtio command to specify the type of module in that position InputsNetwork Server # Networking with a DVT Vision System Is set see ER, TER, TerfModule # on Server n Range Command would be 3NTIP1,172,20,34,124 Networking with an Allen-Bradley SLC 5/05 PLCOPTO22 Ethernet I/O rack Provided belowNTFEN2 Reset 5NTCONN1VARB100-VARB103 5NTPOLL50Exchanging data automatically with the PLC. Here is how to HAB79VARB106 PLCError Conditions Error messages related to Ethernet networkingError Response Possible Cause Related Error Status register bits are noted below Ntconn Network ConnectER, TER, and Terf Type Syntax Units Range Default Response See Also NtidNetwork Sharing Unit ID for Peer-to-Peer Communication ProductNetwork I/O OPTO22 Configuration Ntio\OUT , \TANI, \TANO, \TIN, \TIO, \TOUT Type Syntax Units Range Default Response NtipNetwork IP Address Server TypeNtmprb Network Map Binary Variables for Reading from PLC ExampleNtmpwb Network Map Binary Variables for Writing to PLCNtmpri Network Map Integer Variables for Reading from PLC TNTS, TNTSF, VariNtmpwi Network Map Integer Variables for Writing to PLCVARI35-VARI49 WAITVARI40=22Ntpoll Network Polling RateRange n = Ntrate Network Sharing Rate for Peer-to-Peer CommunicationNtrate *NTRATE50 NTFEN, NTID, SYSPER, VARSHO, VarshiNetwork Program Select Enable NTSNtselp Network StatusDefault Response See Also NtwritNetwork Write Ascii String to DVT Camera Tnts TntsfTransfer Network Status Transfer Network Status full-text reportDefault n/a VarshiShared Input Variable for Peer-to-Peer Data Exchange Range i = Default n/a VarshoShared Output Variable for Peer-to-Peer Data Exchange Output variable #1 This code is executed on unit #2 \ANI Network Analog Input Voltage StatusNTIO, \TANI, \TIO, VAR \ANO Network Analog Output\ANO , NTIO, \TANO, \TIO \ANO Network Analog Output Status\IN Network Digital Input StatusNTIO, \TIN, \TIO, Varb \OUT Network Digital Output\OUT , NTIO, \TIO, \TOUT \OUT Network Digital Output StatusVARB9=2\3OUT \TANI Transfer Network Analog Input Status\TANO Transfer Network Analog Output StatusRange n = Default n/a \TIN\TIO Transfer Network Digital Input Status\TOUT Transfer Network Digital Output StatusDigital Outputs Analog Outputs