Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeContact

The text of a manual · part 43 of 53

DL06 Micro PLC User Manual, Volume 1 of 2, pages 420 to 429

Pages 420 to 429 of 524

The original document is the PDF (6.4 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 Direct Logic DL06 and Koyo DL06 D0-06DD1

Page 420

Chapter 5: Intelligent Box (IBox) Instructions

Square Binary (SQUAREB) (IB-503)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D

DS5

Used

HPP

N/A

Square Binary squares the given 16-bit WORD Binary number and writes it as a 32-bit DWORD Binary result. SQUAREB Parameters • Value (WORD Binary): specifies the binary Word or constant that will be squared • Result (DWORD Binary): specifies the location where the squared DWORD binary value will be placed

Parameter Value (WORD Binary) . . . . . . . . . . . . . . . . V,P,K Result (DWORD Binary) . . . . . . . . . . . . . . . . . . V

DL06 Range K0-65535; See DL06 V-memory map - Data Words See DL06 V-memory map - Data Words

SQUAREB Example

5–266

In the following example, the SQUAREB instruction is used to square the single word Binary value in V2000 and store the 8-digit double word Binary result in V3000 and V3001.

DL06 Micro PLC User Manual, 3rd Edition Rev. A

Page 421

Chapter 5: Intelligent Box (IBox) Instructions

Square Real (SQUARER) (IB-543) DS5

Used

HPP

N/A

Square Real squares the given REAL DWORD number and writes it to a REAL DWORD result. SQUARER Parameters • Value (REAL DWORD): specifies the Real DWORD location or number that will be squared • Result (REAL DWORD): specifies the location where the squared Real DWORD value will be placed

Parameter Value (REAL DWORD) . . . . . . . . . . . . . . . . V,P,R Result (REAL DWORD) . . . . . . . . . . . . . . . . . . . V

DL06 Range R ; See DL06 V-memory map - Data Words See DL06 V-memory map - Data Words

SQUARER Example In the following example, the SQUARER instruction is used to square the 32-bit floating point REAL value in V2000 and V2001 and store the REAL value result in V3000 and V3001.

DL06 Micro PLC User Manual, 3rd Edition Rev. A

1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D

5–267

Page 422

Chapter 5: Intelligent Box (IBox) Instructions

Sum BCD Numbers (SUMBCD) (IB-522)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D

DS5

Used

HPP

N/A

Sum BCD Numbers sums up a list of consecutive 4-digit WORD BCD numbers into an 8digit DWORD BCD result. You specify the group's starting and ending V- memory addresses (inclusive). When enabled, this instruction will add up all the numbers in the group (so you may want to place a differential contact driving the enable). SUMBCD could be used as the first part of calculating an average. SUMBCD Parameters • Start Address: specifies the starting address of a block of V-memory location values to be added together (BCD) • End Addr (inclusive): specifies the ending address of a block of V-memory location values to be added together (BCD) • Result (DWORD BCD): specifies the location where the sum of the block of V-memory BCD values will be placed

Parameter Start Address . . . . . . . . . . . . . . . . . . . . . . . . . . V End Address (inclusive) . . . . . . . . . . . . . . . . . . V Result (DWORD BCD) . . . . . . . . . . . . . . . . . . . . V

DL06 Range See DL06 V-memory map - Data Words See DL06 V-memory map - Data Words See DL06 V-memory map - Data Words

SUMBCD Example

5–268

In the following example, the SUMBCD instruction is used to total the sum of all BCD values in words V2000 thru V2007 and store the resulting 8-digit double word BCD value in V3000 and V3001.

DL06 Micro PLC User Manual, 3rd Edition Rev. A

Page 423

Chapter 5: Intelligent Box (IBox) Instructions

Sum Binary Numbers (SUMBIN) (IB-502) DS5

Used

HPP

N/A

Sum Binary Numbers sums up a list of consecutive 16-bit WORD Binary numbers into a 32bit DWORD binary result. You specify the group's starting and ending V- memory addresses (inclusive). When enabled, this instruction will add up all the numbers in the group (so you may want to place a differential contact driving the enable). SUMBIN could be used as the first part of calculating an average. SUMBIN Parameters • Start Address: specifies the starting address of a block of V-memory location values to be added together (Binary) • End Addr (inclusive): specifies the ending address of a block of V-memory location values to be added together (Binary) • Result (DWORD Binary): specifies the location where the sum of the block of V-memory binary values will be placed

Parameter Start Address . . . . . . . . . . . . . . . . . . . . . . . . . . V End Address (inclusive) . . . . . . . . . . . . . . . . . . V Result (DWORD Binary) . . . . . . . . . . . . . . . . . . V

DL06 Range See DL06 V-memory map - Data Words See DL06 V-memory map - Data Words See DL06 V-memory map - Data Words

SUMBIN Example In the following example, the SUMBIN instruction is used to total the sum of all Binary values in words V2000 thru V2007 and store the resulting 8-digit double word Binary value in V3000 and V3001.

DL06 Micro PLC User Manual, 3rd Edition Rev. A

1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D

5–269

Page 424

Chapter 5: Intelligent Box (IBox) Instructions

Sum Real Numbers (SUMR) (IB-542)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D

DS5

Used

HPP

N/A

Sum Real Numbers sums up a list of consecutive REAL DWORD numbers into a REAL DWORD result. You specify the group's starting and ending V- memory addresses (inclusive). Remember that Real numbers are DWORDs and occupy 2 words of V memory each, so the number of Real values summed up is equal to half the number of memory locations. Note that the End Address can be EITHER word of the 2 word ending address, for example, if you wanted to add the 4 Real numbers stored in V2000 thru V2007 (V2000, V2002, V2004, and V2006), you can specify V2006 OR V2007 for the ending address and you will get the same result. When enabled, this instruction will add up all the numbers in the group (so you may want to place a differential contact driving the enable). SUMR could be used as the first part of calculating an average.

SUMR Parameters

5–270

• Start Address (DWORD): specifies the starting address of a block of V-memory location values to be added together (Real) • End Addr (inclusive) (DWORD): specifies the ending address of a block of V-memory location values to be added together (Real) • Result (DWORD): specifies the location where the sum of the block of V-memory Real values will be placed

Parameter Start Address (inclusive DWORD) . . . . . . . . . V End Address (inclusive DWORD) . . . . . . . . . . V Result (DWORD) . . . . . . . . . . . . . . . . . . . . . . . . V

DL06 Range See DL06 V-memory map - Data Words See DL06 V-memory map - Data Words See DL06 V-memory map - Data Words

DL06 Micro PLC User Manual, 3rd Edition Rev. A

Page 425

Chapter 5: Intelligent Box (IBox) Instructions

SUMR Example In the following example, the SUMR instruction is used to total the sum of all floating point REAL number values in words V2000 thru V2007 and store the resulting 32-bit floating point REAL number value in V3000 and V3001.

DL06 Micro PLC User Manual, 3rd Edition Rev. A

1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D

5–271

Page 426

Chapter 5: Intelligent Box (IBox) Instructions

ECOM100 Configuration (ECOM100) (IB-710)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D

DS5

Used

HPP

N/A

5–272

ECOM100 Configuration defines all the common information for one specific ECOM100 module which is used by the other ECOM100 IBoxes; for example, ECRX - ECOM100 Network Read , ECEMAIL - ECOM100 Send EMail, ECIPSUP - ECOM100 IP Setup, etc. You MUST have the ECOM100 Configuration IBox at the top of your ladder/stage program with any other configuration IBoxes. The Message Buffer parameter specifies the starting address of a 65 WORD buffer. This is 101 Octal addresses (e.g. V1400 thru V1500). If you have more than one ECOM100 in your PLC, you must have a different ECOM100 Configuration IBox for EACH ECOM100 module in your system that utilizes any ECOM IBox instructions. The Workspace and Status parameters and the entire Message Buffer are internal, private registers used by the ECOM100 Configuration IBox and MUST BE UNIQUE in this one instruction and MUST NOT be used anywhere else in your program. In order for MOST ECOM100 IBoxes to function, you must turn ON dip switch 7 on the ECOM100 circuit board. You can keep dip switch 7 off if you are ONLY using ECOM100 Network Read and Write IBoxes (ECRX, ECWX). Since this logic only executes on the first scan, this IBox cannot have any input logic. ECOM100 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 • Slot: specifies the option slot the module occupies • Status: specifies a V-memory location that will be used by the instruction • Workspace: specifies a V-memory location that will be used by the instruction • Msg Buffer: specifies the starting address of a 65 word buffer that will be used by the module for configuration

Parameter ECOM100# . . . . . . . . . . . . . . . . . . . . . . . . . . . . K Slot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V Msg Buffer (65 words used) . . . . . . . . . . . . . . . V

DL06 Range K0-255 K1-4 See DL06 V-memory map - Data Words See DL06 V-memory map - Data Words See DL06 V-memory map - Data Words

DL06 Micro PLC User Manual, 3rd Edition Rev. A

Page 427

Chapter 5: Intelligent Box (IBox) Instructions

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.

Permissive contacts or input logic cannot be used with this instruction

DL06 Micro PLC User Manual, 3rd Edition Rev. A

1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D

5–273

Page 428

Chapter 5: Intelligent Box (IBox) Instructions

ECOM100 Disable DHCP (ECDHCPD) (IB-736)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D

DS5

Used

HPP

N/A

5–274

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 first 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

DL06 Range K0-255 See DL06 V-memory map - Data Words See DL06 V-memory map See DL06 V-memory map See DL06 V-memory map - Data Words

DL06 Micro PLC User Manual, 3rd Edition Rev. A

Page 429

Chapter 5: Intelligent Box (IBox) Instructions

ECDHCPD Example 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.

1 2 3 4 5 6 7 8 9 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 hard10 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 11 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 12 C101. If it fails, you can look at V2000 for the specific error code. 13 14 A B C D DL06 Micro PLC User Manual, 3rd Edition Rev. A

5–275