Parker Hannifin GEM6K manual Ntmpwb, Network Map Binary Variables for Writing to PLC

Page 27

2NTCONN1

; IP address 172.54.125.34

 

; Attempt

connection to network server #2

2NTMPRB3,15,15,35

; File 3,

elements 15-29,

in the AB PLC are mapped to

2NTPOLL50

; the 6K's binary variables VARB35-VARB49

; Start polling network server #2, set interval to 50 ms

WAIT(VARB40=b1111111100000000)

; Wait until the value of

VARB40 (mapped to file 3,

 

; element

20, in the PLC)

is 1111111100000000

NTMPWB

Network Map Binary Variables for Writing to PLC

 

 

Type:

Network

Product

Rev

Syntax:

<!><n>NTMPWB<i>,<i>,<i>,<i>

6K

5.3

Units:

n = network server #

 

 

 

1st i = Allen Bradley data file #

 

 

 

2nd i = # of the 1st element in data file (beginning of range)

 

 

 

3rd i = # of the elements to include in range

 

 

 

4th i = # of the 1st binary (VARB) variable in the 6K to map to

 

 

Range:

n = 1-6

 

 

 

1st i = 0-n (n depends on size of file)

 

 

 

2nd i = 0-n (n depends on size of file)

 

 

 

3rd i = 0 or 1-50 (0 disables polling for this mapping only)

 

 

 

4th i = 1-125

 

 

Default:

1NTMPWB0,0,0,0 (no mapping)

 

 

Response:

1NTMPWB: *1NTMPWB1,5,15,23

 

 

See Also:

NTCONN, NTIP, NTMPRB, NTMPWI, NTMPRI, NTPOLL, [ NTS ], TNTS,

 

 

 

TNTSF, VARB

 

 

<n> NTMPWB <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 #2

In the PLC’s binary data file 3, use data elements 0-14 (15 elements total) for binary data that is to be transmitted from the 6K.

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

to be transmitted to the PLC. The required mapping command is:

2NTMPWB3,0,15,20

The NTMPWB command maps a range of binary data elements from the AB PLC to a range of binary (VARB) variables in the

6K. There are 125 VARB variables available in the 6K for exchanging binary data. To perform a binary write to the PLC:

1.Assign the AB PLC a server number, according to its IP address (NTIP command).

2.Connect to the AB PLC, according to its server number (NTCONN command).

3.Map a range of binary elements in the AB PLC to a range of binary (VARB) variables in the 6K (NTMPWB command).

4.Start polling the AB device at a specific polling interval (NTPOLL command). This updates binary data elements in the AB PLC with the data from the mapped VARB variables in the 6K.

Saved in Non-Volatile Memory

This command is saved in the controller’s non-volatile memory, and is remembered on power-up and RESET.

Potential Error Conditions:

You are not allowed to map the same 6K VARB variables for read and write functions. Nor are you allowed to map the same 6K VARB variables to another PLC. If you attempt either of these conditions, the 6K will not accept the NTMPWB command and will transmit the error message “VARIABLE MAPPING CONFLICT…”.

If you attempt to write to an AB data file of the wrong type, or to a non-existent data element, the 6K will not accept the NTMPWB command, it will transmit the error message “ERROR, INVALID FILE TYPE, NUMBER OR SIZE…” and it will automatically stop polling all mapped binary and integer variables (equivalent to executing the

NTMPRBi,i,0,i, NTMPWBi,i,0,i, NTMPRIi,i,0,i, and NTMPWIi,i,0,i, commands).

page 23

Image 27
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 Device Networking GuidelinesPing Changing the 6K’s IP Address or Subnet Mask Configuring the 6K for Ethernet CommunicationSetting TCP/IP Properties and Static Mapping Preparing the Controller over RS-232Page 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-PeerSet see ER, TER, Terf Communication according to the procedures onThen the command would be 3NTIP2,172,20,34,170 Networking with OPTO22 Snap I/ONtio 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 Provided below Command would be 3NTIP1,172,20,34,124Networking with an Allen-Bradley SLC 5/05 PLC OPTO22 Ethernet I/O rack5NTPOLL50 NTFEN2 Reset5NTCONN1 VARB100-VARB103PLC Exchanging data automatically with the PLC. Here is how toHAB79 VARB106Error Conditions Error messages related to Ethernet networkingError Response Possible Cause Related Error Status register bits are noted below Ntconn Network ConnectER, TER, and Terf Product Type Syntax Units Range Default Response See AlsoNtid Network Sharing Unit ID for Peer-to-Peer CommunicationNtio Network I/O OPTO22 Configuration\OUT , \TANI, \TANO, \TIN, \TIO, \TOUT Server Type Type Syntax Units Range Default ResponseNtip Network IP AddressExample 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 PLCWAITVARI40=22 NtmpwiNetwork Map Integer Variables for Writing to PLC VARI35-VARI49Ntpoll Network Polling RateRange n = NTFEN, NTID, SYSPER, VARSHO, Varshi NtrateNetwork Sharing Rate for Peer-to-Peer Communication Ntrate *NTRATE50Network Status Network Program Select EnableNTS NtselpDefault Response See Also NtwritNetwork Write Ascii String to DVT Camera Transfer Network Status full-text report TntsTntsf Transfer Network StatusDefault 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 Network Analog Output Status \ANO\IN Network Digital Input StatusNTIO, \TIN, \TIO, Varb \OUT Network Digital Output\OUT , NTIO, \TIO, \TOUT \OUT Network Digital Output StatusVARB9=2\3OUT Transfer Network Analog Input Status \TANITransfer Network Analog Output Status \TANOTransfer Network Digital Input Status Range n = Default n/a\TIN \TIOAnalog Outputs \TOUTTransfer Network Digital Output Status Digital Outputs