Home
Chapter 6 - AutomationDirect
Contents
1. Above arsine Stating addens to mend ovenae oI froze arg assen sal Sting Vase ba b uns CEES Reo cams pams pans rou Furctone Oupa Functions System Functions os Mt Cand Courter DiNi ape Tene a ortn 1 row Data CTD Cortoter rou Daa TRIO gt Cormeen Oupa Data Corti TRIO Opus Dana Korido CTRA Ouspns Data Coridor dCTFOO Ouspas Data Corton TARO VeRITTiraati r es a foe a I O Map with EBC WinPLC When using the CTRIO module in an EBC WinPLC system non PLC system the addressing will be shown as Native EBC WinPLC addresses or if using Think amp Do ne addressing can be shown as Native Think amp Do addresses Just click on the desired mode in the ene Map Display Mode field The 8 pt module offset or described in the note above does not apply to EBC WinPLC or EBC Think amp Do systems Counter I O User Manual 2nd Ed Rev D 6 11 Chapter 6 Program Control I O Map with an H2 PBC or T1H PBC Profibus DP Controller When using the CTRIO module with an H2 PBC or T1H PBC native Profibus addressing will be displayed in the I O Map as shown below For the T1H PBC the first two output bytes of memory are automatically reserved for the Hot Swap base rescan feature The H2 PBC does not support the Hot Swap feature H2 PBC I O Map T1H PBC I O Map ita if One Map Fae K wou furcnore Lisanti rors Note that output bytes 0
2. OUT VC160 Counter I O User Manual 2nd Ed Rev D 6 17 Chapter 6 Program Control EMMI Input Functions Counter amp Quadrature Counter Parameters 1 and 2 are explained on page 6 16 and will be mapped to V2000 V2003 in this example If input D is configured for count Capture the Enable Count Capture bit must be ON in order for input D to be able to snapshot the current count The Count Capture Complete bit is used to indicate the acquisition has occurred The program will need to turn OFF the Enable Capture and confirm the Capture Complete bit resets before attempting the next count capture The Reset bit will reset raw and scaled values to the specified reset value The last captured value if applicable will remain PLC Control Outputs Base Addr V2030 Bit of Word PLC Status Inputs Base Addr V2000 Bit of Word PLC Control Outputs Base Addr V2030 Control Relay D2 240 PLC Status Inputs Base Addr V2000 Control Relay D2 240 Description Parameter 1 V2001 V2000 V2001 V2000 refer to table on page 6 16 Parameter 2 V2003 V2002 V2003 V2002 refer to table on page 6 16 Counter Capture Complete V2020 0 C160 On when Count Capture is complete Available only when input D is configured for Capture input Enable Count Capture V2054 0 Turn ON to Capture Count Available only when input D is configured for Capture input Reset V2
3. dwX1 n 2 Ch 1 Fn 1 Parameter 2 DWord dwX2 n 4 Ch 1 Fn 2 Parameter 1 DWord dwX3 n 6 Ch 1 Fn 2 Parameter 2 DWord dwX4 n 10 Ch 2 Fn 1 Parameter 1 DWord dwX5 n 12 Ch 2 Fn 1 Parameter 2 DWord dwX6 n 14 Ch 2 Fn 2 Parameter 1 DWord dwX7 n 16 Ch 2 Fn 2 Parameter 2 DWord bX0 7 bX8 15 n 20 Ch 1 Fn 1 Status Low Byte Ch 1 Fn 2 Status High Byte Word 4 4 4 4 4 4 4 4 2 bX16 23 bX24 31 n 21 Ch 2 Fn 1 Status righ ats Ch 2 Fn 2 Status High Byte Word bX32 39 bX40 47 n 22 Output 0 Status Low Byte Word bX48 55 bX56 63 n 23 Output 1 Status High Byte Output 2 Status Low Byte Output 3 Status High Byte Word bX64 71 bX72 bx80 bx88 n 24 Input n Parameter Definitions Parameter values are in Decimal format Configured Function from CTRIO Workbench System Functions Read Write CTRIO Internal Registers see p 6 6 for bit definitions DWord 44 Total Bytes Parameter 1 Contents DWORD Parameter 2 Contents DWORD Non scaled Counter Raw Input Value Not Used Scaled Counter Scaled Value pos or rate Raw Value Non scaled Counter with Capture Raw Value Captured Value Scaled Counter with Capture Scaled Value pos or rate Captured Value Non scaled Timer Previous Time us In
4. LD VC220 OUT V2056 LD V2022 OUT VC120 NOTE 2 For example DirectSOFT uses B2022 2 in the ladder code to indicate that you are addressing the I third bit of V memory register 2022 The B prefix indicates bit of word addressing Counter I O User Manual 2nd Ed Rev D 6 29 Chapter 6 Program Control so RRR RRR Pulse Output Profiles DL PLCs Loading a pre defined Pulse Profile is the easiest method for pulse output motion control Command Code 0010 Hex BCD For the Trapezoid S Curve Symmetrical S Curve Home Search and Free Form profiles all of the required characteristics of acceleration run frequency and total pulse count etc are entered in the CTRIO Workbench Pulse Profile entry window For Dynamic Positioning Dynamic Positioning Plus Trapezoid Plus Trapezoid with Limits and Dynamic Velocity profiles the target position and target velocity are stored in a memory location in the controller All other profile characteristics are entered in the CTRIO Workbench Pulse Profile entry window For Velocity Mode Command Code 0020 Hex BCD Run to Limit Mode Command Code 21 Hex BCD and Run to Position Mode Command Code 22 Hex BCD all 6 profile parameters are stored in the controllers memory registers No CTRIO Workbench Pulse Profile is required In order to process a command first the program must load the Command Code and required DWord Word a
5. V2020 1 C161 Counting ON when Timer Capture complete oT rr On when specified Timer Time Out period Timer Timed Out Bit 2020 2 C162 is exceeded Pulse Catch Output ON for the specified pulse time if input pulse Pulse State v2020 0 C160 qualifies as a valid pulse Pulse Catch Starting V2020 1 C161 ON when pulse edge occurs Parameter 1 V2001 V2000 V2001 V2000 Decimal Parameter 2 V 2003 V2002 V 2003 V2002 Decimal Control Registers Example using V2030 as base output address for Input Channel 1 Control bits sent from CPU to CTRIO PLC Example 1 Bit of Word PLC Example 2 Control Relay see Name see note 2 D2 250 1 260 D4 450 note 1 D2 240 CPU Format Enable Counter Capture 2054 0 C260 Bit Enable Timer Capture 2054 0 C260 Bit Enable Pulse Catch 2054 0 C260 Bit Reset 2054 1 C261 Bit 6 16 Counter I O User Manual 2nd Ed Rev D Chapter 6 Program Control Memory Mapping Example for D2 240 CPU NOTE 1 The D2 240 CPU does not support bit of word addressing The status and control bits must be mapped to control relay words An example of mapping code is shown below SP 1 NOTE 2 For example DirectSOFT uses B2020 1 in the ladder code to indicate that you are addressing the second bit of V memory register 2020 The B prefix indicates bit of word addressing LD VC260 OUT V2054 LD V2020
6. 01 Read All Registers to the CTRIO at address 80 Make sure the parameters you re using are correct SET Process Command Is Command Complete ON Use ThinknDo s Call Block to read the 8 DWORD values from the CTRIO s shared RAM at address 82 Chapter 6 Program Control ST Writing to All CTRIO s Internal Registers Flowcharts The flowcharts below provide the logical sequence necessary to Write to all of the CTRIO s internal registers Writing to the CTRIO s internal registers is a two step process 1 Transfer the data values from the controller s memory to the CTRIO s shared RAM 2 Ask the CTRIO to transfer these values from its shared RAM to it s internal registers ThinknDo Write to CTRIO DirectLOGIC Write to CTRIO Use ThinknDo s Call Block to write the 2 byte command code 02 Write All Registers and the 8 DWORD values to the CTRIO s shared RAM at Address 80 Use the PLC s WT instruction to transfer the 2 byte command code 02 Write All Registers and the 32 bytes of data to the CTRIO s shared RAM at Address 80 Make sure the Hae parameters Command you re using are correct Make sure the nee parameters Command you re using are correct Is Command Complete ON Is Command Complete ON Counter I O User Manual 2nd Ed Rev D 6 49 Chapter 6 Program Control i aMMMMMMMM iMMMMMMMMMMMMM
7. 1000 less than Chi Fn2 01 0100 1100 0200 1200 0300 1300 greater than Ch1 Fn2 less than Ch2 Fn1 greater than Ch2 Fn1 less than Ch2 Fn2 greater than Ch2 Fn2 Oo oO S CO Comparison Bits 15 12 Input Function Bits 11 8 Greater Than or Equal 0001 1Hex Ch 1 Fn 1 0000 OHex Less Than 0000 OHex Ch 1 Fn2 0001 1Hex Ch 2 Fn 1 0010 2Hex Ch 2 Fn2 0011 3Hex 6 44 Counter I O User Manual 2nd Ed Rev D Chapter 6 Program Control Run to Position Mode Flowchart The flowchart below provides the logical sequence necessary to execute a Run to Position Mode pulse profile Load 22 into Command Code Hex Load Frequency into Parameter 1 Decimal Edl ae Load Function Duty Cycle into Parameter 2 Hex a Load Position value into Parameter 3 Decimal J SET Process Command ON Make sure the Input is configured as a Counter Command Complete RESET Process Command RESET Process Command Select Direction At this point the CTRIO will begin outputting pulses _ SET Output Enable You can change the Frequency and or the Duty Cycle as often as you need you can even change them while the output is active Load new parameter values New Frequency or Duty Cycle The Output Active bit will be ON until the CTRIO sends out all of
8. CPU to CTRIO Bit Offsets WinPLC EBC PBC DEVNETS MODBUS V memory Offsets from Output Start octal 22 7 23 7 Read as Enable Output 32 48 26 0 27 0 Level Go to Position 33 49 26 1 27 1 Rising Edge Suspend Output 34 50 26 2 27 2 Level Direction 36 52 26 4 27 4 Level Process Command 39 55 26 7 27 7 Output Control D Words Pulse Output Pulse output control Offsets are listed in the order of Outputs 0 1 2 3 Word Control CPU to CTRIO Word Offsets WinPLC EBC PBC DEVNETS MODBUS Rising Edge V memory Offsets from Output Start octal Command Code 0 6 10 16 Word Parameter 1 7 11 17 Word Parameter 2 DWord Control CPU to CTRIO 2 8 Word Offsets WinPLC EBC PBC DEVNETS MODBUS 12 20 V memory Offsets from Output Start octal DWord Parameter 3 0 2 6 26 Counter I O User Manual 2nd Ed Rev D 0 4 Chapter 6 Program Control SS Command Code and Parameter Definitions Command HowBeD Sascha Word Parameter 2 DWord Parameter 3 Trapezoid or S curve Symmetrical S Curve Load Table from ROM Home Search File Number Load Table from ROM ee Target Position decimal Load Table from ROM E TE e a Target Velocity decimal Velocity Mode ONE AeA Duty OD 99 Number of Pulses BCD Hex Edge amp mi Run Frequency Run to Limit Mode 20Hz 25KHz Duty
9. Control Relay D2 240 PLC Status Inputs Base Addr V2000 Control Relay D2 240 Action Command Code V2040 2040 Set to 20 Hex Pulse at Velocity Parameter 1 V2041 V2041 Set initial run frequency 20Hz 25000HZz decimal Parameter 2 V2042 V2042 Duty cycle f 99 can leave 0 for 50 decimal Parameter 3 V2031 V2030 V2031 V2030 Number of pulses DWord set to FFFF FFFF for no limit Hex Set Direction V2056 4 C224 Set ON or OFF for Direction of Rotation Process Command V2056 7 C227 Turn ON Command Complete status bit is returned see step 4 Command Status V2022 7 When ON command has been accepted clear Process Command bit step 3 Command Error V2022 6 ON if Command or Parameters are invalid Enable Output V2056 0 Turn ON to start pulses Disable Output V2056 0 Turn OFF to start pulses Suspend Output V2056 2 Turn ON to pause output pulses without resetting pulse count Output Suspended V2022 2 ON when out pulse train has been suspended While Velocity Mode Control is running Run Frequency step 2 and Duty Cycle step 3 may be actively changed simply by writing a new Parameter value Since no accel decel parameters are specified in this profile the output change is a step response Counter I O User Manual 2nd Ed Rev D 6 39 Chapter 6 Pr
10. Corton Oupa Data oriai CTR Oups Date Corteatier ETANO Oupa Data Corisdora CTF Oraa Datta Corteaten 9 CTAN PaE hoa NOA Era _ TO DEA Urubi Case Ca J _ o jme e j NOTE This mode exists specifically for using the CTRIO with the D2 240 CPU If not using the D2 240 CPU then use the 2 ranges mode mentioned on the previous page 6 10 Counter I O User Manual 2nd Ed Rev D Chapter 6 Program Control T O Map with DirectLOGIC PLC with CTRIO in ERM EBC Network When using the CTRIO module with a DirectLOGIC PLC with the CTRIO module in an ERM EBC network first configure the ERM network using the ERM Workbench utility Then from ERM Workbench enter the CTRIO s starting input and output V Map addresses into the CTRIO Workbench s I O Map starting V memory location for the bt inputs and outputs V Map location due to the 8 pt discrete input module preceeding the CTRIO module tne tery waaa aint t me oe DFU enith oot TISTET rE See Note a NOTE If there is an 8 pt discrete I O module preceeding the CTRIO module in the EBC base enter the the appropriate starting V memory bit I O address in CTRIO Workbench with a V40xxx 8 address as shown in 1 0 Map example below to the right This corrects the word offset created by the 8 pt discrete I O module In the example below to the left note that V40416 Hi 8 15 is the starting ERM Workbench CTRIO input
11. Counting 1 9 17 25 20 1 20 9 21 1 21 9 Timer Timed Out Bit 2 10 18 29 20 2 20 10 21 2 21 10 Pulse Catch Output Pulse State 0 8 16 24 20 0 20 8 21 0 21 8 Pulse Catch Start 1 9 17 25 Input Function Control Bit Definitions Input function offsets are listed in the order of Ch1 Fn1 Ch1 Fn2 Ch2 Fn1 Ch2 Fn2 Ch n Fn n Control Bits transfers from CPU to CTRIO Bit Offsets WinPLC EBC PBC DEVNETS MODBUS 20 1 20 9 21 1 21 9 V memory Offsets DirectLOGIC PLCs Enable Count Capture 0 8 16 24 24 0 24 8 25 0 25 8 Enable Timer Capture 0 8 16 24 24 0 24 8 25 0 25 8 Enable Pulse Catch 0 8 16 24 24 0 24 8 25 0 25 8 Reset 1 9 17 25 Input Function Status DWord Parameters Input function offsets are listed in the order of Ch1 Fn1 Ch1 Fn2 Ch2 Fn1 Ch2 Fn2 and are in decimal format DWord Status CTRIO to CPU DWord Offsets WinPLC EBC PBC DEVNETS MODBUS 24 1 24 9 25 1 25 9 V memory Offsets from Output Start octal DWord Parameter 1 0 2 4 6 0 4 10 14 DWord Parameter 2 Configured Function from CTRIO Workbench 1 3 5 7 Parameter 1 Contents DWORD 2 6 12 16 Parameter 2 Contents DWORD Non scaled Counter Raw Input Value Not Used Scaled Counter Scaled Value pos or rate Raw Value Non scaled Counter with Capture Raw Valu
12. Progress Time us Scaled Timer Scaled Interval rate In Progress Time us Pulse Catch Not Used Counter I O User Manual 2nd Ed Rev D Not Used Chapter 6 Program Control Input Function Status Bit Definitions Input function offsets are listed in the order of Ch1 Fn1 Ch1 Fn2 Ch2 Fn1 Ch2 Fn2 Ch x Fn x Status Bits transfers from CTRIO to CPU Bit Offsets WinPLC EBC PBC DEVNETS MODBUS NOTE For DirectSOFT users the 1 0 Map dialog displays the exact memory locations in use by the CTRIO module Within the I O Map dialog you can print out a report of memory loctions in use V memory Offsets DirectLOGIC PLCs Count Capture Complete Bit 0 8 16 24 20 0 20 8 21 0 21 8 Timer Capture Start 0 8 16 24 20 0 20 8 21 0 21 8 Timer Capture Complete Timing OR At Reset Value Counting 1 9 17 25 20 1 20 9 21 1 21 9 Timer Timed Out Bit 2 10 18 29 20 2 20 10 21 2 21 10 Pulse Catch Output Pulse State 0 8 16 24 20 0 20 8 21 0 21 8 Pulse Catch Start 1 9 17 25 20 1 20 9 21 1 21 9 Output Status Bit Definitions for Preset Table Control Output Status Offsets are listed in the order of the Output 0 Output 3 Output x Status Bits transfers from CTRIO to CPU Bit Offsets WinPLC EBC PBC DEVNETS MODBUS V memory Offsets DirectLOGIC PLCs Command Error 38 46 54 62 22 6 22
13. a different value into the target velocity register The velocity will ramp up down to the new target velocity at the specified accel decel rates Clearing the Enable Output bit will always suspend pulsing See Chapter 8 for a DirectLOGIC programming example that executes a Dynamic Velocity pulse profile using the bit D word addressing in the table below Dynamic Velocity using the CTRIO YO and Y1 PEE controll RUG Stained oae Cono mace Sras utputs Base Inputs Base Name Outputs Base Inputs Base Addr V2030 Addr V2000 Acti z ction Peal IE eA Control Relay Control Relay Bit of Word Bit of Word 240 Command vV2040 V2040 Set to 10 Load Stored Profile File containing cw accel decel and Parameter 1 V2041 V2041 cew acccel decel Process Turn ON until Command Complete Command V2056 7 C227 status bit is returned Command rar When ON Profile is now loaded eamipete V2022 7 clear Process Command bit Command ON if Command or Parameters are Error V2022 6 invalid Turn ON to ramp to target velocity Enable Output V2056 0 C220 Turn OFF to disable pulses Parameter 3 V2031 V2030 aoe Target velocity User defined DWord a active 2022 4 When ON module is pulsing Suspend Turn ON to pause output pulses Output V2056 2 without resetting pulse count Output ON when out pulse train has been Suspended V2022 2 suspended The sign of the value in the Ta
14. aD 99 Run Frequency Buty cycle 10 10 00 Desired Input Function Value Run to Position Mode 20Hz 25KHz Hex BCD decimal A value of 0 will generate a duty cycle of 50 Fields above separated by an amp indicate a code with different definitions for each byte high byte and low byte For example to enter the Pulse Output to Limit command set the high byte of the Word Parameter 2 to the edge you wish to terminate the output pulses see definition following and set the low byte to the desired duty cycle In order to process a command first the program must load the Command Code and required DWord Word and bit parameters Then the program should drive the Process Command bit to a 1 and look for the CTRIO to acknowledge the command with the Command Complete bit Finally the program should remove the Process Command bit and set the Enable Output bit when appropriate If the Command Error bit is received the CTRIO was unable to process the command due to an illegal value in either the Command Code or parameter files DWord and Word values for pulse outputs are unsigned integers Counter I O User Manual 2nd Ed Rev D 6 27 Chapter 6 Program Control EY Status Bits Example using V2000 as base input address For Output Channel 1 Status bits received from CTRIO to CPU Name PLC Example 1 Bit of Word see note 2 D2 250 1 260 D4 450 D2 240 PLC Example 2 Control Relay see note 1 Val
15. aa fangs koa Dala CTO oCormote Inpa Data ETANO Contoter V2020 9 Capase Complete V220 10 Timed Out Oupa Date Cirie CTRIO Oud Daia Cordo CTRIO Dpat Osta CortroltoCT RIO Output Dats Cortroder oCTRID VIET cal VEEL rable Cape 7 cael a J cen a e a Counter I O User Manual 2nd Ed Rev D 6 9 Chapter 6 Program Control ee I O Map with DirectLOGIC PLC 4 ranges mode When using the CTRIO module with a DirectLOGIC PLC in 4 ranges mode enter the starting V memory location for the word inputs and outputs and the starting V memory location for the bit inputs and outputs Control relays V40600 range would usually be used for bit control In the I O Map dialog below note that Input Output and Systems Functions addresses shown are in word and Control Relay formats Thus word and Control Relay addressing will need to be used in the ladder logic program to address the CTRIO control and status words bits Remember that the CTRIO will consume the address ranges listed in all four range fields xj We Map Latte Wie PLE T Oupa Maw Erstis end bom PLE F Steg siden he word neue FD Stating V oddone tor werd ovp FED SS Range Fawon Amge Fanin SeteyVadtentatrese P0 tomga frond Range vance 040808 15 Rarer paio as krov Functore Oupa Functions System Functions AA nt Gund Courter DiNi Cage Tee TRO Cortei rend Data CTRD Corte inout Data CTFRO
16. position has been attained The New Position Loaded status bit will always follow the state of the Load Seek New Position control bit This status bit should be used to signal the program that the CTRIO has received the new state of the control bit Position Loaded Status Bit Pulses Active Status Bit V40622 1 or C441 V40622 0 or c440 CTRIO Pulse Output State 0 Idle Go To Position Acknowledged Pulsing 1 0 Still Pulsing Go To Position Control Bit is OFF 1 Go To Position Acknowledged Position Attained You do not have to wait on the CTRIO to complete a move that is in progress before loading the next target location After the GoTo Position is acknowledged the program can load the next position into the DWord Parameter 3 When Pulses Active Status goes to 0 then setting the GoTo Position control bit will again start the output toward the new position The CTRIO moves to the new position relative to its previous position as long as the Enable Output control bit remains set Clearing the Enable Output bit will disable output pulsing and reset the current position to 0 See Chapter 8 for a DirectLOGIC programming example that executes a Dynamic Positioning Positioning Plus pulse profile using the bit D word addressing in the table on page 6 37 ani DirectSOFT The sign of the value in the Target Position ia register Parameter 3 determines the co D direction of the pulse train output In the l piii DirectL
17. the Timer Capture Complete bit and Timeout bit resets before attempting the next time capture cycle Once timing has been initiated if the time before the CTRIO sees the next configured edge exceeds the specified Timeout Period the Timeout bit is set The Timer register values are 6 reset to zero The program will need to turn off the Enable Timer Capture bit and confirm the Timer Capture Starting bit Timer Capture Complete bit and the Timeout bit reset before attempting the next time capture cycle Free Run Timers The Timeout Bit is set if the time that it takes the CTRIO to see the configured input edge exceeds the specified Timeout Period The Timeout bit resets when the next timing cycle begins The Previous Time register value is reset to zero Once timing has been initiated if the time before the CTRIO sees the next configured edge exceeds the specified Timeout Period the Timeout bit is set The Timer register values are reset to zero The Timeout bit resets when the next timing cycle begins 6 20 Counter I O User Manual 2nd Ed Rev D ee Pulse Catch Input Function When the Enable Pulse Catch bit is ON and the configured input edge occurs the CTRIO will begin timing and the Pulse Catch Starting bit will turn ON If the input signal remains active for the specified qualification period the Pulse Catch Output Pulse State bit will turn ON for the configured duration If a discrete output is assigned to foll
18. the pulses you configured Is Output Active ON You can also suspend the pulse output at any time with the Suspend Output bit RESET Output Enable Change Direction RESET Output Enable Counter I O User Manual 2nd Ed Rev D 6 45 Chapter 6 Program Control a Run at Velocity on CTRIO until Input Function Value Position Name PLC Control Outputs Base Addr V2030 Bit of Word PLC Status Inputs Base Addr 2000 Bit of Word PLC Control Outputs Base Addr V2030 Control Relay D2 240 PLC Status Inputs Base Addr V2000 Control Relay D2 240 Action Command Code 2040 V2040 Set to 22 Hex Pulse at velocity until Function Input Limit Parameter 1 V2041 V2041 Set initial run frequency 20Hz 25000Hz decimal Parameter 2 V2042 V2042 Bits 15 12 Comparison Bits 11 8 Input Function to use Low Byte Duty cycle 1 99 can leave 0 for 50 Hex Parameter 3 V2031 V2030 V2031 V2030 Specified position for Input Function DWord to compare against decimal Set Direction V2056 4 C224 Set ON or OFF for Direction of Rotation Process Command V2056 7 C227 Turn ON Command Complete status bit is returned see step 4 Command Status V2022 7 When ON command has been accepted clear Process Command bit step 3 Command Error V2022 6 ON if Command or Parameters are invalid Enable
19. which this Discrete Output has been assigned 6 24 Counter I O User Manual 2nd Ed Rev D Chapter 6 Program Control Load Preset Table Flowchart The flowchart below provides the logical sequence necessary to load and execute a discrete output preset table Load 10 into Command Code Verify that the Hex CTRIO is configured correctly At this point your table is active Load Table Number into Parameter 1 Decimal Verify that you ve entered the correct table number RESET Enable Output Is Command Complete ON RESET Process Command RESET Process Command Counter I O User Manual 2nd Ed Rev D 6 25 Chapter 6 Program Control pe Pulse Output Status Control Bits and Command Codes DL PLCs Output Status Bit Definitions Pulse Output Pulse output control Offsets are listed in the order of Outputs 0 1 2 3 Status Bit CTRIO to CPU Bit Offsets WinPLC EBC PBC DEVNETS MODBUS V memory Offsets from Input Start octal Output Enabled 32 48 22 0 23 0 Position Loaded 33 49 22 1 23 1 Output Suspended 34 50 22 2 23 2 Output Active 36 52 22 4 23 4 Output Stalled 37 53 22 5 23 5 Command Error 38 54 22 6 23 6 Command Complete 39 55 Output Control Bit Definitions Pulse Output Pulse output control Offsets are listed in the order of Outputs 0 1 2 3 Control Bit
20. 0 Bit of Word PLC Status Inputs Base Addr V2000 Bit of Word PLC Control Outputs Base Addr V2030 Control Relay D2 240 PLCStatus Inputs Base Addr V2000 Control Relay D2 240 Description Parameter 1 V2001 V2000 V2001 V2000 Previous Time Parameter 2 V2003 V2002 V2003 V2002 In Progress Time Timer Capture Starting V2020 0 C160 On when Time Capture is in progress Enable Timer Capture 2054 0 Turn ON to Enable Timer Capture Function Not available when Free Run Timer option is selected Timer Capture Complete V2020 1 On when Timing is complete Timer Timeout Bit V2020 2 Counter I O User Manual 2nd Ed Rev D 6 19 Chapter 6 Program Control a Y Edge and Dual Edge Timer Timeout Function The Timer Timeout Function is available for use with standard and Free Run Timers It is primarily used in Free Run timing of recurring events rate velocity calculations etc The specified Timeout Period is in effect once the timer is enabled until receiving the first configured input edge Then it is in effect until receiving the next edge of the timing input to complete the timing cycle Standard Timers Once the timer is enabled the Timeout Bit is set if the time that it takes the CTRIO to see the configured input edge exceeds the specified Timeout Period The program will need to turn off the Enable Timer Capture bit and confirm
21. 054 1 Turn ON to Reset Counter Value to Reset Value At Reset Value V2020 1 6 18 Counter I O User Manual 2nd Ed Rev D On when Counter is at Reset Value Chapter 6 Program Control nana Edge Timer and Dual Edge Timer Parameters 1 and 2 are explained on page 6 16 and will be mapped to V2000 V2003 in this example Standard Timers When the Enable Timer Capture bit is ON and the configured input edge occurs the CTRIO will begin timing The Timer Capture Starting bit will be ON while the timing is in progress and will turn OFF when the next configured input edge occurs and the Timer Capture Complete bit turns ON The program will need to turn off the Enable Timer Capture bit and confirm the Timer Capture Starting and Timer Capture Complete bits reset before attempting the next time capture cycle Turning OFF the Enable Timer Capture bit resets the timers register values to zero Free Run Timers If the Free Run Timer option was configured the Enable Timer Capture bit is not available When the configured input edge occurs the CTRIO will begin timing The Timer Capture Starting bit will be ON while the timing is in progress and will turn OFF when the next configured input edge occurs When this edge occurs the Timer in progress time register resets to zero The previous time register will always retain the most recent captured time value PLC Control Outputs Base Addr V203
22. 1 are reserved for the Hot Swap base rescan feature Creating an offline file for H2 T1H CTRIO module For the T1H PBC enter a 2 byte Output Offset to accommodate memory used by the Hot Swap base rescan feature This does not apply to an H2 PBC system The example shown below assumes the T1H CTRIO module is the first module in the system The CTRIO modules consume 44 bytes of input memory and 52 bytes of output memory The maximum amount of I O memory per H2 T1H PBC station is 244 input bytes and 242 output bytes You may need to refer to the Profibus User Manuals H2 PBC M T1H PBC M for information on bytes used by discrete and or analog I O modules to be able to determine the appropriate Starting input and output byte offset addresses for the CTRIO module 10 Map Mao Deckay Mode i roam ama Maw Stra tye otter F Sateg byte otvet he eto For the T1H PBC enter a 2 byte Output Offset to accomodate memory used by the Hot Swap base rescan feature 6 12 Counter I O User Manual 2nd Ed Rev D Chapter 6 Program Control Printing a Memory Map Report You can print an I O Memory Map Report from the I O Map Report dialog or save as a txt file Click on the Report button located near the bottom of the I O Map dialog to xj display the Memory Map Report dialog Chi rt Quad Counter The addresses listed in the Memory Map Y20201 At Rese Value Report are a combination of the Input V2054 1 Reset Func
23. 14 23 6 23 14 Command Complete 39 47 55 63 Output Status Bit Definitions Pulse Output Output Status Offsets are listed in the order of the Output 0 1 2 3 Status Bit CTRIO to CPU Bit Offsets WinPLC EBC PBC DEVNETS MODBUS 22 7 22 15 23 7 23 15 V memory Offsets from Input Start octal Output Enabled 32 48 22 0 23 0 Position Loaded 33 49 22 1 23 1 Output Suspended 34 50 22 2 23 2 Output Active 36 52 22 4 23 4 Output Stalled 37 53 22 5 23 5 Command Error 38 54 22 6 23 6 Command Complete 39 55 22 7 23 7 Counter I O User Manual 2nd Ed Rev D 6 5 Chapter 6 Program Control a Output Memory Map for Data Transfers from DL CPUs to CTRIO The following table shows which memory locations are used for memory transfers from the CPU module to the CTRIO The starting memory location is defined by the user in the I O Map within CTRIO Workbench If you are using a DirectLOGIC CPU you will use the memory address offsets in the second column If you are using a WinPLC EBC PBC DEVNETS or MODBUS interface you will use the non PLC offsets in column one Data Type and Offset WinPLC EBC PBC DEVNETS MODBUS Address for Inputs DirectLOGIC Definition Format dwY0 n 0 Output 0 Parameter 3 DWord A dwY1 n 2 Output 1 Parameter 3 DWord dwY2 n 4 Output 2 Parame
24. 2 240 PLC Status Inputs Base Addr V2000 Control Relay D2 240 Action User User 1 Hex Read All Registers Specifed to use 2 Hex Write All Registers with RD WT 4 Hex Write One Register Instruction 5 Hex Write Reset Value Command Specifed to use Code with RD WT Instruction System Command Error System Command Complete Process Command ON if Command or Parameters are V2024 6 invalid When ON command has been V2024 7 accepted clear aes Command i Turn ON Command Complete status 2060 7 bit is returned NOTE 1 The D2 240 CPU does not support bit of word addressing The status and control bits must be mapped to control relay words An example of mapping code is shown below SP 1 LD VC200 OUT V2060 LD V2024 OUT VC100 NOTE 2 For example DirectSOFT uses B2020 1 in the ladder code to indicate that you are addressing the second bit of V memory register 2020 The B prefix indicates bit of word addressing Counter I O User Manual 2nd Ed Rev D 6 47 Chapter 6 Program Control C a a aaam aaa Reading All CTRIO s Internal Registers Flowcharts The flowcharts below provide the logical sequence necessary to Read the CTRIO s internal registers Reading the CTRIO s internal registers is a two step process 1 Ask the CTRIO to transfer the internal register values to its shared RAM 2 Trans
25. 2 D 00 0300 Falling Edge Ch2 D 01 1300 Both Edge Ch2 D 10 2300 Edge s Bits 15 12 CTRIO Input Bits 11 8 Rising 0000 OHex Chic 0000 OHex Falling 0001 1Hex Ch1D 0001 1Hex Both 0010 2Hex Ch2C 0010 2Hex Ch2D 0011 3Hex Counter I O User Manual 2nd Ed Rev D 6 41 Chapter 6 Program Control Run to Limit Mode Flowchart The flowchart below provides the logical sequence necessary to execute a Run to Limit Mode pulse profile Load 21 into Command Code Hex Select Direction Load Frequency At this point the CTRIO will into Parameter 1 begin outputting pulses Decimal SET Output Enable into Parameter 2 You can change the Frequency and or the Duty Load new Hex Cycle as often as you need parameter values you can even change them while the output is active SET Process Make sure Command the Input is ON configured as a Limit New Frequency or Duty Cycle The Output Active bit will be ON until the CTRIO sends out all of the pulses you configured Is Output Active ON You can also suspend the pulse output at any time with the Suspend Output bit Complete RESET Output Enable RESET Process Command Yes Change Direction RESET Output Enable RESET Process Command 6 42 Counter I O User Manual 2nd Ed Rev D a Chapter 6 Program Control Run at Velocity on CTRIO YO amp Y1 until Discrete
26. D E F G H Cunt Count At Reset Valve ot NOTE The exported nicknames are not unique to a specific slot number or module If you have multiple modules installed and wish to export from more than one module you will need to specify a unique prefix suffix If specified this two character identifier will be added to the beginning or end of each nickname to ensure uniqueness E a ptun Output Enabled Po None C Add Prefix Add Suffix Unique Slot ID 1 or 2 characters aivan 21 620560 22 e256 1 OK Cancel les s 24 82056 4 Counter I O User Manual 2nd Ed Rev D 6 13 Chapter 6 Program Control RRR Addressing Conventions with V memory Examples for DirectLOGIC PLCs Example for Bit accessed Data in PLC CPUs In this example the V memory location V2524 contains a value equal to 514 in decimal 514 decimal 0202 Hex 0000 0010 0000 0010 binary The bit V2524 1 refers to the 2nd to the least significant bit set to 1 in this example Likewise V2524 9 refers to bit number 9 the 10th from the least significant bit also set to 1 in this example Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 V2524 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 V2524 9 1 V2524 1 1 Addressing High and Low Byte of Word Parameters In the following example the V memory location V2510 contains a value equal to 3 decimal in the high byte and 10 decimal in the low byte 3 decimal 03 H
27. ET Go To Position If you have more position values you can load them as soon as the Position Loaded bit comes ON You don t have to wait for the currently loaded position to be reached More Positions RESET Enable Output Counter I O User Manual 2nd Ed Rev D 6 35 Chapter 6 Program Control a Dynamic Positioning or Dynamic Positioning Plus using the CTRIO YO and Y1 PLC Status Inputs ase Addr V2000 Control Relay D2 240 PLC Control Outputs Base Addr V2030 Control Relay D2 240 PLC Status Inputs Base Addr V2000 Bit of Word PLC Control Outputs Base Addr V2030 Bit of Word Name Action Command Code 2040 2040 Set to 10 Load Stored Profile Parameter 1 V2041 V2041 File of desired Dynamic Positioning Profile Process Command V2056 7 C227 Turn ON until Command Complete status bit is returned see step 4 Command Complete Status V2022 7 When ON Profile is now loaded clear Process Command bit step 3 Command Error V2022 6 ON if Command or Parameters are invalid Enable Output 2056 0 Turn ON to assume 0 position Turn OFF to disable pulses and zero position Output Enable Status V2022 0 When ON pulses are now enabled and last position is retained Parameter 3 V2031 V2030 V2031 V2030 Target position User defined DWord Go To Position V2056 1 C221 Starts
28. Input Limit Name PLC Control Outputs Base Addr V2030 Bit of Word PLC Status Inputs Base Addr V2000 Bit of Word PLC Control Outputs Base Addr V2030 Control Relay D2 240 PLC Status Inputs Base Addr V2000 Control Relay D2 240 Action Command Code V2040 V2040 Set to 21 Hex Run to Limit Mode Parameter 1 V2041 V2041 Set initial run frequency 20Hz 25000HZz decimal Parameter 2 V2042 V2042 Select discrete input edge in high byte low byte duty cycle 1 99 Example rising input 1D at Duty 45 set this parameter to 212D Hex Set Direction V2056 4 C224 Set ON or OFF for Direction of Rotation Process Command V2056 7 C227 Turn ON Command Complete status bit is returned see step 4 Command Status V2022 7 When ON command has been accepted clear Process Command bit step 3 Command Error V2022 6 ON if Command or Parameters are invalid Enable Output V2056 0 Turn ON to start pulses Output Active Status V2022 4 ON while pulsing OFF when limit has stopped pulsing Suspend Output V2056 2 Turn ON to pause output pulses without resetting pulse count Output Suspended V2022 2 ON when out pulse train has been suspended Counter I O User Manual 2nd Ed Rev D 6 43 Chapter 6 Program Control Run to Position Mode NOTE Run to
29. MiiiMMMMMMMMMMMMMMMmmmmmMmMmMIMl Writing to One CTRIO Internal Register Flowcharts The flowcharts below provide the logical sequence necessary to Write to one of the CTRIO s internal registers Writing to a CTRIO internal register is a two step process 1 Transfer the data value from the controller s memory to the CTRIO s shared RAM 2 Ask the CTRIO to transfer this value from its shared RAM to it s internal registers DirectLOGIC Write to CTRIO The Destination Register values are as follows 0 Ch1 Fn1 1 Ch1 Fn2 Use the PLC s WT instruction 2 Ch2 Fn1 to write the 2 byte command 3 Ch2 Fn2 code 04 Write One Register 4 Ouput 0 the 2 byte destination register 5 Ouput 1 value and the 4 byte value to 6 Ouput 2 the CTRIO s shared RAM at 7 Ouput 3 offset 80 hex SET Make sure the parameters Process i 9 you re using Command ThinknDo Write to CTRIO The Destination Register values are as follows 0 Ch1 Fn1 1 Ch1 Fn2 2 Ch2 Fn1 3 Ch2 Fn2 Use ThinknDo s Call Block to write the 2 byte command code 04 Write One Register the 2 byte destination register value and the 4 byte value to the CTRIO s shared RAM at Address 80 Make sure the parameters you re using SET Process Command are correct are correct Command Complete Complete ON 6 50 Counter I O User Manual 2nd Ed Rev D
30. OGIC programming example to BIN the right BCD 5000 is converted to decimal 5000 when C0 is turned ON You could load LD a V memory location n instead of using a constant as shown in the F Aa use o o example OUTD INV 3000 6 34 Counter I O User Manual 2nd Ed Rev D Chapter 6 Program Control Dynamic Positioning or Dynamic Positioning Plus Flowchart The flowchart below provides the logical sequence necessary to execute a Dynamic Positioning Positioning Plus pulse profile Load 10 into Command Code Verify that the Hex CTRIO is configured correctly Load Pulse Profile number into Parameter 1 Decimal Is Table Number Correct SET Process Command Verify that you ve entered the correct table number Complete ON RESET Process Command RESET Process Command Turning on Output Enable sets the zero point for the CTRIO that is the current m position value is set to 0 SET Enable Output The direction will be determined automatically Load Position by the CTRIO Value into Parameter 3 Signed Decimal SET Go To Position Once the current position is loaded The CTRIO will begin to send output pulses You can suspend the pulse output at any time by using the Suspend Output bit Is Position Loaded Using Suspend Output will ON NOT reset the zero point RES
31. Output 2056 0 Turn ON to start pulses Output Active Status V2022 4 ON while pulsing OFF when position is reached Suspend Output V2056 2 Turn ON to pause output pulses without resetting pulse count Output Suspended V2022 2 6 46 Counter I O User Manual 2nd Ed Rev D ON when out pulse train has been suspended Chapter 6 Program Control SS System Functions System Functions Commands are primarily used to read from and write to the CTRIO s internal registers The flowcharts on the following pages provide DirectLOGIC and ThinknDo users the logical sequence necessary to read from and write to the CTRIO s internal registers The CTRIO s internal current count register can be read from or written to to if the input is configured for a Counter or Quadrature Counter Timer values are not accessable The CTRIO s internal current output pulse count can be read from or written to only if the pulse output is running Dynamic Velocity or Dynamic Positioning profiles See Chapter 8 for DirectLOGIC programming examples that use the RD and WT instructions to execute system function commands See Chapter 9 for Do more programming examples using read and write instructions to execute system function commands PLC Control Outputs Base Addr V2030 Bit of Word PLC Status Inputs Base Addr 2000 Bit of Word PLC Control Outputs Base Addr V2030 Control Relay D
32. PROGRAM CONTROL In This Chapter Do more and Program Control 45s04245 e000 eee weed es 6 2 Input Memory Map for Data Transfers from CTRIO to DL CPUs 6 4 Output Memory Map for Data Transfers from DL CPUs to CTRIO 6 6 VO Map Dialog 4 242925 460400 sei ewan doeyaen etaew eRe a ode 6 9 Addressing Conventions with V memory Examples for DirectLOGIC PLCS o wrcseeedy ae Gi eeddwe detee dees enaar 6 14 Input Function Status Control Bits and Parameters 6 15 INPUL FUNCHONGS 2 c avepceees Pek ewee ede ess le Reals 6 CRE g we 6 18 Runtime Changes to CTRIO Configured Preset Tables DL PLCs 6 22 Pulse Output Status Control Bits and Command Codes DL PLCs 6 26 Pulse Output Profiles DL PLCs s 2 ccexncccads hoeue tx eee ns 6 30 System FUNCONS s seai e e a aa ea ee aa eda E E ad 6 47 Chapter 6 Program Control EY Do more and Program Control Much of Chapter 6 of this manual does not apply to applications using Do more as the controller The section Pulse Output Profiles functional descriptions of the various pulse profiles should be useful to Do more users as these profiles are available on Do more as well However Do more users using a CTRIO2 also have Axis Mode profiles available Each is controlled by a dedicated ladder instruction Please see Do more Designer help file for more information on Axis Mode instructions for the CTRIO2 One of the goals of the development of Do more was to simplify use of
33. Position Mode controls the pulse outputs directly from the CPU controller program No i CTRIO Workbench Pulse Profile is required for this mode The Run to Position Mode command Command 0022Hex BCD allows Pulse Outputs that terminate when the specified Input Function Value position count is reached Set Word Parameter 1 to the desired Frequency Set Word Parameter 2 Low Byte to the Duty Cycle and the High Byte to the Compare Functions as defined below Leaving the Duty Cycle set to 0 achieves the default 50 otherwise it can be set in 1 increments by writing this value from 1 to 99 Hex BCD Word Parameter 3 specifies the value that Input Function will compare against 6 The flowchart on the following page provides the logical sequence necessary to execute a Run to Position pulse profile See Chapter 8 for a DirectLOGIC programming example that executes a Run to Position pulse profile using the bit D word addressing in the table on page 6 47 Parameter 2 Word Parameter 2 defines three elements of the Run to Position routine Bit 12 determines if the specified position is greater than or equal or less than the current Input Function position value Bits 9 and 8 determine which Input Function to use for the comparison The low byte specifies the duty cycle Specified Position Parameter 2 Parameter 2 Parameter 2 Hex Parameter 3 is Bit 12 Bits9 amp 8 Duty cycle at 50 less than Ch1 Fn1 00 0000 greater than Ch1 Fn1 00
34. RIO_000 InputState CTRIO_000 MaxScanTi Sctrio_002_c1 SCTRIO_002_Out0 ae CTRIO 002 C1F1 AtResetValue CTRIO 002 Out0 AtPosition ere S CTRIO_002 C1F1 CountCaptured SCTRIO_002_Out0 AtVelocity 10_000 0ut0DiscOn CTRIO_002_C1F1 EnableCapture SCTRIO_002_Out0 Direction se soe CTRIO_002_C1F1fReg1 CTRIO_002_Out0 GotoPosition SCTRIO 000 Out1DiscEnabled SCTRIO_002_C1F1fReg2 SCTRIO_002_Out0 OutputActive SCTRIO_000 Out1DiscOn S CTRIO_002_C1F1 iReg1 SCTRIO_002_Out0_OutputEnabled CTRIO_000 Out1PulseActive CTRIO_002_C1F1 iReg2 SCTRIO_002_Out0 OutputPosition _ SCTRIO_000 OutType CTRIO_002_C1F1 Reset CTRIO_002_Out0 OutputStalled SCTRIO_000 Out2DiscEnabled ad ae 7 CTRIO_000 Out2DiscOn CTRIO_002_Out0 OutputSuspend SCTRIO 000 0 A _000 0ut2PulseActive SCTRIO_002_Out0 OutputVelocity SCTRIO_000 Out2Type 7 SCTRIO_000 Out3DiscEnabled A list of CTRIO data structures and their definitions can be SCTRIO_000 Out3DiscOn found in Do more Designer help file topics for the CTRIO Pees instructions CTRIO_000 OutputState CTRIO_000 ScanTime Counter I O User Manual 2nd Ed Rev D Chapter 6 Program Control ET Registers not available through structures are accessed using the two ladder instructions CTREGRD and CTREGWR An example of the CTREGWR instruction is shown here For a list of registers available through these instructions see Do more Designer help topics DMD0526 and DMD0527 eo CTRIO Write Register Modu
35. and Is Command Error ON RESET Process Command At this point the profile will The Output Active bit will be Wait here until Output Active Select Direction begin to run SET RESET Output Enable Output Enable ON while the profile is running goes OFF indicating the profile has completed Run Profile Again RESET Output Enable 6 32 Counter I O User Manual 2nd Ed Rev D i _ Chapter 6 Program Control Running a Trapezoid S Curve Symmetrical S Curve Profile Home Search or Free Form Profile on CTRIO YO amp Y1 Name PLC Control Outputs Base Addr V2030 Bit of Word PLC Status Inputs Base Addr 2000 Bit of Word PLC Control Outputs Base Addr V2030 Control firey PLC Status Inputs Base Addr V2000 Control Hele Action Command Code 2040 V2040 Set to 10 Load Stored Profile Parameter 1 V2041 V2041 File of stored profile determined by user Process Command V2056 7 C227 Turn ON until Command Complete status bit is returned see step 4 Command Complete Status V2022 7 When ON Profile is now loaded clear Process Command bit step 3 Command Error V2022 6 ON if Command or Parameters are invalid Set Direction V2056 4 Set ON or OFF for Direction of Rotation Enable Output V2056 0 Turn ON to start pulses Output Enable tatus V2022 0 When ON module is co
36. e Captured Value Scaled Counter with Capture Scaled Value pos or rate Captured Value Non scaled Timer Previous Time us In Progress Time us Scaled Timer Scaled Interval rate In Progress Time us Pulse Catch Not Used receives a sufficiently long pulse input Not Used NOTE If you select the discrete on chx fnx option for an input channel using pulse catch mode you will get a message when you exit the I O config screen noting pulse follower mode or Pulse extension mode for this output channel This means only that the output will pulse for the specified duration when the input Counter I O User Manual 2nd Ed Rev D 6 15 Chapter 6 Program Control i Example Input Control Status Bits and Parameter Register Addresses The following tables provide example addresses based on V2000 selected for the base input address and V2030 selected for the base output address The Input Functions discussed on the following pages use these example addresses Status Registers Example using V2000 as base input address for Input Channel 1 Status bits and DWords received from CTRIO to CPU PLC Example 1 PLC Example 2 Name Bit of Word see note 2 Control Relay see note 1 Value D2 250 1 260 D4 450 D2 240 Oe 2020 0 C160 ON when Capture is complete Timer Capture Starting 2020 0 C160 On when Timer Capture begins Timer Capture Complete Timing OR At Reset vue
37. e order of Ch1 Fn1 Ch1 Fn2 Ch2 Fn1 Ch2 Fn2 Ch n Fn n Control Bits transfers from CPU to CTRIO Enable Count Capture Enable Timer Capture Enable Pulse Catch Reset Bit Offsets WinPLC EBC PBC DEVNETS MODBUS 0 8 16 24 0 8 16 24 0 8 16 24 1 9 17 25 V memory Offsets DirectLOGIC PLCs 24 0 24 8 25 0 25 8 24 0 24 8 25 0 25 8 24 0 24 8 25 0 25 8 24 1 24 9 25 1 25 9 Output Control Bit Definitions for Preset Table Control Output Control Offsets are listed in the order of the Output 0 Output 3 Output n Control Bits transfers from CPU to CTRIO Enable Output Process Command Bit Offsets WinPLC EBC PBC DEVNETS MODBUS 32 40 48 56 39 47 55 63 Output Control Bit Definitions Pulse Output Pulse output control Offsets are listed in the order of Outputs 0 1 2 3 V memory Offsets DirectLOGIC PLCs 26 0 26 8 27 0 27 8 26 7 26 15 27 7 27 15 Output Control Bit transfers from CPU to CTRIO Enable Output Go to Position Suspend Output Direction Process Command Bit Offsets WinPLC EBC PBC DEVNETS MODBUS 32 48 33 49 34 50 36 52 39 55 V memory Offsets from Output Start octal 26 0 27 0 26 1 27 1 26 2 27 2 26 4 27 4 26 7 27 7 Read as Level Rising Edge Level Level Rising Edge Counter I O User Manual 2nd Ed Rev D 6 7 Chapter 6 Program Control iY Output Control Bi
38. ent preconfigured table Command Codes are passed to the CTRIO module to effect the required edit Each Command Code has its own syntax and all Command Codes must be presented in a particular sequence The command code and associated parameters must be loaded into the appropriate memory locations A Process Command instruction must be passed to the CTRIO module A Command Complete signal must be received and the Command Error bit must stay at zero Finally the Enable Output instruction must be passed to the CTRIO module Some changes require a combination of Command Codes so those changes must follow the steps above for each Command Code processed Output Control and Status Offsets are listed in order of Output 0 Output 3 Control Bit transfers from CPU to CTRIO Bit Offsets WinPLC EBC PBC DEVNETS MODBUS V memory Offsets DirectLOGIC PLCs Enable Output 32 40 48 56 26 0 26 8 27 0 27 8 Process Command Status Bit transfers from CTRIO to CPU 39 47 55 63 Bit Offsets WinPLC EBC PBC DEVNETS MODBUS 26 7 26 15 27 7 27 15 V memory Offsets DirectLOGIC PLCs Command Error 38 46 54 62 22 6 22 14 23 6 23 14 Command Complete 39 47 55 63 22 7 22 15 23 7 23 15 In order to process a command first the program must load the Command and Required Word and DWord Parameters Then the program should drive the Process Command bit to a 1 and look
39. ex 0000 0011 binary in the high byte and 10 decimal 0A Hex 0000 1010 binary in the low byte This example could represent the Command Code Edit Table Entry The value 03 Hex would represent the File number in the high byte and the 0A Hex would represent the remainder of the Command Code in the low byte High Byte Low Byte Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 V2510 0 0 0 0 0 0 1 1 0 0 0 0 1 0 1 0 ee E High Nibble Low Nibble High Nibble Low Nibble Addressing High and Low Word of DWord Parameters Double Word parameters are addressed in a similar fashion to the high and low bytes of a Word Parameter For example a DWord that begins in V2300 consumes both V2300 and V2301 The Low Word is V2300 and the High Word is V2301 6 14 Counter I O User Manual 2nd Ed Rev D Chapter 6 Program Control sss Input Function Status Control Bits and Parameters Input Function Status Bit Definitions Input function offsets are listed in the order of Ch1 Fn1 Ch1 Fn2 Ch2 Fn1 Ch2 Fn2 Ch x Fn x Status Bits transfers from CTRIO to CPU Bit Offsets WinPLC EBC PBC DEVNETS MODBUS V memory Offsets DirectLOGIC PLCs Count Capture Complete Bit 0 8 16 24 20 0 20 8 21 0 21 8 Timer Capture Start 0 8 16 24 20 0 20 8 21 0 21 8 Timer Capture Complete Timing OR At Reset Value
40. fer the values from the CTRIO s shared RAM to the controller s memory DirectLOGIC Read from CTRIO This command tells the CTRIO to copy all 8 of it s internal register values 4 bytes per value into it s shared RAM making them accessible to the CPU 2 The 32 bytes of data make up the 8 CTRIO register values They are arranged as follows Bytes 0 3 Ch1 Fn1 Bytes 4 7 Ch1 Fn2 Bytes 8 11 Ch2 Fn1 Bytes 12 15 Ch2 Fn2 Bytes 16 19 Output 0 Bytes 20 23 Output 1 Bytes 24 27 Output 2 Bytes 28 31 Output 3 Use the PLC s WT instruction to write the 2 byte command code 01 Read All Registers to the CTRIO at offset 80 hex Make sure the parameters you re using are correct SET Process Command Command Complete ON 2 Use the PLC s RD instruction to read the 32 bytes from the CTRIO s shared RAM at offset 82 hex and place them in the PLC s v memory Pag e This command tells the CTRIO to copy all 8 of it s internal register values into it s shared RAM making them accessible En The 8 CTRIO register values are arranged as follows DWORD 0 Ch1 Fn1 DWORD 1 Ch1 Fn2 DWORD 2 Ch2 Fn1 DWORD 3 Ch2 Fn2 DWORD 4 Output 0 DWORD 5 Output 1 DWORD 6 Output 2 DWORD 7 Output 3 6 48 Counter I O User Manual 2nd Ed Rev D ThinknDo Read from CTRIO Use ThinknDo s Call Block to write the 2 byte command code
41. for the CTRIO to acknowledge the command with the Command Complete bit Finally the program should remove the Process Command bit and set the Enable Output bit when appropriate If the Command Error bit is received the CTRIO was unable to process the command due to an illegal value in either the Command Code or Parameter fields Word Control CPU to CTRIO Word Offsets WinPLC EBC PBC DEVNETS MODBUS V memory Offsets from Output Start octal Command Code 0 6 10 16 Word Parameter 1 1 7 11 17 Word Parameter 2 2 8 12 20 6 22 Counter I O User Manual 2nd Ed Rev D Chapter 6 Program Control i DWord Control DWord Offsets WinPLC EBC PBC V memory Offsets CPU to CTRIO DEVNETS MODBUS from Output Start octal DWord Parameter 3 0 2 0 4 Parameter 2 Word Parameter 3 DWord DirectLOGIC n 12 DirectLOGIC n 0 n 1 decimal decimal Load Table from RAM File Number decimal 3 Clear RAM Table Initialize RAM Table Entry Type decimal Pulse Time Preset Count Time4 Command Code Parameter 1 Word DirectLOGIC n 10 Hex BCD DirectLOGIC n 11 Add Table Entry Entry Type decimal Pulse Time Preset Count Time4 2 3 Edit Table Entry File 82 14 He BCD Entry Type Pulse Time Preset Count Time4 Write RAM to ROMS 999 5 2 3 Edit and Reload File amp 2 15 HeNBCD Entry Type Pulse Time Preset Count Time4 Initialize Table
42. ionally a deadband percentage in tenths of a percent can be set to prevent the output from changing too frequently near the Rate Level threshold ON when greater condition example Consider a Discrete Output set to turn ON when a level gets to 100 with a 10 deadband The output will turn ON when the level gets to 100 If the level drops the output will stay on until the level drops below 90 where it will turn OFF OFF when less condition example 6 Consider a Discrete Output set to turn OFF when less at 100 When the level gets to 100 the output turns OFF If the level rises again the output will stay OFF until the level gets to 110 where it will turn ON Edit the behavior of a Discrete Output triggered by a Rate Level by using the Edit Level Response Command Command Code 30Hex The Level Behavior setting for Parameter 1 is given in the table below Level Behavior for Discrete Output Parameter 1 Contents ON when greater than Level Rate setting 0000 Hex ON when less than Level Rate setting 0080 Hex OFF when greater than Level Rate setting 0001 Hex OFF when less than Level Rate setting 0081 Hex The Deadband is written to Parameter 2 as a x10 integer one implied decimal position To achieve a 10 0 deadband the control program needs to write 100 decimal 64 Hex to Parameter 2 The Level Rate setting is written to Parameter 3 in the same format as Input Parameter 1 of the CTRIO Function to
43. ions Output Functions and System Functions Click on the Input Functions tab or Output Functions tab to display the CTRIO module s assigned input or output functions quad counter pulse catch pulse out discrete out etc For each input and or output function assigned the I O Map dialog displays the Input Data 6 CTRIO gt Controller addresses and Output Data Controller gt CTRIO addresses based on the Map Display Mode and the starting I O addresses specified The memory map addresses displayed correspond to the offset addresses shown in the tables on the previous pages Click on the System Functions tab to display the System Functions addressing The command bits are used when reading from and writing to the CTRIO s internal registers The other bits can be used to monitor the status of each individual I O point on the module I O Map with DirectLOGIC PLC 2 ranges mode When using the CTRIO module with a DirectLOGIC PLC enter the starting V memory location for the inputs and outputs in the appropriate fields at the top of the I O Map dialog In the I O Map dialog shown below note that the Input Output and Systems Functions addresses shown are in word and bit of word formats Thus word and bit of word addressing will need to be used in the ladder logic program to address the CTRIO s control and status words bits xj Enable Vite to PLC IV gt Oupa Mao Enable Read bom PLC 7 a Satra V addes troupes V0 Faon Flange
44. le Device CTRIO_000 oy Module Structure CTRIO_000 Source Destination Register 4 Outo Position gt 0 Ch1Fn1 Accumulator 1 Ch1Fn2 Accumulator 2 Ch2Fn1 Accumulator 3 Ch2Fn2 Accumulator 4 Out0 Position 5 Out1 Position 6 Out2 Position 7 Out3 Position 8 Ch1Fn1 Reset value 9 Ch1Fn2 Reset value 10 Ch2Fn1 Reset value 11 Ch2Fn2 Reset value 12 Ch1A Filter Time CTRIO2 13 Ch1B Filter Time CTRIO2 14 Ch1C Filter Time CTRIO2 15 Ch1D Filter Time CTRIO2 16 Ch2A Filter Time CTRIO2 17 Ch2B Filter Time CTRIO2 18 Ch2C Filter Time CTRIO2 19 Ch2D Filter Time CTRIO2 On Success Setbit C JMP On Error Setbit C JMP Counter I O User Manual 2nd Ed Rev D 6 3 Chapter 6 Program Control a Input Memory Map for Data Transfers from CTRIO to DL CPUs The following table shows which memory locations are used for memory transfers from the CTRIO module to the CPU The starting memory location is defined by the user in the I O Map within CTRIO Workbench If you are using the DirectLOGIC CPU you will use the memory address offsets in the second column If you are using an H2 WinPLC EBC PBC MODBUS or DEVNETS in the CPU slot you will use the non PLC offsets in column one Data Type and Offset WinPLC EBC PBC DEVNETS MODBUS Address for Inputs DirectLOGIC Definition Format dwxX0 n 0 Ch 1 Fn 1 Parameter 1 DWord
45. modules such as the CTRIO 2 When used with Do more Program Control is handled natively using memory structures and dedicated ladder instructions There is no CTRIO Memory Map to configure With Do more different CTRIO 2 registers are accessed through data structures or using the ladder instructions CTRIO Read Register CTREGRD and CTRIO Write Register CTREGWR The data structures and other registers are automatically created when the module is added and relevant features are selected in the CTRIO 2 s configuration The data structures have names such as CTRIO_000_C1F1 AtResetValue The structure name is broken down as follows CTRIO_000_C1F1 AtResetValue corresponds to a system address CTRIO signifies that this structure pertains to a CTRIO module 000 is the default designator fora CTRIO module in slot 0 C1F1 corresponds to input Channel 1 Function 1 Out0 would Module Level Structures refer to Output 0 AtResetValue is the structure member chosen in this particular case the value will go HIGH when the CTRIO SOO iaa count has been reset to the configured reset value SCTRIO_000 Ch1B SCTRIO_000 Ch1C Using the DataView tool of Do more Designer a list of SCTRIO_000 Ch1D possible structure members for a configured CTRIO module is CTRIO_000 Ch2A h bel S CTRIO_000 Ch2B shown below SCTRIO_000 Ch2C S CTRIO_000 Ch2D Function Level Output Level SCTRIO_000 ErrorCode Structures Structures SCT
46. nd bit parameters Then the program should drive the Process Command bit to a 1 and look for the CTRIO to acknowledge the command with the Command Complete bit Finally the program should remove the Process Command bit and set the Enable Output bit when appropriate If the Command Error bit is received the CTRIO was unable to process the command due to an illegal value in either the Command Code or parameter files On the pages that follow Pulse Profile and System Functions flowcharts are provided to give an overview of the steps needed to execute a pulse output profile or a SystemFunctions command DirectLOGIC PLC addressing tables are also provided with CTRIO I O data mapped in the word and CR bit areas of CPU memory shown on page 6 29 6 30 Counter I O User Manual 2nd Ed Rev D Chapter 6 Program Control ET Trapezoid S Curve Symmetrical S Curve Home Search Free Form Profiles For predefined Trapezoid S Curve Symmetrical S Curve Home Search and Free Form profiles the program needs to prepare the Load Table command by selecting Command Code 0010 Hex BCD and setting Word Parameter 1 to the File number of the profile example File 1 Trapezoid 1 Then the program can set the Process Command bit and watch for the Command Complete bit Then the program should clear the Process Command bit and set the Direction bit if necessary and finally the Enable Output bit to start the output pulses Clearing the Enable Output bit will always
47. nfirming Enable Output utput ive Status V2022 4 When ON module is pulsing OFF with Enable Status ON profile has completed isable utput V2056 0 Turn OFF when pulse status is OFF and Enable Status is ON spend utput V2056 2 Turn ON to pause output pulses without resetting pulse count utput Suspended V2022 2 ON when out pulse train has been suspended Counter I O User Manual 2nd Ed Rev D 6 33 Chapter 6 Program Control EY Dynamic Positioning and Dynamic Positioning Plus For Dynamic Positioning Positioning Plus only the motion limits of Min Frequency Max Frequency and Acceleration rate come from the CTRIO Workbench Profile After loading a Dynamic Positioning Positioning Plus Profile setting the Enable Output causes the CTRIO module to assume a position of 0 pulses The program should write the next target position in DWord Parameter 3 and set the Go to Position bit This will cause the CTRIO to set both the Pulses Active and the New Position Loaded bit and begin to output pulses The number of pulses and direction are determined by the CTRIO based on the difference between the current location and the specified target location The flowchart on the following page provides the logical sequence necessary to execute this type of pulse profile The program can monitor the state of the Pulses Active bit and the New Position Loaded bit to determine when the new
48. ogram Control Velocity Mode Flowchart The flowchart below provides the logical sequence necessary to execute a Velocity Mode pulse profile Load 20 into Select Command Code Direction Hex At this point the CTRIO will Load the begin outputting pulses Frequency into xN SET Parameter 1 Output Enable Decimal Load the Duty Verify the You can change the Cycle value into CTRIO is Frequency and or the Duty Load new Parameter 2 configured Cycle as often as you need parameter values correctly you can even change them Hex i A while the output is active Load the Pulse Count into Parameter 3 Decimal New Frequency or Duty Cycle The Output Active bit will be ON until the CTRIO sends out all of the pulses you configured Is Output Active ON You can also suspend the pulse output at any time with the Suspend Output bit SET RESET Process Process Command Command RESET Output Enable Change Direction Command Complete ON RESET Is Command Error ON Output Enable 6 40 Counter I O User Manual 2nd Ed Rev D Chapter 6 Program Control Run to Limit Mode NOTE Run to Limit Mode controls the pulse outputs directly from the CPU controller program No CTRIO I Workbench Pulse Profile is required for this mode The Run to Limit Command 0021Hex BCD can be used to seek limit positions or for H
49. ome Search routines You may want to consider using the Trapezoid with Limits Profile or the Home Search Pulse Profile created using Workbench unless you need the CPU controller to control the entire profile and parameters etc The CTRIO input must be assigned for Limit by the CTRIO Workbench utility Set Word Parameter 1 to the desired Frequency Set Word Parameter 2 Low Byte to the Duty Cycle and the High Byte to the Edge to Seek as defined below Leaving the Duty Cycle set to 0 achieves the default 50 otherwise it can be set in 1 increments by writing this value from 1 to 99 Hex BCD The flowchart on the following page provides the logical sequence necessary to execute a Run to Limit pulse profile See Chapter 8 for a DirectLOGIC programming example that executes a Run to Limit Mode pulse profile using the bit D word addressing in the table on page 6 44 Parameter 2 Word Parameter 2 defines three elements of the Run to Limit routine Bits 13 and 12 determine which edge s to terminate Output Pulses and Bits 9 and 8 determine which CTRIO Input terminal to use for the limit The low byte specifies the duty cycle ww en Rau amen Rising Edge Ch1 C 00 00 0000 Falling Edge Chi C 01 00 1000 Both Edge Ch1 C 10 00 2000 Rising Edge Chi D 00 01 0100 Falling Edge Ch1 D 01 1100 Both Edge Ch1 D 10 2100 Rising Edge Ch2 C 00 0200 Falling Edge Ch2 C 01 1200 Both Edge Ch2 C 10 2200 Rising Edge Ch
50. on Reset Entry Type decimal Pulse Time Preset Count Time4 Run to Position Target Position Edit Level Response Level Behavior decimal Deadband Level Rate Setting If appropriate for Entry Type in ms Field entries separated by an amp are to be loaded in the high byte and low byte of that word See example on page 6 7 3 Entry types are defined below Follows format of Input DWord Parameter 1 5 Flash ROM is rated for 100 000 writes Counter Quad Counter Reset must be ON to perform the Edit Entry Number for Edit Table Entry Commands The Entry Number refers to the position of the preset in the table sequence The first preset is Entry Number 0 the second preset is 1 and so forth Entry Type for Edit Table Entry Commands The Entry Type is defined according to the table below Entry Type Write Output ON Set Write Output OFF Reset Pulse Output ON Pulse Output OFF Toggle Output Reset Function Edits preset that resets count Counter I O User Manual 2nd Ed Rev D 6 23 Chapter 6 Program Control a Discrete Outputs Driven from a Scaled level Edit Level Response Command Code 30 If a Counter or Timer function is scaled to produce a rate alarm level settings can be used to trigger discrete outputs at values predetermined by the user The alarm levels can be set within CTRIO Workbench or from the user s control program Addit
51. ow the pulse state it will also turn ON for the configured duration Unlike the Count or Time capture the Pulse Catch function is automatically reset as long as the Enable Pulse Catch bit remains ON PLC Control Outputs Base Addr V2030 Bit of Word PLC Status Inputs Base Addr 2000 Bit of Word PLC Control Outputs Base Addr V2030 Control Relay D2 240 Chapter 6 Program Control PLCStatus Inputs Base Addr V2000 Control Relay D2 240 Description Pulse Catch Starting 2020 0 C160 On when Pulse Catch is in progress Enable Pulse Catch V2054 0 Turn ON to Enable Pulse Catch Function Pulse Catch Output Pulse State V2020 1 Counter I O User Manual 2nd Ed Rev D 6 2 1 ON for the Pulse Output Width duration specified in Configure 1 0 NOTE The CTRIO will not recognize any input pulses while the Output Pulse is active Take this into consideration when configuraing the Pulse Output Width time Chapter 6 Program Control a Runtime Changes to CTRIO Configured Preset Tables DL PLCs Presets and preset tables can be set up entirely within CTRIO Workbench so that no program control is necessary to assign discrete Preset Tables to CTRIO Input Fuctions You can make runtime edits to presets preset tables from your control program To make a runtime change a series of commands must be executed which will pass new values to a preset table or call a differ
52. pulses with direction to obtain the new position relative to previous position Position Loaded Status V2022 1 When ON Go To position is acknowledged Output Active Status V2022 4 When ON module is pulsing OFF with Position Loaded status ON new position move has completed Go To Position V2056 1 Turn OFF to be ready to load a new position Suspend Output V2056 2 Turn ON to pause output pulses without resetting pulse count Output Suspend V2022 2 To seek the next position repeat steps 7 10 6 36 Counter I O User Manual 2nd Ed Rev D ON when out pulse train has been suspended Chapter 6 Program Control Dynamic Velocity For Dynamic Velocity the motion limits of clockwise acceleration and deceleration and counter clockwise acceleration and deceleration come from the CTRIO Workbench Profile The target velocity is stored in a register in the CPU controller The program needs to prepare the Load Table command by selecting Command Code 0010 Hex BCD set Word Parameter 1 to the File number of the profile example File 3 Dynamic Velocity 1 and set Word Parameter 3 to the desired target velocity Then the program can set the Process Command bit and watch for the Command Complete bit Then the program should clear the Process Command bit Set the Enable Output bit to start the output pulses The velocity can be changed on the fly by entering
53. rget Velocity 1 P K5000 register Parameter 3 determines the direction of the pulse train output In the DirectLOGIC programming example to the right BCD 5000 is _finv converted to decimal 5000 when CO is turned ON You could load LD a V memory location instead of using a constant as shown in the example For a D2 250 use ADDD ADDB K1 OUTD 3000 6 37 Counter I O User Manual 2nd Ed Rev D Chapter 6 Program Control Dynamic Velocity Mode Flowchart The flowchart below provides the logical sequence necessary to execute a Dynamic Velocity pulse profile Load 10 into Command Code Verify that the Hex CTRIO is configured correctly Load Pulse Profile Number into Parameter 1 Decimal SET Process Command Verify that you ve entered the correct table number Is Command Complete ON RESET Process Command RESET Process Command The CTRIO is continually reading the Velocity register in the CPU When a new value appears in this register the CTRIO will use the SET profile settings to move to Output Enable the new velocity The direction is determined automatically from the sign of the velocity value Positive values will produce CW pulses Load Velocity value into Negative values will produce Parameter 3 CCW pulses You can change the velocity value as often as you need You can also suspend the pulse output a
54. rve File of stored profile Not Used Not Used Dynamic Positioning Positioning Plus File of stored profile Not Used Target Position 6 6 Counter I O User Manual 2nd Ed Rev D Configured Profile from CTRIO Workbench WORD Parameter 1 Contents Chapter 6 Program Control WORD Parameter 2 Contents Parameter 3 Contents DWORD Dynamic Velocity File of stored profile Not Used Target Velocity Home Search File of stored profile Not Used Not Used Trapezoid Plus File of stored profile Not Used Target Position Free Form File of stored profile Not Used Not Used NOTE For DirectSOFT users the 1 0 Map dialog displays the exact memory locations in use by the CTRIO module Within the I O Map dialog you can print out a report of memory loctions in use Output n Parameter Definitions Parameters are in decimal format unless specified Profiles Completely Controlled by User Program Parameter 1 Contents WORD Parameter 2 Contents WORD Parameter 3 Contents DWORD Velocity Mode Initial Frequency Duty Cycle Number of Pulses Hex Not Used Input Function Comparison Value Run to Limit Mode Initial Frequency Input Edge Duty Cycle Hex Input Function Comparison and Duty Cycle Hex Run to Position mode Initial Frequency Input Function Control Bit Definitions Input function offsets are listed in th
55. suspend pulsing and reset any profile in progress to it s beginning Once complete the profile remains loaded and can be restarted by clearing the Enable Output changing the direction bit if desired and again setting the Enable Output The flowchart on the next page provides the logical sequence necessary to execute a Trapezoidal S Curve Symmetrical S Curve Home Search or Free Form pulse profile For the Home Search routine a CTRIO input must be assigned to Limit by the CTRIO 6 Workbench Configure I O dialog See Chapter 8 for a DirectLOGIC programming example that loads and runs a pulse profile using the bit D word addressing in the table on the page 6 34 NOTE For a Home Search Profile if you are at the home position and the Home Search profile is initiated there will not be any pulse outputs Counter I O User Manual 2nd Ed Rev D l 6 3 1 Chapter 6 Program Control Trapezoid S Curve Symmetrical S Curve Home Search Free Form Flowchart The flowchart below provides the logical sequence necessary to execute a Trapezoid S Curve Symmetrical S Curve Home Search or Free Form pulse profile Load 10 into Command Code Verify that the HEX CTRIO is configured correctly Load Pulse Profile Number into Parameter 1 Decimal Is Table Number Correct SET Process Command ON Verify that you ve entered the correct table number Command Complete ON RESET Process Comm
56. t Definitions Raw Mode Output Control Offsets are listed in the order of the Output 0 Output 3 Output n Control Bits Bit Offsets WinPLC EBC PBC V memory Offsets transfers from CPU to CTRIO DEVNETS MODBUS DirectLOGIC PLCs Enable Output 32 40 48 56 26 0 26 8 27 0 27 8 System Functions Status Bit Definitions From Table on page 6 2 DirectLOGIC Offset n 24 Status Bits V memory Offsets transfers from CTRIO to CPU DirectLOGIC PLCs 6 System Command Error 24 6 System Command Complete 24 7 Chi A 25 0 Chi B 25 1 Chic 25 2 ChiD 25 3 Ch2 A 25 4 Ch2 B 25 5 Ch2 C Ch2 D Out 0 Active Out 0 Mode Out 1 Active Out 1 Mode Out 2 Active Out 2 Mode Out 3 Active Out 3 Mode System Functions Control Bit Definitions From Table on page 6 4 DirectLOGIC Offset n 30 Control Bits V memory Offsets transfers from CPU to CTRIO DirectLOGIC PLCs Process System Command 30 7 6 8 Counter I O User Manual 2nd Ed Rev D Chapter 6 Program Control 1 O Map Dialog The I O Map dialog is accessible from the main Workbench dialog On the main Workbench dialog click the button labeled I O Map The I O Map dialog divides the controller I O memory used by the CTRIO module into three groups 1 0 Map Input Functions Output Functions and System Functions Just below the Map Display Mode field you will see tabs to switch between Input Funct
57. t any time with the Suspend Output bit RESET Output Enable 6 38 Counter I O User Manual 2nd Ed Rev D Chapter 6 Program Control Velocity Mode NOTE Velocity Mode controls the pulse outputs directly from the CPU controller program No CTRIO Workbench Pulse Profile is required for this mode Velocity Mode command Command 0020 Hex BCD allows a specified number of pulse output counts or the number of Pulses can be set to FFFFFFFF in Hex for unlimited pulse counts Leaving the Duty Cycle set to 0 achieves the default 50 otherwise it can be set in 1 increments by writing this value from 1 to 99 decimal After this command is processed the Run Frequency and Duty Cycle fields can be adjusted by direct access In order to change directions from Pulse Output in Velocity mode the Enable Output bit must first be cleared which stops the Pulse Outputs Then after the new direction bit is written the Enable Output bit can be set to resume pulsing The flowchart on the following page provides the logical sequence necessary to execute a Velocity Mode pulse profile See Chapter 8 for a DirectLOGIC programming example that executes a Velocity Mode pulse profile using the bit D word addressing in the table below Velocity Mode control on CTRIO YO amp Y1 Name PLC Control Outputs Base Addr V2030 Bit of Word PLC Status Inputs Base Addr V2000 Bit of Word PLC Control Outputs Base Addr V2030
58. ter 3 DWord dwY3 n 6 Output 3 Parameter 3 DWord wY0 Output 0 Command Word wY1 Output 0 Parameter 1 Word wY2 Output 0 Parameter 2 Word wY3 Output 1 Command Word wY4 Output 1 Parameter 1 Word wY5 Output 1 Parameter 2 Word wY6 Output 2 Command Word wY7 Output 2 Parameter 1 Word wY8 Output 2 Parameter 2 Word wY9 Output 3 Command Word wY10 Output 3 Parameter 1 Word wY11 Output 3 Parameter 2 Word bY0 7 bY8 15 Ch 1 Fn 1 Control Low Byte Ch 1 Fn 2 Control High Byte DO PO PO PSE PSE PY PO PO PO PY PY NINI BY AJA Word bY16 23 bY24 31 Ch 2 Fn 1 Control Low Byte Ch 2 Fn 2 Control High Byte Word bY32 39 bY40 47 Output 0 Control Low a Word bY48 55 bY56 63 Output 1 Control High Byte Output 2 Control Low Be Output 3 Control High Byte Word bX64 71 bX72 79 bx80 87 bx88 95 System Functions Read Write CTRIO Internal Registers see p 6 6 for bit definitions DWord 52 Total Bytes Output n Parameter Definitions Parameters are in decimal format Configured Profile from Parameter 1 Contents Parameter 2 Contents Parameter 3 Contents CTRIO Workbench WORD WORD DWORD Trapezoid Trapezoid with Limits File of stored profile Not Used Not Used S Curve Symmetrical S Cu
59. tions Output Functions and Systems TEGENE Functions addresses shown in the I O Map EE dialog It is very convenient to have a Vato Captured Start 2020 9 Capture Complete printed list of the CPU controller I O 2054 8 Enable Capture memory used by the CTRIO module when attempting to write the control program ouga tee ee 2022 0 Output Enabled 2022 1 Position Loaded Exporting to DirectSOFT You can export a csv file containing addressing and nicknames used in the I O Map dialog Click on the Export button located near the bottom of the I O Map dialog to display the Export to DirectSOFT dialog shown below on the left The csv file shown below on right contains a combination of the Input Functions Output Functions and Systems Functions addressing and nicknames shown in the I O Map dialog This file can imported into your DirectSOFT ladder logic program DirectSOFT gt File gt Import gt Element Documentation If you have more than one CTRIO module in a system and intend to create a csv file for more than one module use the Add Prefix or Add Suffix option to distinguish one module s nicknames from the others For example add add prefix or suffix S1 to identify the CTRIO module s nicknames in slot 1 Export to DirectSOFT x Export Filename CTRIO CSV r Prefix Suffix D e Cae Yew post Foma jook Qis Window tpb Avot OSG 6RAY IRAT OSTA E B dnd 0 B7 yu ESBH Sx 25 eR _ gt A c
60. ue Output Enabled V2022 0 C120 ON when Enable Output is ON Position Loaded V2022 1 C121 Used for Dynamic Positioning Output Suspended V2022 2 C122 ON when Output pulse is suspended Output Active V2022 4 C124 ON when Output is Pulsing Output Stalled V2022 5 C125 CTRIO Output Fault should never be ON Command Error V2022 6 C126 ON if Command or Parameters are invalid Command Complete V2022 7 C127 ON if Module Receives Process Command Control Bits Registers Example using V2030 as base output address for Output Channel 1 Control DWords Words and bits sent from CPU to CTRIO Name PLC Example 1 Bit of Word see note 2 D2 250 1 260 D4 450 PLC Example 2 Control Relay see note 1 D2 240 CPU Command Code 2040 V2040 Parameter 1 V2041 V2041 Parameter 2 V2042 V2042 Parameter 3 V2031 V2030 V2031 V2030 Enable Output V2056 0 C220 Go to Position V2056 1 C221 Suspend Output V2056 2 C222 Direction V2056 4 C224 Process Command V2056 7 6 28 Counter I O User Manual 2nd Ed Rev D C227 Chapter 6 Program Control Memory Mapping Example for D2 240 CPU NOTE 1 The D2 240 CPU does not support bit of word addressing The status and control bits must be mapped to control relay words An example of mapping code is shown below SP 1
Download Pdf Manuals
Related Search
Related Contents
CoolMatic HDC195, HDC225 General Tools 828 Use and Care Manual Oceansat-2 Wind Product User Manual Bedienungsanleitung Jabra BT8030 User's Manual MANUAL DEL PROPIETARIO Kensington AbsolutePower 1.0 CX E3シリーズ - 三菱電機インフォメーションネットワーク株式会社 INSTALLATION AND USER`S MANUAL FOR Copyright © All rights reserved.
Failed to retrieve file