The text of a manual · part 52 of 53
DL06 Micro PLC User Manual, Volume 1 of 2, pages 510 to 519
Pages 510 to 519 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 510
Chapter 5: Intelligent Box (IBox) Instructions
CTRLDPR Example (cont’d)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
Rung 3: If the file is successfully loaded, set Profile_Loaded.
5–356
DL06 Micro PLC User Manual, 3rd Edition Rev. A
Page 511
Chapter 5: Intelligent Box (IBox) Instructions
CTRIO Read Error (CTRRDER) (IB-1014) DS5
Used
HPP
N/A
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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 CTRRDER Parameters A • 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 B • Error Code: specifies the location where the Error Code will be written C Parameter DL06 Range D
CTRIO# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V Error Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
K0-255 See DL06 V-memory map - Data Words See DL06 V-memory map - Data Words
DL06 Micro PLC User Manual, 3rd Edition Rev. A
5–357
Page 512
Chapter 5: Intelligent Box (IBox) Instructions
CTRRDER Example
1 2 3 4 5 6 7 8 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.
5–358
DL06 Micro PLC User Manual, 3rd Edition Rev. A
Rung 2: This CTRIO Read Error Code IBox will read the Extended Error information from CTRIO #1. This example program requires that you load CTRRDER_IBox.cwb into your Hx-CTRIO module.
Page 513
Chapter 5: Intelligent Box (IBox) Instructions
CTRIO Run to Limit Mode (CTRRTLM) (IB-1011) DS5
Used
HPP
N/A
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
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–359
Page 514
Chapter 5: Intelligent Box (IBox) Instructions Parameter
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
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
DL06 Range K0-255 K0-3 K20-20000; See DL06 V-memory map - Data Words K0-FF; See DL06 V-memory map - Data Words K0-99; See DL06 V-memory map - Data Words See DL06 V-memory map - Data Words See DL06 V-memory map See DL06 V-memory map
CTRRTLM Example
5–360
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 Limit Mode IBox sets up Output #0 in CTRIO #1 to output 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.
(example continued on next page)
DL06 Micro PLC User Manual, 3rd Edition Rev. A
Page 515
Chapter 5: Intelligent Box (IBox) Instructions
CTRRTLM Example (cont’d) Rung 3: If the Run To Limit Mode parameters are OK, set the Direction Bit and Enable the output.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
DL06 Micro PLC User Manual, 3rd Edition Rev. A
5–361
Page 516
Chapter 5: Intelligent Box (IBox) Instructions
CTRIO Run to Position Mode (CTRRTPM) (IB-1012)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
DS5
Used
HPP
N/A
5–362
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. CTRRTPM 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) • 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 train will be turned off • 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
DL06 Micro PLC User Manual, 3rd Edition Rev. A
Page 517
Chapter 5: Intelligent Box (IBox) Instructions
Parameter
DL06 Range
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 DL06 V-memory map - Data Words K0-99; See DL06 V-memory map K0-2147434528; See DL06 V-memory map See DL06 V-memory map - Data Words See DL06 V-memory map See DL06 V-memory map
CTRRTPM Example 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.
(example continued on next page)
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–363
Page 518
Chapter 5: Intelligent Box (IBox) Instructions
CTRRTPM Example (cont’d)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
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.
5–364
DL06 Micro PLC User Manual, 3rd Edition Rev. A
Rung 3: If the Run To Position Mode parameters are OK, set the Direction Bit and Enable the output.
Page 519
Chapter 5: Intelligent Box (IBox) Instructions
CTRIO Velocity Mode (CTRVELO) (IB-1013) DS5
Used
HPP
N/A
CTRIO Velocity Mode loads the Velocity command and given parameters on a specific 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. CTRVELO 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) • 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 • Step Count: specifies the target position as a 32-bit Hex number, a value of Kffffffff will cause the profile to run continuously as long as the output is enabled • 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
DL06 Range
CTRIO# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K Output# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K Frequency . . . . . . . . . . . . . . . . . . . . . . . . . . . V,K Duty Cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . V,K Step Count . . . . . . . . . . . . . . . . . . . . . . . . . . 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 DL06 V-memory map - Data Words K0-99; See DL06 V-memory map K0-2147434528; See DL06 V-memory map See DL06 V-memory map - Data Words See DL06 V-memory map See DL06 V-memory map
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–365