Parker Hannifin GEM6K manual Ntmprb Network Map Binary Variables for Reading from PLC, Example

Page 26

NTMPRB Network Map Binary Variables for Reading from PLC

Type:

Network

Product

Rev

Syntax:

<!><n>NTMPRB<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:

1NTMPRB0,0,0,0 (no mapping)

 

 

Response:

1NTMPRB: *1NTMPRB1,5,15,23

 

 

See Also:

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

 

 

 

TNTSF, VARB

 

 

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

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: 2NTMPRB3,15,15,35

The NTMPRB 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 storing binary data. To perform a binary read from 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 (NTMPRB command).

4.Start polling the AB device at a specific polling interval (NTPOLL command). This updates the 6K binary (VARB) variables with the binary element data from the AB PLC. You can then use the PLC binary data (via the VARB variables) in conditional expressions, command value substitutions and variable assignments.

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 NTMPRB command and will transmit the error message “VARIABLE MAPPING CONFLICT…”.

If you attempt to read from an AB data file of the wrong type, or read from a non-existent data element, the 6K will not accept the NTMPRB 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).

Control over Polling: If you want to stop the 6K from reading binary data from the PLC, but continue to exchange NTMPRI, NTMPWI and NTMPWB data, use the NTMPRBi,i,0,i command. If you need to stop polling all mapped variables, use the nNTPOLL0 command.

Example:

; Identify network server #2 as an Allen-Bradley PLC at

2NTIP1,172,54,125,34

page 22

Image 26
Contents Ethernet Networking for 6K and Gem6K User Information Ethernet Networking Page Example Direct Connect to One Server Setup Wizard AvailableOverview Example Direct Connect to PC Networking Guidelines DevicePing Preparing the Controller over RS-232 Configuring the 6K for Ethernet CommunicationSetting TCP/IP Properties and Static Mapping 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 MillisecondsNetworking with OPTO22 Snap I/O Communication according to the procedures onThen the command would be 3NTIP2,172,20,34,170 Set see ER, TER, TerfNetwork Server # Ntio command to specify the type of module in that positionInputs Module # on Server n Range Networking with a DVT Vision SystemIs set see ER, TER, Terf OPTO22 Ethernet I/O rack Command would be 3NTIP1,172,20,34,124Networking with an Allen-Bradley SLC 5/05 PLC Provided belowVARB100-VARB103 NTFEN2 Reset5NTCONN1 5NTPOLL50VARB106 Exchanging data automatically with the PLC. Here is how toHAB79 PLCError Response Possible Cause Error ConditionsError messages related to Ethernet networking Related Error Status register bits are noted below ER, TER, and Terf NtconnNetwork Connect Network Sharing Unit ID for Peer-to-Peer Communication Type Syntax Units Range Default Response See AlsoNtid ProductNetwork I/O OPTO22 Configuration Ntio\OUT , \TANI, \TANO, \TIN, \TIO, \TOUT Network IP Address Type Syntax Units Range Default ResponseNtip 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, VariVARI35-VARI49 NtmpwiNetwork Map Integer Variables for Writing to PLC WAITVARI40=22Range n = NtpollNetwork Polling Rate Ntrate *NTRATE50 NtrateNetwork Sharing Rate for Peer-to-Peer Communication NTFEN, NTID, SYSPER, VARSHO, VarshiNtselp Network Program Select EnableNTS Network StatusNetwork Write Ascii String to DVT Camera Default Response See AlsoNtwrit Transfer Network Status TntsTntsf Transfer Network Status full-text reportShared Input Variable for Peer-to-Peer Data Exchange Default n/aVarshi Shared Output Variable for Peer-to-Peer Data Exchange Range i = Default n/aVarsho Output variable #1 This code is executed on unit #2 NTIO, \TANI, \TIO, VAR \ANINetwork Analog Input Voltage Status \ANO , NTIO, \TANO, \TIO \ANONetwork Analog Output \ANO Network Analog Output StatusNTIO, \TIN, \TIO, Varb \INNetwork Digital Input Status \OUT , NTIO, \TIO, \TOUT \OUTNetwork Digital Output VARB9=2\3OUT \OUTNetwork Digital Output Status \TANI Transfer Network Analog Input Status\TANO Transfer Network Analog Output Status\TIO Range n = Default n/a\TIN Transfer Network Digital Input StatusDigital Outputs \TOUTTransfer Network Digital Output Status Analog Outputs