The text of a manual · part 39 of 40
DL05 Micro PLC User Manual, Volume 1 of 2: Chapter 5: Standard RLL and Intelligent Box Instructions, pages 364 to 373
Pages 364 to 373 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 364
Chapter 5: Intelligent Box (IBox) - Counter
CTRINTR Example Rung 3: This rung allows the programmer to reset the counter from the ladder logic.
Rung 4: This rung allows the operator to enable output #0 from the ladder code.
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–241
Page 365
Chapter 5: Intelligent Box (IBox) - Counter
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
CTRIO Load Profile (CTRLDPR) (IB-1001) DS5
Used
HPP
N/A
5–242
CTRIO Load Profile loads a CTRIO Profile File to a CTRIO Output resource on a leading edge transition to this IBox. This IBox will take more than 1 PLC scan to execute. Either the Success or Error bit will turn on when the command is complete. If the Error Bit is on, you can use the CTRIO Read Error Code (CTRRDER) IBox to get extended error information. The Workspace register is for internal use by this IBox instruction and MUST NOT be used anywhere else in your program.
CTRLDPR Parameters • CTRIO#: specifies a specific CTRIO module based on a user defined number (see CTRIO Config) • Output#: specifies a CTRIO output to be used by the instruction • File#: specifies a CTRIO profile File number to be loaded • Workspace: specifies a V-memory location that will be used by the instruction • Success: specifies a bit that will turn on once the instruction has successfully completed • Error: specifies a bit that will turn on if the instruction does not complete successfully
Parameter CTRIO# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K Output# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K File# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V,K Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B
DL05 Range K0-255 K0-3 K0-255; See DL05 V-memory map - Data Words See DL05 V-memory map - Data Words See DL05 V-memory map See DL05 V-memory map
DL05 Micro PLC User Manual, 6th Edition, Rev. A
Page 366
Chapter 5: Intelligent Box (IBox) - Counter
CTRLDPR Example
1 2 3 4 5 6 Rung 2: This CTRIO Load Profile IBox will load File #1 into the working memory of 7 Output 0 in CTRIO #1. This example program requires that you load CTRLDPR_IBox.cwb into your Hx-CTRIO module. 8 9 10 11 12 13 Rung 3: If the file is successfully loaded, set Profile_Loaded. 14 A B C D Rung 1: This sets up the CTRIO card in slot 2 of the local base. Each CTRIO in the system will need a separate CTRIO I-box before any CTRxxxx I-boxes can be used for them. The CTRIO has been configured to use V2000 through V2025 for its input data, and V2030 through V2061 for its output data.
DL05 Micro PLC User Manual, 6th Edition, Rev. A
5–243
Page 367
Chapter 5: Intelligent Box (IBox) - Counter
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
CTRIO Read Error (CTRRDER) (IB-1014) DS5
Used
HPP
N/A
5–244
CTRIO Read Error Code will get the decimal error code value from the CTRIO module (listed below) and place it into the given Error Code register, on a leading edge transition to the IBox Since the Error Code in the CTRIO is only maintained until another CTRIO command is given, you must use this instruction immediately after the CTRIO IBox that reports an error via its Error bit parameter. The Workspace register is for internal use by this IBox instruction and MUST NOT be used anywhere else in your program. Error Codes: 0: No Error 100: Specified command code is unknown or unsupported 101: File number not found in the file system 102: File type is incorrect for specified output function 103: Profile type is unknown 104: Specified input is not configured as a limit on this output 105: Specified limit input edge is out of range 106: Specified input function is unconfigured or invalid 107: Specified input function number is out of range 108: Specified preset function is invalid 109: Preset table is full 110: Specified Table entry is out of range 111: Specified register number is out of range 112: Specified register is an unconfigured input or output 2001: Error reading Error Code - cannot access CTRIO via ERM CTRRDER Parameters • CTRIO#: specifies a specific CTRIO module based on a user defined number (see CTRIO Config) • Workspace: specifies a V-memory location that will be used by the instruction • Error Code: specifies the location where the Error Code will be written
Parameter CTRIO# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V Error Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
DL05 Range K0-255 See DL05 V-memory map - Data Words See DL05 V-memory map - Data Words
DL05 Micro PLC User Manual, 6th Edition, Rev. A
Page 368
Chapter 5: Intelligent Box (IBox) - Counter
CTRRDER Example
1 2 3 4 5 6 7 Rung 2: This CTRIO Read Error Code IBox will read the Extended Error information from 8 CTRIO #1. This example program requires that you load CTRRDER_IBox.cwb into your Hx-CTRIO module. 9 10 11 12 13 14 A B C D Rung 1: This sets up the CTRIO card in slot 2 of the local base. Each CTRIO in the system will need a separate CTRIO I-box before any CTRxxxx I-boxes can be used for them. The CTRIO has been configured to use V2000 through V2025 for its input data, and V2030 through V2061 for its output data.
DL05 Micro PLC User Manual, 6th Edition, Rev. A
5–245
Page 369
Chapter 5: Intelligent Box (IBox) - Counter
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
CTRIO Run to Limit Mode (CTRRTLM) (IB-1011) DS5
Used
HPP
N/A
5–246
CTRIO Run To Limit Mode, on a leading edge transition to this IBox, loads the Run to Limit command and given parameters on a specific Output resource. The CTRIO's Input(s) must be configured as Limit(s) for this function to work. Valid Hexadecimal Limit Values: K00 - Rising Edge of Ch1/C K10 - Falling Edge of Ch1/C K20 - Both Edges of Ch1/C K01 - Rising Edge of Ch1/D K11 - Falling Edge of Ch1/D K21 - Both Edges of Ch1/D K02 - Rising Edge of Ch2/C K12 - Falling Edge of Ch2/C K22 - Both Edges of Ch2/C K03 - Rising Edge of Ch2/D K13 - Falling Edge of Ch2/D K23 - Both Edges of Ch2/D This IBox will take more than 1 PLC scan to execute. Either the Success or Error bit will turn on when the command is complete. If the Error Bit is on, you can use the CTRIO Read Error Code (CTRRDER) IBox to get extended error information. The Workspace register is for internal use by this IBox instruction and MUST NOT be used anywhere else in your program. CTRRTLM Parameters • CTRIO#: specifies a specific CTRIO module based on a user defined number (see CTRIO Config Ibox) • Output#: specifies a CTRIO output to be used by the instruction • Frequency: specifies the output pulse rate (20Hz - 20KHz) • Limit: the CTRIO's Input(s) must be configured as Limit(s) for this function to operate • Duty Cycle: specifies the % of on time versus off time. This is a hex number. Default of 0 is 50%, also entering 50 will yield 50%. 50% duty cycle is defined as on half the time and off half the time • Workspace: specifies a V-memory location that will be used by the instruction • Success: specifies a bit that will turn on once the instruction has successfully completed • Error: specifies a bit that will turn on if the instruction does not complete successfully
DL05 Micro PLC User Manual, 6th Edition, Rev. A
Page 370
Chapter 5: Intelligent Box (IBox) - Counter
1 2 3 4 5 CTRRTLM Example Rung 1: This sets up the CTRIO card in slot 2 of the local base. Each CTRIO in the system 6 will need a separate CTRIO I-box before any CTRxxxx I-boxes can be used for them. The CTRIO has been configured to use V2000 through V2025 for its input data, and V2030 through V2061 for its output data. 7 8 9 10 11 Rung 2: This CTRIO Run To Limit Mode IBox sets up Output #0 in CTRIO #1 to output 12 pulses at a Frequency of 1000 Hz until Llimit #0 comes on. This example program requires that you load CTRRTLM_IBox.cwb into your Hx-CTRIO module. 13 14 A B C D Parameter
CTRIO# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K Output# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K Frequency . . . . . . . . . . . . . . . . . . . . . . . . . . . V,K Limit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V,K Duty Cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . V,K Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B
DL05 Range
K0-255 K0-3 K20-20000; See DL05 V-memory map - Data Words K0-FF; See DL05 V-memory map - Data Words K0-99; See DL05 V-memory map - Data Words See DL05 V-memory map - Data Words See DL05 V-memory map See DL05 V-memory map
(example continued on next page)
DL05 Micro PLC User Manual, 6th Edition, Rev. A
5–247
Page 371
Chapter 5: Intelligent Box (IBox) - Counter
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
CTRRTLM Example (cont’d)
5–248
Rung 3: If the Run To Limit Mode parameters are OK, set the Direction Bit and Enable the output.
DL05 Micro PLC User Manual, 6th Edition, Rev. A
Page 372
Chapter 5: Intelligent Box (IBox) - Counter
CTRIO Run to Position Mode (CTRRTPM) (IB-1012) DS5
Used
HPP
N/A
1 2 3 4 5 6 7 8 9 CTRRTPM Parameters • CTRIO#: specifies a specific CTRIO module based on a user defined number (see CTRIO Config 10 Ibox) 11 • Output#: specifies a CTRIO output to be used by the instruction • Frequency: specifies the output pulse rate (20Hz - 20KHz) 12 • Duty Cycle: specifies the % of on time versus off time. This is a hex number. Default of 0 is 50%, also entering 50 will yield 50%. 50% duty cycle is defined as on half the time and off half the time • Position: specifies the count value, as measured on the encoder input, at which the output pulse 13 train will be turned off • Workspace: specifies a V-memory location that will be used by the instruction 14 • Success: specifies a bit that will turn on once the instruction has successfully completed • Error: specifies a bit that will turn on if the instruction does not complete successfully A Parameter DL05 Range B C D CTRIO Run To Position Mode, on a leading edge transition to this IBox, loads the Run to Position command and given parameters on a specific Output resource. Valid Function Values are: 00: Less Than Ch1/Fn1 10: Greater Than Ch1/Fn1 01: Less Than Ch1/Fn2 11: Greater Than Ch1/Fn2 02: Less Than Ch2/Fn1 12: Greater Than Ch2/Fn1 03: Less Than Ch2/Fn2 13: Greater Than Ch2/Fn2 This IBox will take more than 1 PLC scan to execute. Either the Success or Error bit will turn on when the command is complete. If the Error Bit is on, you can use the CTRIO Read Error Code (CTRRDER) IBox to get extended error information. The Workspace register is for internal use by this IBox instruction and MUST NOT be used anywhere else in your program.
CTRIO# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K Output# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K Frequency . . . . . . . . . . . . . . . . . . . . . . . . . . . V,K Duty Cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . V,K Position . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V,K Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B
K0-255 K0-3 K20-20000; See DL05 V-memory map - Data Words K0-99; See DL05 V-memory map K0-2147434528; See DL05 V-memory map See DL05 V-memory map - Data Words See DL05 V-memory map See DL05 V-memory map
DL05 Micro PLC User Manual, 6th Edition, Rev. A
5–249
Page 373
Chapter 5: Intelligent Box (IBox) - Counter
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
CTRRTPM Example
5–250
Rung 1: This sets up the CTRIO card in slot 2 of the local base. Each CTRIO in the system will need a separate CTRIO I-box before any CTRxxxx I-boxes can be used for them. The CTRIO has been configured to use V2000 through V2025 for its input data, and V2030 through V2061 for its output data.
Rung 2: This CTRIO Run To Position Mode IBox sets up Output #0 in CTRIO #1 to output pulses at a Frequency of 1000 Hz, use the 'Greater than Ch1/Fn1' comparison operator, until the input position of 1500 is reached. This example program requires that you load CTRRTPM_IBox.cwb into your Hx-CTRIO module.
Rung 3: If the Run To Position Mode parameters are OK, set the Direction Bit and Enable the output.
DL05 Micro PLC User Manual, 6th Edition, Rev. A