The text of a manual · part 31 of 40
DL05 Micro PLC User Manual, Volume 1 of 2: Chapter 5: Standard RLL and Intelligent Box Instructions, pages 284 to 293
Pages 284 to 293 of 379, from DL05 Micro PLC User Manual, Volume 1 of 2
The original document is the PDF (5.8 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the AutomationDirect D0-05AA
Page 284
Chapter 5: Intelligent Box (IBox) - Communication
ECOM100 Example The ECOM100 Config IBox coordinates all of the interaction with other ECOM100 based IBoxes (ECxxxx). You must have an ECOM100 Config IBox for each ECOM100 module in your system. Configuration IBoxes must be at the top of your program and must execute every scan. This IBox defines ECOM100# K0 to be in slot 3. Any ECOM100 IBoxes that need to reference this specific module (such as ECEMAIL, ECRX, ...) would enter K0 for their ECOM100# parameter. The Status register is for reporting any completion or error information to other ECOM100 IBoxes. This V-memory register must not be used anywhere else in the entire program. The Workspace register is used to maintain state information about the ECOM100, along with proper sharing and interlocking with the other ECOM100 IBoxes in the program. This V-memory register must not be used anywhere else in the entire program. The Message Buffer of 65 words (130 bytes) is a common pool of memory that is used by other ECOM100 IBoxes (such as ECEMAIL). This way, you can have a bunch of ECEMAIL IBoxes, but only need 1 common buffer for generating and sending each EMail. These V-memory registers must not be used anywhere else in your entire program.
DL05 Micro PLC User Manual, 6th Edition, Rev. A
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
5–161
Page 285
Chapter 5: Intelligent Box (IBox) - Communication
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
ECOM100 Disable DHCP (ECDHCPD) (IB-736) DS5
Used
HPP
N/A
5–162
ECOM100 Disable DHCP will setup the ECOM100 to use its internal TCP/IP settings on a leading edge transition to the IBox. To configure the ECOM100's TCP/IP settings manually, use the NetEdit3 utility, or you can do it programmatically from your PLC program using the ECOM100 IP Setup (ECIPSUP), or the individual ECOM100 IBoxes: ECOM Write IP Address (ECWRIP), ECOM Write Gateway Address (ECWRGWA), and ECOM100 Write Subnet Mask (ECWRSNM). The Workspace parameter is an internal, private register used by this IBox and MUST BE UNIQUE in this one instruction and MUST NOT be used anywhere else in your program. Either the Success or Error bit parameter will turn on once the command is complete. If there is an error, the Error Code parameter will report an ECOM100 error code (less than 100), or a PLC logic error (greater than 1000). The "Disable DHCP" setting is stored in Flash-ROM in the ECOM100 and the execution of this IBox will disable the ECOM100 module for at least a half second until it writes the Flash-ROM. Therefore, it is HIGHLY RECOMMENDED that you only execute this IBox ONCE, on second scan. Since it requires a LEADING edge to execute, use a NORMALLY CLOSED SP0 (STR NOT First Scan) to drive the power flow to the IBox. In order for this ECOM100 IBox to function, you must turn ON dip switch 7 on the ECOM100 circuit board. ECDHCPD Parameters • ECOM100#: this is a logical number associated with this specific ECOM100 module in the specified slot. All other ECxxxx IBoxes that need to reference this ECOM100 module must reference this logical number • Workspace: specifies a V-memory location that will be used by the instruction • Success: specifies a bit that will turn on once the request is completed successfully • Error: specifies a bit that will turn on if the instruction is not successfully completed • Error Code: specifies the location where the Error Code will be written
Parameter ECOM100# . . . . . . . . . . . . . . . . . . . . . . . . . . . . K Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B Error Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
DL05 Range K0-255 See DL05 V-memory map - Data Words See DL05 V-memory map See DL05 V-memory map See DL05 V-memory map - Data Words
DL05 Micro PLC User Manual, 6th Edition, Rev. A
Page 286
Chapter 5: Intelligent Box (IBox) - Communication
ECDHCPD Example
1 2 3 4 5 6 7 8 Rung 2: On the 2nd scan, disable DHCP in the ECOM100. DHCP is the same protocol used by PCs for using a DHCP Server to automatically assign the ECOM100's IP Address, Gateway Address, and Subnet Mask. Typically disabling DHCP is done by assigning a hard9 coded IP Address either in NetEdit or using one of the ECOM100 IP Setup IBoxes, but this IBox allows you to disable DHCP in the ECOM100 using your ladder program. The 10 ECDHCPD is leading edge triggered, not power-flow driven (similar to a counter input leg). The command to disable DHCP will be sent to the ECOM100 whenever the power flow into the IBox goes from OFF to ON. If successful, turn on C100. If there is a failure, turn on 11 C101. If it fails, you can look at V2000 for the specific error code. 12 13 14 A B C D Rung 1: The ECOM100 Config IBox is responsible for coordination/interlocking of all ECOM100 type IBoxes for one specific ECOM100 module. Tag the ECOM100 in slot 1 as ECOM100# K0. All other ECxxxx IBoxes refer to this module # as K0. If you need to move the module in the base to a different slot, then you only need to change this one IBox. V400 is used as a global result status register for the other ECxxxx IBoxes using this specific ECOM100 module. V401 is used to coordinate/interlock the logic in all of the other ECxxxx IBoxes using this specific ECOM100 module. V402-V502 is a common 130 byte buffer available for use by the other ECxxxx IBoxes using this specific ECOM100 module.
DL05 Micro PLC User Manual, 6th Edition, Rev. A
5–163
Page 287
Chapter 5: Intelligent Box (IBox) - Communication
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
ECOM100 Enable DHCP (ECDHCPE) (IB-735) DS5
Used
HPP
N/A
5–164
ECOM100 Enable DHCP will tell the ECOM100 to obtain its TCP/IP setup from a DHCP Server on a leading edge transition to the IBox. The IBox will be successful once the ECOM100 has received its TCP/IP settings from the DHCP server. Since it is possible for the DHCP server to be unavailable, a Timeout parameter is provided so the IBox can complete, but with an Error (Error Code = 1004 decimal). See also the ECOM100 IP Setup (ECIPSUP) IBox 717 to directly setup ALL of the TCP/IP parameters in a single instruction - IP Address, Subnet Mask, and Gateway Address. The Workspace parameter is an internal, private register used by this IBox and MUST BE UNIQUE in this one instruction and MUST NOT be used anywhere else in your program. Either the Success or Error bit parameter will turn on once the command is complete. If there is an error, the Error Code parameter will report an ECOM100 error code (less than 100), or a PLC logic error (greater than 1000). The "Enable DHCP" setting is stored in Flash-ROM in the ECOM100 and the execution of this IBox will disable the ECOM100 module for at least a half second until it writes the Flash-ROM. Therefore, it is HIGHLY RECOMMENDED that you only execute this IBox ONCE, on second scan. Since it requires a LEADING edge to execute, use a NORMALLY CLOSED SP0 (STR NOT First Scan) to drive the power flow to the IBox. In order for this ECOM100 IBox to function, you must turn ON dip switch 7 on the ECOM100 circuit board. ECDHCPE Parameters • ECOM100#: this is a logical number associated with this specific ECOM100 module in the specified slot. All other ECxxxx IBoxes that need to reference this ECOM100 module must reference this logical number • Timeout(sec): specifies a timeout period so that the instruction may have time to complete • Workspace: specifies a V-memory location that will be used by the instruction • Success: specifies a bit that will turn on once the request is completed successfully • Error: specifies a bit that will turn on if the instruction is not successfully completed • Error Code: specifies the location where the Error Code will be written
Parameter ECOM100# . . . . . . . . . . . . . . . . . . . . . . . . . . . . K Timeout (sec) . . . . . . . . . . . . . . . . . . . . . . . . . . K Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B Error Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
DL05 Range K0-255 K5-127 See DL05 V-memory map - Data Words See DL05 V-memory map See DL05 V-memory map See DL05 V-memory map - Data Words
DL05 Micro PLC User Manual, 6th Edition, Rev. A
Page 288
Chapter 5: Intelligent Box (IBox) - Communication
ECDHCPE Example
1 2 3 4 5 6 7 8 Rung 2: On the 2nd scan, enable DHCP in the ECOM100. DHCP is the same protocol used by PCs for using a DHCP Server to automatically assign the ECOM100's IP Address, 9 Gateway Address, and Subnet Mask. Typically this is done using NetEdit, but this IBox allows you to enable DHCP in the ECOM100 using your ladder program. The ECDHCPE 10 is leading edge triggered, not power-flow driven (similar to a counter input leg). The commands to enable DHCP will be sent to the ECOM100 whenever the power flow into the 11 IBox goes from OFF to ON. The ECDHCPE does more than just set the bit to enable DHCP in the ECOM100, but it then polls the ECOM100 once every second to see if the ECOM100 has found a DHCP server and has a valid IP Address. Therefore, a timeout 12 parameter is needed in case the ECOM100 cannot find a DHCP server. If a timeout does occur, the Error bit will turn on and the error code will be 1005 decimal. The Success bit will 13 turn on only if the ECOM100 finds a DHCP Server and is assigned a valid IP Address. If successful, turn on C100. If there is a failure, turn on C101. If it fails, you can look at V2000 for the specific error code. 14 A B C D Rung 1: The ECOM100 Config IBox is responsible for coordination/interlocking of all ECOM100 type IBoxes for one specific ECOM100 module. Tag the ECOM100 in slot 1 as ECOM100# K0. All other ECxxxx IBoxes refer to this module # as K0. If you need to move the module in the base to a different slot, then you only need to change this one IBox. V400 is used as a global result status register for the other ECxxxx IBoxes using this specific ECOM100 module. V401 is used to coordinate/interlock the logic in all of the other ECxxxx IBoxes using this specific ECOM100 module. V402-V502 is a common 130 byte buffer available for use by the other ECxxxx IBoxes using this specific ECOM100 module.
DL05 Micro PLC User Manual, 6th Edition, Rev. A
5–165
Page 289
Chapter 5: Intelligent Box (IBox) - Communication
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
ECOM100 Query DHCP Setting (ECDHCPQ) (IB-734) DS5
Used
HPP
N/A
5–166
ECOM100 Query DHCP Setting will determine if DHCP is enabled in the ECOM100 on a leading edge transition to the IBox. The DHCP Enabled bit parameter will be ON if DHCP is enabled, OFF if disabled. The Workspace parameter is an internal, private register used by this IBox and MUST BE UNIQUE in this one instruction and MUST NOT be used anywhere else in your program. Either the Success or Error bit parameter will turn on once the command is complete. In order for this ECOM100 IBox to function, you must turn ON dip switch 7 on the ECOM100 circuit board. ECDHCPQ Parameters • ECOM100#: this is a logical number associated with this specific ECOM100 module in the specified slot. All other ECxxxx IBoxes that need to reference this ECOM100 module must reference this logical number • Workspace: specifies a V-memory location that will be used by the instruction • Success: specifies a bit that will turn on once the instruction is completed successfully • Error: specifies a bit that will turn on if the instruction is not successfully completed • DHCP Enabled: specifies a bit that will turn on if the ECOM100’s DHCP is enabled or remain off if disabled - after instruction query, be sure to check the state of the Success/Error bit state along with DHCP Enabled bit state to confirm a successful module query
Parameter ECOM100# . . . . . . . . . . . . . . . . . . . . . . . . . . . . K Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B DHCP Enabled . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B
DL05 Range K0-255 See DL05 V-memory map - Data Words See DL05 V-memory map See DL05 V-memory map See DL05 V-memory map
DL05 Micro PLC User Manual, 6th Edition, Rev. A
Page 290
Chapter 5: Intelligent Box (IBox) - Communication
ECDHCPQ Example
1 2 3 4 5 6 7 8 Rung 2: On the 2nd scan, read whether DHCP is enabled or disabled in the ECOM100 and store it in C5. DHCP is the same protocol used by PCs for using a DHCP Server to 9 automatically assign the ECOM100's IP Address, Gateway Address, and Subnet Mask. The ECDHCPQ is leading edge triggered, not power-flow driven (similar to a counter input leg). 10 The command to read (Query) whether DHCP is enabled or not will be sent to the ECOM100 whenever the power flow into the IBox goes from OFF to ON. If successful, turn 11 on C100. If there is a failure, turn on C101. 12 13 14 A B C D Rung 1: The ECOM100 Config IBox is responsible for coordination/interlocking of all ECOM100 type IBoxes for one specific ECOM100 module. Tag the ECOM100 in slot 1 as ECOM100# K0. All other ECxxxx IBoxes refer to this module # as K0. If you need to move the module in the base to a different slot, then you only need to change this one IBox. V400 is used as a global result status register for the other ECxxxx IBoxes using this specific ECOM100 module. V401 is used to coordinate/interlock the logic in all of the other ECxxxx IBoxes using this specific ECOM100 module. V402-V502 is a common 130 byte buffer available for use by the other ECxxxx IBoxes using this specific ECOM100 module.
DL05 Micro PLC User Manual, 6th Edition, Rev. A
5–167
Page 291
Chapter 5: Intelligent Box (IBox) - Communication
ECOM100 Send E-mail (ECEMAIL) (IB-711)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
DS5
Used
HPP
N/A
5–168
ECOM100 Send EMail, on a leading edge transition, will behave as an EMail client and send an SMTP request to your SMTP Server to send the EMail message to the EMail addresses in the To: field and also to those listed in the Cc: list hard coded in the ECOM100. It will send the SMTP request based on the specified ECOM100#, which corresponds to a specific unique ECOM100 Configuration (ECOM100) at the top of your program. The Body: field supports what the PRINT and VPRINT instructions support for text and embedded variables, allowing you to embed real-time data in your EMail (e.g. "V2000 = " V2000:B). The Workspace parameter is an internal, private register used by this IBox and MUST BE UNIQUE in this one instruction and MUST NOT be used anywhere else in your program. Either the Success or Error bit parameter will turn on once the request is complete. If there is an error, the Error Code parameter will report an ECOM100 error code (less than 100), an SMPT protocol error (between 100 and 999), or a PLC logic error (greater than 1000). Since the ECOM100 is only an EMail Client and requires access to an SMTP Server, you MUST have the SMTP parameters configured properly in the ECOM100 via the ECOM100's Home Page and/or the EMail Setup instruction (ECEMSUP). To get to the ECOM100's Home Page, use your favorite Internet browser and browse to the ECOM100's IP Address, e.g. http://192.168.12.86 You are limited to approximately 100 characters of message data for the entire instruction, including the To: Subject: and Body: fields. To save space, the ECOM100 supports a hard coded list of EMail addresses for the Carbon Copy field (cc:) so that you can configure those IN the ECOM100, and keep the To: field small (or even empty), to leave more room for the Subject: and Body: fields. In order for this ECOM100 IBox to function, you must turn ON dip switch 7 on the ECOM100 circuit board. ECEMAIL Parameters • ECOM100#: this is a logical number associated with this specific ECOM100 module in the specified slot. All other ECxxxx IBoxes that need to reference this ECOM100 module must reference this logical number • Workspace: specifies a V-memory location that will be used by the instruction • Success: specifies a bit that will turn on once the request is completed successfully • Error: specifies a bit that will turn on if the instruction is not successfully completed • Error Code: specifies the location where the Error Code will be written • To: specifies an E-mail address that the message will be sent to • Subject: subject of the e-mail message • Body: supports what the PRINT and VPRINT instructions support for text and embedded variables, allowing you to embed real-time data in the EMail message
DL05 Micro PLC User Manual, 6th Edition, Rev. A
Page 292
Chapter 5: Intelligent Box (IBox) - Communication
1 2 3 4 5 ECEMAIL Example Rung 1: The ECOM100 Config IBox is responsible for coordination/interlocking of all 6 ECOM100 type IBoxes for one specific ECOM100 module. Tag the ECOM100 in slot 1 as ECOM100# K0. All other ECxxxx IBoxes refer to this module # as K0. If you need to move the module in the base to a different slot, then you only need to change this one IBox. V400 7 is used as a global result status register for the other ECxxxx IBoxes using this specific ECOM100 module. V401 is used to coordinate/interlock the logic in all of the other ECxxxx 8 IBoxes using this specific ECOM100 module. V402-V502 is a common 130 byte buffer available for use by the other ECxxxx IBoxes using this specific ECOM100 module. 9 10 11 12 13 (example continued on next page) 14 A B C D Parameter
DL05 Range
ECOM100# . . . . . . . . . . . . . . . . . . . . . . . . . . . . K Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B Error Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V To: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Subject:. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Body:. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
K0-255 See DL05 V-memory map - Data Words See DL05 V-memory map See DL05 V-memory map See DL05 V-memory map Text Text See PRINT and VPRINT instructions
DL05 Micro PLC User Manual, 6th Edition, Rev. A
5–169
Page 293
Chapter 5: Intelligent Box (IBox) - Communication
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
ECEMAIL Example (cont’d)
5–170
Rung 2: When a machine goes down, send an email to Joe in maintenance and to the VP over production showing what machine is down along with the date/time stamp of when it went down. The ECEMAIL is leading edge triggered, not power-flow driven (similar to a counter input leg). An email will be sent whenever the power flow into the IBox goes from OFF to ON. This helps prevent self inflicted spamming. If the EMail is sent, turn on C100. If there is a failure, turn on C101. If it fails, you can look at V2000 for the SMTP error code or other possible error codes.
DL05 Micro PLC User Manual, 6th Edition, Rev. A