;**** 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 |
| |
| ; 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 |
|
| |
Type: | Variable; Network | Product | Rev | |
Syntax: | <!>VARSHO<i><=xx> | 6K | 5.3 | |
Units: | i = variable number |
|
|
xx=
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
Each unit on the Ethernet
For example, unit #2 could execute VARSHO1=3PE to share the encoder position of axis #3 in shared output variable #1.
Each unit will
The Implementation Process, beginning on page 8, identifies how to use the VARSHO command in context with the process of setting up the
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 | |
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