Parker Hannifin GEM6K Networking with an Allen-Bradley SLC 5/05 PLC, OPTO22 Ethernet I/O rack

Page 16

Example

6NTIP3,172,34,54,150

; Identify a

DVT camera as Server #6,

located at

 

6NTCONN1

;

IP address

172.34.54.150.

Server #6

 

 

;

Attempt the connection to

 

Program

Interaction

Example

Once a connection has been established, you can write trigger commands to the camera using the NTWRIT command.

DEL DVT

 

 

 

DEF DVT

;

Attempt connection to DVT camera

 

6NTCONN1

camera

6NTWRIT"DVT commands"

;

Write the text "DVT commands" to

END

 

 

 

Networking with an Allen-Bradley SLC 5/05 PLC

The Allen-Bradley SLC 5/05 exchanges integer and binary data with the 6K. The data exchange is accomplished by mapping integer variables (VARI) and binary variables (VARB) in the 6K with data elements in the PLC’s integer and binary data files. The 6K limits the amount of variable mapping to 100 binary variables (50 write, 50 read) and 100 integer variables

(50 write, 50 read).

Setup

1.

Follow the manufacturer’s setup procedure for each Allen-Bradley PLC, DVT camera

 

 

and OPTO22 Ethernet I/O rack.

 

2.

Connect the 6K and Allen-Bradley PLC in a network and configure the 6K for Ethernet

 

 

communication according to the procedures on page 4.

 

3.

Choose a connection number for this device. The 6K can support up to 6 simultaneous

 

 

client connections. Pick a number (1-6) that has not been used already for another client

 

 

connection. The number is used to reference the device from now on.

 

4.

Enter the IP address of the PLC and specify a 1 for connection type with the NTIP

 

 

command. For example, if the PLC is Server #5 and its IP address is 172.20.34.124, then

 

 

the command would be 3NTIP1,172,20,34,124.

 

5.

Attempt a connection to the device with NTCONN. For example, if the server number is 5,

 

 

the command would be 5NTCONN1. If the connection is successful, Network Status bit

 

 

#1 is set (see NTS, TNTS, TNTSF). If the connection is unsuccessful, Error Status bit #23

 

 

is set (see ER, TER, TERF).

 

6.

Map the required integer and binary variables between the 6K and the data files in the

 

 

Allen-Bradley PLC. There are four mappings possible (a programming example is

 

 

provided below).

• Use the NTMPRB command to read up to 50 binary elements from a PLC’s binary file and write them to VARB variables in the 6K.

n NTMPRB i, i, i, i

Network Server #

Range: 1-6

#of Allen-Bradley data file

#of first element in AB data file (beginning of range)

#of elements in range

#of first binary variable (VARB) in 6K (beginning of range, max value is 125)

EXAMPLE:

IF:

Allen-Bradley PLC is server #5

The PLC’s binary data file 3 has 30 elements. Use data elements 15-29 (15 elements total) for binary data that is to be shared with the 6K.

Use the 6K’s binary variables 35-49 (15 variables total) to store the data

from the PLC.

The required mapping command is:

5NTMPRB3,15,15,35

Use the NTMPRI command to read up to 50 integer elements from a PLC’s Integer file and write them to VARI variables in the 6K.

page 12

Image 16
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 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, 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 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 messages related to Ethernet networking Error ConditionsError Response Possible Cause Related Error Status register bits are noted below Network Connect NtconnER, 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=22Network Polling Rate NtpollRange n = Ntrate Network Sharing Rate for Peer-to-Peer CommunicationNtrate *NTRATE50 NTFEN, NTID, SYSPER, VARSHO, VarshiNetwork Program Select Enable NTSNtselp Network StatusNtwrit Default Response See AlsoNetwork Write Ascii String to DVT Camera Tnts TntsfTransfer 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 \ANO Network Analog Output StatusNetwork Digital Input Status \INNTIO, \TIN, \TIO, Varb Network Digital Output \OUT\OUT , NTIO, \TIO, \TOUT Network Digital Output Status \OUTVARB9=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