*Connection Open

YES

NO

NO

NO

NO

NO

*Server Connection Error

NO

NO

NO

NO

NO

NO

*In Polling Mode

YES

NO

NO

NO

NO

NO

*Polling Timeout Error

NO

NO

NO

NO

NO

NO

*

NO

NO

NO

NO

NO

NO

*Reserved

*Reserved

NO

NO

NO

NO

NO

NO

*Reserved

NO

NO

NO

NO

NO

NO

*Reserved

NO

NO

NO

NO

NO

NO

VARSHI

Shared Input Variable for Peer-to-Peer Data Exchange

 

 

Type:

Variable; Network

Product

Rev

Syntax:

<!><n>VARSHI<i>

6K

5.3

 

(see diagram below for assignment syntax)

 

 

Units:

n = unit number in the peer-to-peer network;

 

 

 

i = VARSHO number from unit “n”

 

 

Range: n = 1-8;

i= 1-8

Default: n/a

Response: 1VARSHI1: *1VARSHI1=0.0

See Also: IN, VAR, VARB, VARI, VARSHO

The VARSHI command helps you use shared data over a peer-to-peer Ethernet connection with other 6K or Gem6K products. VARSHI can be used to assign the integer or binary VARSHO data to a VAR (numeric), VARI (integer), or VARB (binary) variable, or to a virtual input brick (IN). You can also use VARSHI in a conditional statement, such as IF, WAIT, WHILE, or UNTIL.

The diagram below shows the syntax requirements for assigning VARSHI data to a variable:

<assignment> = <n> VARSHI <i>

Assignment options:

<variable>n

Variable number

VAR (numeric variable)

VARI (integer variable)

VARB (binary variable)

n IN (virtual input assignment) I/O brick number.

Range: 1-8

Must be an unused I/O brick

Number of the VARSHO variable from unit <n>

Number of the source unit (use this unit’s VARSHO data)

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

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

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

page 31

Page 35
Image 35
Parker Hannifin GEM6K manual Varshi, Shared Input Variable for Peer-to-Peer Data Exchange, Default n/a