Home
Twido Soft - Elmatik AS
Contents
1. lCa Catch input gt amp IN VFCi P VFCI U VFC Counter a Direction of IB UP DOWN flag or phase 2 amp gt VFCi F VFCI P o M Overflow output reset Input VFCLV gt 1 gt Current Value p current S VFCi value gt gt VFCi C Catch gt 1 value Read VFCi V instruction VFCi THO VFCi S0 Threshold p gt Value 0 VFCi TH1 Comparison 2 VFCiI S1 gt Q0 0 x Threshold __ penek Value 1 output amp VFCI R gt OO oy or eflex YNFCI S output 1 Enable Note Outputs are managed independently from the controller cycle time The response time is between 0 and 1ms 402 TWD USE 10AE Advanced Instructions Single Up Counter Operation The following is an example of using VFC in a single up counter mode The following configuration elements have been set for this example N FCO P preset value is 17 while the VFCO SO lower threshold value is 14 and the VFCO0 S1 upper threshold is 20 Reflex lt VFC SO Output NFCO SO lt lt VFCO S1 gt VFCO S1 Q0 0 2 X Q0 0 3 X A timing chart follows VFCO P 17 VFC0 S0 14 VFC0 S1 20 IN
2. Master controller Remote 1 O Remote I O Address 0 Address 2 Address 4 12 0 0 10 0 0 12 0 23 10 0 23 Q2 0 0 Q0 0 0 Q2 0 15 Q0 0 15 14 0 0 d 10 0 0 14 0 23 10 0 23 Q4 0 0 Q0 0 0 Q4 0 15 Q0 0 15 112 TWD USE 10AE Communications Peer Controller Data Access To communicate with peer controllers the master uses network words INW and QNW to exchange data Each peer on the network is accessed by its remote address j using words INWj k and QNW j k Each peer controller on the network uses INWO0 0 to INW0 3 and QNWO 0 to QNWO0 3 to access data on the master Network words are updated automatically when the controllers are in Run or Stop mode The example below illustrates the exchange of a master with two configured peer controllers Remote link Po o Master controller Peer controller Peer controller Address 0 Address 1 Address 3 INW1 0 QNWO 0 INW1 3 QNWO 3 QNW1 0 INWO 0 QNW1 3 IWNO 3 INW3 0 AANWO 0 AINW3 3 Re oJ awo QNW3 0 INWO 0 QNW3 3 Pinos There is no peer to peer messaging within the remote link The master application program can be used to manage the network words in order to transfer information between the remote controllers in effect using the master as a bridge TWD USE 10AE 113 Communica
3. Operation Initial state 1 1 0 0 0 0 0 0 1 1 0 17 1 1 0 0 Bit 15 Bit 0 CU SBRi performs a shift to the left Bit 15 is lost 1 0 0 0 0 0 0 1 1 0 1 1 1 0 0 0 Bit 15 Bit 0 This is also true of a request to shift a bit to the right Bit 15 to Bit 0 using the CD instruction Bit 0 is lost If a 16 bit register is not adequate it is possible to use the program to cascade several registers In the following example a bit is shifted to the left every second while Bit 0 assumes the opposite state to Bit 15 Reversible SBRO 15 SBR0 0 programming LDN SBRO 15 ST SBRO O BLK SBRO LD S6 CU END BLK SBRO S6 Non Reversible CU programming LDN SBRO 15 ST SBRO O LD S6 CU SBRO The following table contains a list of special cases for programming the Shift Bit Register function block Special Case Description Effect of a cold restart S0 1 Sets all the bits of the register word to 0 Effect of a warm restart S1 1 Has no effect on the bits of the register word TWD USE 10AE 335 Basic Instructions Step Counter Function Block SCi Introduction A Step Counter function block SCi provides a series of steps to which actions can be assigned Moving from one step to another depends on external or internal events Each time a step is active the a
4. 304 TWD USE 10AE Basic Instructions Timing diagram The following diagram displays the timing for Load instructions LD LDN LDR LDF A y l10 1 MO I10 2 I10 3 Q0 3 Q0 2 Q0 4 Q0 5 TWD USE 10AE 305 Basic Instructions Assignment instructions ST STN R S Introduction The assignment instructions ST STN S and R correspond respectively to the direct inverse set and reset coils Examples The following diagrams are examples of assignment instructions I10 1 Q0 3 i x LD l0 1 ST QO0 3 Q0 2 i STN Q0 2 S Q0 4 Q0 4 s LD 0 2 R Q0 4 I0 2 Q0 4 fi IR Permitted The following table lists the types of assignment instructions with ladder equivalents Operands and permitted operands List Instruction Ladder Equivalent Permitted Operands ST Q QA M S BLK X Xk STN Q KQA M S BLK x Xk S AQ QA M S X BLK x Xk s R Q QA M S X BLK X Xk R 306 TWD USE 10AE Basic Instructions Timing diagram The following diagram displays the timing for assignment instructions ST STN S R 10 1 10 1 10 1 10 2 Q0 3 Q0 2 Q0 4 Q0 4
5. TWD USE 10AE 213 Installing the AS Interface bus Step Description Result All the slave parameters are automatically checked to see if the operation is possible Illustration of result Configuration Debugging AS interface V2 configuration Std A Slaves IB Slaves 4 00 I no m 02 03 i ASI20MT41E 04 05 ff inout24n2 06 WXA36 Bo 11 i Unknown 15 Unknown 16 v After performing this operation the diagnostics for the slave at address 3B indicate slave not detected meaning that the slave expected at this address is no longer there By selecting the address 15B the profile and the parameters of the moved slave can be re located but the name of the slave remains unknown as it was not expected at this address Note The profile and parameters of a slave are not associated with a name Several slaves with different names can have the same profiles and parameters 214 TWD USE 10AE Installing the AS Interface bus Updating the AS Interface bus configuration in online mode At a Glance In online mode no modification of the configuration screen is authorized and the physical configuration and software configuration can be different Any difference in profile or parameters for a configured or non configured slave can be taken into a
6. LD M2 program scanning ST QO 2 If 10 2 0 continues program scanning until new END instruc tion TWD USE 10AE 361 Basic Instructions NOP Instruction NOP The NOP instruction does not perform any operation Use it to reserve lines ina program so that you can insert instructions later without modifying the line numbers 362 TWD USE 10AE Basic Instructions Jump Instructions Introduction Jump instructions cause the execution of a program to be interrupted immediately and to be continued from the line after the program line containing label Li i 1 to 16 for a compact and 1 to 63 for the others JMP JMPC and Three different Jump instructions are available JMPCN e JMP unconditional program jump e JMPC program jump if Boolean result of preceding logic is 1 e JMPCN program jump if Boolean result of preceding logic is 0 Examples Examples of jump instructions 000 LD M15 001 JMPC L8 Jump to label L8 if M15 002 LD MW24 gt MW12 is at 1 003 ST M15 004 JMP L12 Unconditional jump to label 005 L8 4 L12 006 LD M12 007 AND M13 008 ST M12 009 JMPCN L12 Jump to label L12 if 010 OR M11 M12 is at 0 oll S QO0 0 012 L12 lt 013 LD 10 0 Guidelines e Jump instructions are not permitted between parentheses and must not be placed between the instructions AND OR and a close parenthesis instruction y
7. TWD USE 10AE 477 Advanced Instructions Appendix 2 First Order With Time Delay Model Introduction This section presents the first order with time delay model used to describe a variety of simple but nonetheless important industrial processes including thermal processes First Order With It is widely assumed that simple one stimulus thermal processes can be Time Delay adequately approximated by a first order with time delay model Model The transfer function of such first order open loop process has the following form in the Laplace domain equ 2 S _ k g op U 1 tp where k the static gain t the time constant 6 the delay time U the process input this is the output of the PID controller S the process output 478 TWD USE 10AE Advanced Instructions The Process The key parameter of the process response law equ 2 is the time constant lt It is Time Constant t a parameter intrinsic to the process to control The time constant t of a first order system is defined as the time in sec it takes the system output variable to reach 63 of the final output from the time the system started reacting to the step stimulus u t The following figure shows a typical first order process response to a step stimulus Process output s t A S 95 of S 86 of S Step response s ty Setpoint u t 63 of S x O time delay 0 0 0 ti
8. System Function Description Init Control Bit state S113 Remote link e Set to 0 for a master or slave the remote link 0 S gt U configuration operation configuration operation is OK e Set to 1 for a master the remote link configuration operation has an error e Set to 1 fora slave the remote link configuration operation has an error S118 Remote I O error Normally set to 1 This bit can be set to 0 when an I O 1 S fault is detected on the remote link S119 Local I O error Normally set to 1 This bit can be set to 0 when an I O 1 S fault is detected on the remote link SW118 determines the nature of the fault Resets to 1 when the fault disappears Table Abbreviation table Abbreviations Described Abbreviation Description S Controlled by the system U Controlled by the user U gt S Set to 1 by the user reset to 0 by the system S gt U Set to 1 by the system reset to 0 by the user 516 TWD USE 10AE System Bits and Words System Words SW Introduction The following section provides detailed information about the function of the system words and how they are controlled Detailed The following table provides detailed information about the function of the system Description words and how they are controlled System Function Description Control Words SWO Controller scan Modifies controller scan period defined at configuration through the U
9. 266 TWD USE 10AE Ladder Language Unconditional Rungs Ladder List Rungs Programming unconditional rungs also requires following List programming guidelines to ensure List to Ladder reversibility Unconditional rungs do not have tests or conditions The outputs or action instructions are always energized or executed The following diagram provides examples of unconditional rungs and the equivalent List sequence Q0 4 LD 1 ST Q0 4 LD MW5 0 MWS5 0 JMP L6 gt gt L6 Notice that each of the above unconditional List sequences begin with a load instruction followed by a one except for the JMP instruction This combination sets the Boolean accumulator value to one and therefore sets the coil store instruction to one and sets MWS5 to zero on every scan of the program The exception is the unconditional jump List instruction JMP L6 which is executed regardless of the value of the accumulator and does not need the accumulator set to one If a List program is reversed that is not completely reversible the reversible portions are displayed in the Ladder view and the irreversible portions are displayed in Ladder List Rungs A Ladder List Rung functions just like a small List editor allowing the user to view and modify the irreversible parts of a Ladder program TWD USE 10AE 267 Ladder Language Program Documentation Documenting Yo
10. TWD USE 10AE 255 Ladder Language Comparison Comparison blocks are placed in the test zone of the programming grid The block Blocks may appear in any row or column in the test zone as long as the entire length of the instruction resides in the test zone Comparison blocks are horizontally oriented and occupy two columns by one row of the programming grid See the following example of a comparison block Sr E leon a oe YMW0 SW50 ITS Te i Ip l pl oook l o l Operate blocks Operate blocks are placed in the action zone of the programming grid The block may appear in any row in the action zone The instruction is right justified it appears on the right and ends in the last column Operate blocks are horizontally oriented and occupy four columns by one row of the programming grid The following is an example of an operate block tooo oOo o O o l fr l l l 4 ake lI je l EA lI f MW 120 SQRT MW15 Ee ot ee 4 1 I 4 ly 1 ly 4 256 TWD USE 10AE Ladder Language Ladder Language Graphic Elements Introduction Contacts Link Elements Instructions in Ladder diagrams consist of graphic elements The contacts graphic elements are programmed in the test zone and take up one cell one row high by one column wide Name Graphic elemen
11. S100 0 master slave DPT not active TwidoSoft cable NOT connected 1 master slave DPT active TwidoSoft cable connected S110 0 master slave set to 0 by the application 1 master all remote link exchanges completed remote I O only slave exchange with master completed S111 0 master single remote link exchange completed slave single remote link exchange detected 1 master single remote link exchange in progress slave single remote link exchange detected S112 0 master remote link disabled 1 master remote link enabled S113 0 master slave remote link configuration operation OK 1 master remote link configuration operation error slave remote link operation error If a master controller restarts one of the following events happens e A cold start 80 1 forces a re initialization of the communications e Awarm start S1 1 forces a re initialization of the communications e In Stop mode the master continues communicating with the slaves TWD USE 10AE 109 Communications Slave Controller Restart Master Controller Stop If a slave controller restarts one of the following events happens e A cold start 80 1 forces a re initialization of the communications e Awarm start S1 1 forces a re initialization of the communications e In Stop mode the slave continues communicating with the master If the master indicates a Stop state e The remote I Os apply a Stop state
12. 2 Double click on the Ethernet Port icon to bring up the Ethernet Configuration dialogbox as shown below Result Ethernet Configuration IP Address Configure Marked IP Idle Checking Remote Devices C Default IP Address Configured IP Address 192 168 1 101 Subnetwork mask 255 255 255 0 Gateway 192 168 1 101 Cancel Help Note There are two alternate ways to call up the Ethernet Configuration screen 1 Right click on the Ethernet Port icon and select Edit from the popup list 2 Select Hardware gt Ethernet from the TwidoSoft menu bar TCP IP Setup The following sections detail how to configure the Twido TWDLCAE40DRF TCP IP parameters by using the IP Address Configure Marked IP Idle Checking and Remote Devices tabs TWD USE 10AE 163 Communications IP Address Configure Tab Overview IP Address Configure tab Configuring the IP Address tab The following information describes how to configure the IP Address Configure tab of the Ethernet Configuration dialogbox Note The IP address of the Twido controller can be configured when the TwidoSoft application program is in offline mode only The following figure presents a sample screen of the IP Address Configure tab showing examples of IP Subnet and Gateway addresses configured manually by the user Ethernet Configuration IP Addres
13. 15 i Unknown 16 x Result The image of the selected slave image of the profile and parameters is then transferred to the configuration screen 4 Repeat the operation for each of the slaves whose image you would like to transfer to the configuration screen 216 TWD USE 10AE Installing the AS Interface bus Return to the Configuration Screen When the user returns to the configuration screen all the new slaves unexpected which have been transferred are visible Illustration of the configuration screen following the transfer of all slaves Configuration Debug AS interface V2 Configuration Std A Slaves 7B Slaves 4 00 02 03 ASIZOMTAIE 04 05 X INouT24 12 06 WXA36 07 08 09 10 11 12 13 14 15 Unknown 16 Unknown Key e The cross signifies that there are differences between the image of the profile of the transferred slave and the profile initially desired in the configuration screen e The exclamation mark signifies that a new profile was added to the configuration screen Explanation The configuration screen always shows the permanent image of the desired configuration this is why the slave is still present as 3B in spite of the change of address See Modification of Slave Address p 2
14. 65535 20 17 14 VFCO V 0 THO TH1 Reflex output 0 Reflex output 1 change VFCO0 S1 to 17 OOOO VFCO U 1 because VFC is an up counter S input active makes threshold S1 new value to be granted in next count a catch of the current value is made so VFCO C 17 TWD USE 10AE 403 Advanced Instructions Single Down The following is an example of using VFC in a single down counter mode The Counter following configuration elements have been set for this example Operation FCO P preset value is 17 while the VFCO SO lower threshold value is 14 and the VFCO S1 upper threshold is 20 Reflex lt VFC SO NVFCO SO lt lt VFCO S1 gt VFCO S1 Output Q0 0 2 X xX Q0 0 3 X Example VFC0 P 17 VFC0 S0 14 VFC0 S1 20 fe 0O Q n a g enig een s Pee oe 65535 mt Y i i 20 oo e i i 7 e
15. PID O Note In any given Twido automation application the maximum number of configurable PID functions is 14 The key features are as follows Analog input Linear conversion of the configurable measurement High or low configurable input alarm Analog or PWM output Cut off for the configurable output Configurable direct or inverse action TWD USE 10AE 425 Advanced Instructions Principal of the Regulation Loop At a Glance Illustration The working of a regulation loop has three distinct phases e The acquisition of data e Measurements from the process sensors analog encoders e Setpoint s generally from the controller s internal variables or from data from a TwidoSoft animation table e Execution of the PID regulation algorithm e The sending of orders adapted to the characteristics of the actuators to be driven via the discrete PWM or analog outputs The PID algorithm generates the command signal from e The measurement sampled by the input module e The setpoint value fixed by either the operator or the program e The values of the different corrector parameters The signal from the corrector is either directly handled by a controller analog output card linked to the actuator or handled via a PWM adjustment on a discrete output of the controller The following diagram schematizes the principal of a regulation loop Animation Table Running TwidoSo
16. TWD USE 10AE 501 Advanced Instructions Table sort function General The sort function available is as follows e SORT_ARR performs sorts in ascending or descending order of the elements of a double word or floating word table and stores the result in the same table Structure Ladder language l3 2 SORT_ARR MW0 MF0 6 l1 2 SORT_ARR 1 MD20 6 l1 3 SORT_ARR 0 MD40 8 Instruction List Language LD 13 2 SORT_ARR MW20 MFO 6 LD 11 2 SORT_ARR 1 MD20 6 LD 11 3 SORT_ARR 0 MF40 8 Syntax Syntax of table sort functions Function Syntax SORT_ARR Function direction Tab e the direction parameter gives the order of the sort direction gt 0 the sort is done in ascending order direction lt 0 the sort is done in descending order direction 0 no sort is performed e the result sorted table is returned in the Tab parameter table to sort Parameters of table sort functions Type Sort direction Table Tab Double word tables MWi immediate value MDi L Floating word tables MWi immediate value MFi L 502 TWD USE 10AE Advanced Instructions Floating point table interpolation function Overview Interpolation Rule Graphical Representation of the Linear Interpolation The LKUP function is used to interpolate a set of X versus Y floati
17. Ladder diagram BLK R2 LD M1 LD M1 I R2 I LD I0 3 LD 10 3 0 R2 Oo ANDN R2 E END_ BLK YMW20 R2 0 LD 10 3 LD 10 2 ANDN R2 E ANDN R2 F MW20 R2 0 R2 1 MW34 LD 10 2 ST M1 ANDN R2 F R2 1 MW34 ST M1 Reversible program Non reversible program TWD USE 10AE 379 Advanced Instructions Configuration Special Cases The only parameter that must be entered during configuration is the type of register e FIFO default or e LIFO The following table contains a list of special cases for programming the Shift Bit Register function block Special case Description Effect of a cold restart SO 1 Initializes the contents of the register The output bit Ri E associated with the output E is set to 1 Effect of a warm restart S1 1 of a Has no effect on the current value of the register controller stop nor on the state of its output bits 380 TWD USE 10AE Advanced Instructions Pulse Width Modulation Function Block PWM Introduction The Pulse Width Modulation PWM function block generates a square wave signal on dedicated output channels Q0 0 0 or Q0 0 1 with variable width and consequently duty cycle Controllers with relay outputs for these two channels do not support this function due to a frequency limitation There are two PWM blocks available PWMO uses dedicated output Q0 0 0 and PMW1 uses dedicated output Q0 0 1 The PLS func
18. Press the MOD ENTER key to enter the edit mode Press the gt key until you are in the field that you wish to modify Press the 7 N key to increment the value of that field Continue steps 3 and 4 until the address settings are complete O oa A UJN Press the MOD ENTER key to accept the modified values or ESC to discard any modifications made while in edit mode 244 TWD USE 10AE Operator Display Operation Time of Day Clock Introduction Displaying and Modifying Time of Day Clock You can modify the date and time using the operator display if the RTC option cartridge TWDXCPRTC is installed on your Twido controller The Month is displayed in the upper left side of the HMI Display Until a valid time has been entered the month field will contain the value RTC The day of the month is displayed in the upper right corner of the display The time of day is in military format The hours and minutes are shown in the lower right corner of the display and are separated by the letter h The example below shows that the RTC is set to March 28 at 2 22 PM MA R 2 8 14h22 Note 1 The TWDLCA 40DRF series of compact controllers have RTC onboard 2 On all other controllers time of day clock and real time correction are only available if the Real Time Clock RTC option cartridge TWDXCPRTC is installed To display and modify the Time of Day Clock Step
19. SW81 Expansion I O Module 1 Status Same definitions as SW80 SW82 Expansion I O Module 2 Status Same definitions as SW80 SW83 Expansion I O Module 3 Status Same definitions as SW80 SW84 Expansion I O Module 4 Status Same definitions as SW80 SW85 Expansion I O Module 5 Status Same definitions as SW80 SW86E Expansion I O Module 6 Status Same definitions as SW80 SW87 Expansion I O Module 7 Status Same definitions as SW80 192 TWD USE 10AE Managing Analog Modules Example of Using Analog Modules Introduction This section provides an example of using Analog modules available with Twido Example analog This example compares the analog input signal with five separate threshold values input A comparison of the analog input is made and a bit is set on the base controller if it is less than or equal to the threshold LD IW1 0 lt 16 Q0 0 ST Q0 0 IW1 0 lt 16 LD IW1 0 lt 32 Q0 1 ST Q0 1 IW1 0 lt 32 LD IW1 0 lt 64 ST Q0 2 QO 2 IW1 0 lt 64 LD IW1 0 lt 128 ST Q0 3 Q0 3 IW1 0 lt 128 LD IW1 0 lt 256 2 ST Q0 4 Q0 4 IW1 0 lt 256 TWD USE 10AE 193 Managing Analog Modules Example analog The following program uses an analog card in slot 1 and 2 The card used in slot 1 output has a 10 volt output with a
20. Sampling period Using a timebase of 0 01 seconds its value is between 1 and 10000 This corresponds to a sampling period of between 0 01 and 100 seconds PWM output Using a timebase of 0 1 seconds its value is between 1 and 500 This corresponds to a modulation period of between 0 1 and 50 seconds Analog output Value between 0 and 10000 High level alarm on process variable This alarm is set after conversion It is set to a value between 32768 and 32767 if conversion is activated and to 0 and 10000 if it is not Low level alarm on process variable This alarm is set after conversion It is set to a value between 32768 and 32767 if conversion is activated and to 0 and 10000 if it is not High limit value on output This limit value is between 0 and 10000 for an analog output value When PWM is active the limit corresponds to a percentage of the modulated period 0 for 0 and 100 for 10000 Low limit value on output This limit value is between 0 and 10000 for an analog output value When PWM is active the limit corresponds to a percentage of the modulated period 0 for 0 and 100 for 10000 Manual mode When manual mode is active the output is assigned a fixed value set by the user This output value is between 0 and 10000 0 to 100 for PWM output Direct or inverse action Direct or inverse is available and acts directly on the output Auto Tuning AT This
21. Effect of modifying the preset Ci P Modifying the preset value via an instruction or by adjusting it takes effect when the block is processed by the application activation of one of the inputs TWD USE 10AE 331 Basic Instructions Programming and Configuring Counters Introduction The following example is a counter that provides a count of up to 5000 items Each pulse on input l1 2 when internal bit M0 is set to 1 increments the counter C8 up to its final preset value bit C8 D 1 The counter is reset by input l1 1 Programming The following illustration is a counter function block with examples of reversible and Example non reversible programming I1 1 R C8 EL 4S I1 2 MO ADJY D cu CiP 9999 CD F C8 D Q0 0 el L Ladder diagram BLK C8 LD I1 1 LD I1 1 R C8 R LD I1 2 LD I1 2 AND MO AND MO CU C8 CU LD C8 D END_BLK ST QO0 0 LD C8 D ST Q0 0 Reversible Programming Non Reversible programming 332 TWD USE 10AE Basic Instructions Configuration Example of an Up Down Counter The following parameters must be entered during configuration e Preset value Ci P set to 5000 in this example e Adjust Yes The following illustration is an example of an Up Down Counter function block MO I0 0 MO R 0 E R s M0 D s cU
22. ST QO0 1 I10 2 QO0 0 MPP AND I0 2 ST Q0 0 If several contacts are parellelized they must be nested within each other or completely separate 10 0 10 1 10 5 QO0 1 I10 2 I10 3 10 6 10 7 I0 0 I0 1 I0 5 Q0 1 Ld 10 2 10 4 262 TWDUSE 10AE Ladder Language The following schematics cannot be programmed I0 0 I01 Q0 1 ay LJ I0 2 10 3 10 4 i I0 0 I01 I10 5 Q0 1 LJ I0 2 103 10 4 TWD USE 10AE 263 Ladder Language In order to execute schematics equivalent to those they must be modified as follows LD 00 AND I0 1 5 Q0 1 w I0 1 A OR I0 2 AND I03 10 2 10 3 OR lI0 4 AND I03 10 4 10 3 ST QO0 1 LD 00 i s g AND I0 1 vA a ps OR I0 2 AND I03 0 0 10 2 To AND I0 5 OR I0 2 AND I0 4 10 2 I10 4 l ST Q0 1 264 TWDUSE 10AE Ladder Language Ladder List Reversibility Introduction Understanding Reversibility Ensuring Reversibility Program reversibility is a feature of the TwidoSoft programming software that provides conversion of application programs from Ladder to Lis
23. SW113 Remote link configuration Indication Bit 0 corresponds to remote controller 1 bit 1 to remote controller 2 etc Bit 0 to 6 e Set to 0 remote controller 1 7 not configured e Setto 1 remote controller 1 7 configured Bit 8 to bit 14 e Set to 0 remote I O configured as remote controller 1 7 e Setto 1 peer controller configured as remote controller 1 7 SW114 Enable schedule blocks Enables or disables operation of schedule blocks by the user program or operator display Bit 0 1 enables schedule block 0 Bit 15 1 enables schedule block 15 Initially all schedule blocks are enabled If schedule blocks are configured the default value is FFFF If no schedule blocks are configured the default value is 0 S and U SW118 Base controller status word Shows faults detected on master controller Bit 9 0 External fault or comm Fault Bit 12 0 RTC not installed Bit 13 0 Configuration fault I O extension configured but absent or faulty All the other bits of this word are set to 1 and are reserved For a controller which has no fault the value of this word is FFFFh SW120 Expansion I O module health One bit per module Address 0 Bit 0 1 Unhealthy 0 OK Table Abbreviations Described Abbreviation table Abbreviation Description S Controlled by the system U Controlled by the user 52
24. TWD USE 10AE 307 Basic Instructions Logical AND Instructions AND ANDN ANDR ANDF Introduction The AND instructions perform a logical AND operation between the operand or its inverse or its rising or falling edge and the Boolean result of the preceding instruction Examples The following diagrams are examples of logic AND instructions 10 1 MI1 Q0 3 re a ST Q0 3 M2 10 2 Q0 2 LD M2 ANDN IO0 2 ST Q0 2 I0 3 10 4 Q0 4 LD 10 3 P s ANDR IO0 4 S Q0 4 M3 I0 5 QO 5 LD M3 NI s ANDF I0 5 S Q0 5 Permitted The following table lists the types of AND instructions with ladder equivalents and Operands permitted operands List Instruction Ladder Equivalent Permitted Operands AND 0 1 l VIA Q QA M S X BLK x Xk ANDN 0 1 l IA Q QA M S X BLK x Xk ANDR l IA M P ANDF l IA M N 308 TWD USE 10AE Basic Instructions Timing diagram The following diagram displays the timing for the AND instructions AND ANDN ANDR ANDF 10 1 M2 10 3 M3 A y M1 10 2 10 4 10 5 Q0 3 Q0 2 Q0 4 Q0 5 TWD USE 10AE 309 Basic Instructions Logical OR Instructions OR ORN ORR ORF Introduction Examples
25. The Boolean result is equal to the AND logic between the Boolean result of the previous instruction and the detection of the operand s rising edge 1 rising edge ANDF The Boolean result is equal to the AND logic between the Boolean result of the previous instruction and the detection of the operand s falling edge 1 falling edge OR The Boolean result is equal to the OR logic between the Boolean result of the previous instruction and the status of the operand TWD USE 10AE 275 Instruction List Language Action instructions Name Equivalent Function graphic element AND in Logic AND 8 parenthesis levels OR Logic OR 8 parenthesis levels XOR XORN ZOR Exclusive OR XORR XORF XORN XORR XORF MPS Switching to the coils MRD A jz MPP r aA N Negation NOT The following table describes action instructions in List language Name Equivalent Function graphic element ST The associated operand takes the value of the test zone lt L gt result STN The associated operand takes the reverse value of the test LA zone result S The associated operand is set to 1 when the result of the S test zone is 1 R The associated operand is set to 0 when the result of the R test zone is 1 276 TW
26. The procedure for configuring a modem in a Twido controller is as follows E TwidoSoft no heading il File Edit Display Tools Hardware Software Program PLC Window Help SFNSr ain gael g BBer oi maje Ladder viewer fi TWOLMDA4ODUK No heading a qiz DE aso ae e EE me Hardware arg Port 1 Remote Link 1 bi p Constants KD Delete Constants KF a 1 Counters RUNG 0 END OF PROGRAM xpansion bus Edit Controller Communications Setup Software Add Remote Controller GQ Constants Add a modem Once the modem is configured on port 1 the properties must be defined Right click on the modem to reveal the choice of delete or properties Clicking properties lets you either select a known modem create a new modem or modify a modem No heading fil TWOLMDA4ODUK i Hardware Constants Constants KD Port 1 Remote Link 1 Properties E E Note The modem is completely managed by the Twido controller through port 1 This means you can connect a modem to communication port 2 but in this case all of the modem s operating modes and its initialization sequence must be performed manually and cannot be performed in the same way as with communication port 1 TWD USE 10AE 97 Communications Next select
27. 302 TWD USE 10AE Basic Instructions Timing Diagrams The following illustration shows how timing diagrams are displayed for each instruction LD Input state LDN LDR LDF z 4 10 1 MO 10 2 10 3 Output state Q0 2 Q0 4 Q05 Q0 3 Timing diagrams for the four types of Timing diagram for the Load instructions are grouped together LD instruction TWD USE 10AE 303 Basic Instructions Load Instructions LD LDN LDR LDF Introduction Load instructions LD LDN LDR and LDF correspond respectively to the opened closed rising edge and falling edge contacts LDR and LDF are used only with controller inputs and internal words and for AS Interface slave inputs Examples The following diagrams are examples of Load instructions I0 1 Q0 3 LD l0 1 M0 Q0 2 ST QO0 3 gt LDN M0 ST Q0 2 I10 2 Q0 4 LDR lI0 2 P ST Q04 10 3 Q0 5 LDF I0 3 N ST QO0 5 LJ Permitted The following table lists the types of load instructions with Ladder equivalents and Operands permitted operands List Instruction Ladder Equivalent Permitted Operands LD 0 1 l VIA Q QA M S X BLK x Xk LDN 0 1 l VIA Q QA M S X BLK x Xk LDR l YIA M P LDF l YIA M N
28. Received Byte p Received Byte p 1 The Length byte contains the length of the transmission table in bytes 250 max which is overwritten by the number of characters received at the end of the reception if reception is requested The Command byte must contain one of the following e 0 Transmission only e 1 Send receive e 2 Reception Only When in Transmit Only mode the Control and Transmission tables are filled in prior to executing the EXCHx instruction and can be of type KW or MW No space is required for the reception of characters in Transmission only mode Once all bytes are transmitted MSGx D is set to 1 and a new EXCHx instruction can be executed 122 TWD USE 10AE Communications Message Exchange EXCHx Instruction When in Transmit Receive mode the Control and Transmission tables are filled in prior to executing the EXCHx instruction and must be of type MW Space for up to 256 reception bytes is required at the end of the Transmission table Once all bytes are transmitted the Twido controller switches to reception mode and waits to receive any bytes When in Reception only mode the Control table is filled in prior to executing the EXCHx instruction and must be of type MW Space for up to 256 reception bytes is required at the end of the Control table The Twido controller immediately enters the reception mode and waits to receive any bytes Reception ends when the en
29. S input active makes threshold S1 new value to be granted in next count TWD USE 10AE 405 Advanced Instructions Frequency Meter The frequency meter function of a VFC is used to measure the frequency of a Function periodic signal in Hz on input IA The frequency range which can be measured is Description from 10 to 20kHz The user can choose between 2 time bases the choice being made by a new object VFC T Time base A value of 100 time base of 100 ms and a value of 1000 time base of 1 second Time Base Measurement range Accuracy Update 100 ms 100 Hz to 20 kHz 0 05 for 20 kHz 10 for 10 times per second 100 Hz 1s 10 Hz to 20 kHz 0 005 for 20 kHz 10 for Once per second 10 Hz Frequency Meter The following is a frequency meter function diagram Function Diagram IA gt Signal to be measured amp gt FC Counter IN VFCi p gt VFCi F Overflow output S VFCi VFCi V Set gt Current Value L Frequency current measured value to 0 VFCi T gt 4 Select gt Update flag time 1000 ms 100 ms base 406 TWD USE 10AE Advanced Instructions Frequency Meter Operation Special Cases The following is a timing diagram example of using VFC in a frequency meter mod
30. i 140 a l VECOV 0 i a ae l i F 1 l 1 1 1 1 1 THO 1 ro 1 1 i 1 any 1 1 m4 1 Reflex i im i i output 0 T 1 f m 1 T i 7 Reflex i i E i l i output 1 K i 1 mt r 1 7 f Q VFCO U 0 because VFC is a down counter change VFCO P to 20 change VFCO S1 to 17 S input active makes threshold S1 new value to be granted in next count a catch of the current value is made so VFCO C 17 404 TWD USE 10AE Advanced Instructions Up Down Counter Operation The following is an example of using VFC in an up down counter mode The following configuration elements have been set for this example FCO P preset value is 17 while the VFCO SO lower threshold value is 14 and the VFCO S1 upper threshold is 20 Reflex Output lt VFC SO NFCO SO lt lt VFCO S1 NFCO S1 Q0 0 2 X Q0 0 3 Example VFCO P 17 VFCO SO 14 VFCO S1 20 65535 20 17 14 VFC0 V 0 THO TH1 Reflex output 0 Reflex output 1 OOCCO Input IN is set to 1 and input S set to 1 change VFCO P to 20 change VFCO0 S1 to 17 a catch of the current value is made so VFCO C 17
31. S38 Permission for events to be placed in the events queue Normally at 1 e Set to 0 events cannot be placed in the events queue e Setto 1 events are placed in the events queue as soon as they are detected This bit can be set to 0 by the user and the system on cold re start 1 U gt S S39 Saturation of the events queue Normally at 0 e Set to 0 all events are reported Set to 1 at least one event is lost This bit can be set to 0 by the user and the system on cold re start 0 U gt S S50 Updating the date and time using words SW49 to SW53 Normally on 0 this bit can be set to 1 or 0 by the program or the Operator Display e Set to 0 the date and time can be read e Set to 1 the date and time can be updated The controller s internal RTC is updated on a falling edge of S50 0 U gt S S51 Time of day clock status Normally on 0 this bit can be set to 1 or 0 by the program or the Operator Display e Set to 0 the date and time are consistent e Setto 1 the date and time must be initialized by the user When this bit is set to 1 the time of day clock data is not valid The date and time may never have been configured the battery may be low or the controller correction constant may be invalid never configured difference between the corrected clock value and the saved value or value out of range State 1 transitioning to state O forces a
32. TWD USE 10AE Twido Language Objects Tables of double words Available Types of Double Words Tables of floating words Types of Floating Words Available Double word tables are a series of adjacent words of the same type and of a defined length L Example Double word table KD10 7 KD10 32 Bit KD22 Double word tables can be used with the Assignment instruction see Assignment Instructions p 342 Available types of words for double word tables Type Address Maximum size Write access Internal words MDi L 0 lt L lt 256 and i L lt 3000 Yes Constant words KDi L O lt L and i L lt 256 No Floating word tables are a series of adjacent words of the same type and of a defined length L Example Floating point table KF10 7 KF 10 32 Bit KF22 Floating point tables can be used with the Assignment instruction see Advanced instructions Available types of words for floating word tables Type Address Maximum size Write access Internal words MFi L 0 lt L lt 256 and i L lt 3000 Yes Constant words KFi L O lt L and i L lt 256 No TWD USE 10AE 47 Twido Language Objects Indexed objects Introduction Direct Addressing Indexed Addressing Objects Available for Indexed Addressing An indexed word is a single or double word or floating point with an i
33. The screen below is used to view and debug the PID PID Function PID WEA PID number o General Inpu PID AT Outpu Animatio Trace Operating mode List of PID states PID 03 04 14 35 Autotuning in progress m PID Period 20 bp p Output Setpoint 1000 AT Create animation Cancel Previous Next Help 452 TWD USE 10AE Advanced Instructions Description The following table describes the different zones of the window Field Description PID number Specify the PID number that you wish to debug here The value is between 0 and 13 14 PID maximum per application Operating mode This field shows the current PID operating mode List of PID states This dropdown list allows you to view the last 15 PID states in real time This list is updated with each change of state indicating the date and time of the change as well as the current state Create an Animation Table Click on Create an Animation Table to create a file containing all the variables shown in the diagram to enable you modify them online and debug your PID TWD USE 10AE 453 Advanced Instructions Trace tab of PID function At a Glance Animation Tab of PID Function This tab allows you to view PID operation and to make adjustments to the way it behaves The graphs begin to be traced as soon
34. e Use anlEC60127 approved fuse on the power line and output circuit to meet voltage and current requirements Recommended fuse Littelfuse 5x20 mm slowblow type 218000 series Type T Failure to follow this precaution can result in death serious injury or equipment damage TWD USE 10AE 13 Safety Information 14 TWD USE 10AE About the Book At a Glance Document Scope Validity Note Product Related Warnings User Comments This is the Software Reference manual for Twido programmable controllers and consists of the following major parts e Description of the Twido programming software and an introduction to the fundamentals needed to program Twido controllers e Description of communications managing analog I O installing the AS Interface bus interface module and other special functions e Description of the software languages used to create Twido programs e Description of instructions and functions of Twido controllers The information in this manual is applicable only for Twido programmable controllers Schneider Electric assumes no responsibility for any errors that appear in this document No part of this document may be reproduced in any form or means including electronic without prior written permission of Schneider Electric We welcome your comments about this document You can reach us by e mail at TECHCOMM modicon com TWD USE 10AE 15 About t
35. 15 4 15 5 Ata Glance 225 2e e45 cee fess oases amp we ee ee ee 424 OVENVIEW G piii aen a ena ee aoe ttre pe Bet ee oe eet ee ES 425 Principal of the Regulation Loop 0 c cece eee ees 426 Development Methodology of a Regulation Application 427 Compatibilities and Performances s s 0 000 c cece eee ee 428 Detailed characteristics of the PID function 00 e eee eee 429 How to access the PID configuration 00 e eee ee eee 432 General tab of PID function 2 0 0 0 cece 434 Input tab of the PID o c2ce eae ere eee eA ee Rene ee ee 437 PID tab of PID function 0 0 eee tee 439 AT tab of PID function 2 90 ested eee cece eyed oe wee ee ew eae eae 442 Output tab of the PID 6 cee ee 447 How to access PID debugging 0 cece eee es 450 Animation tab of PID function 0 0 tees 452 Trace tab of PID function 0 0 0 et ees 454 PID States and Errors Codes 00 00 cece tees 456 PID Tuning With Auto Tuning AT 000 c eee eee eee 460 PID parameter adjustment method 0 00 0 eee eee eee 469 Role and influence of PID parameters 0 0 c eee eee ees 472 Appendix 1 PID Theory Fundamentals 00 00 e eee eee eee 476 Appendix 2 First Order With Time Delay Model 0 005 478 Floating point instructions 1 0 0 0 eee 480 Ata Glance nesan E e a ober sha er oe te eae eee e
36. Result The Automatic addressing utility will be activated box checked or disabled box not checked Note By default the Automatic addressing parameter has been selected in the configuration screen 220 TWD USE 10AE Installing the AS Interface bus How to insert a slave device into an existing AS Interface V2 configuration At a Glance Procedure It is possible to insert a device into an existing AS Interface V2 configuration without having to use the pocket programmer This operation is possible once the Automatic addressing utility of configuration mode is active See Automatic addressing of an AS Interface V2 slave p 220 a single slave is absent in the physical configuration the slave which is to be inserted is specified in the configuration screen the slave has the profile expected by the configuration the slave has the address 0 A The AS Interface V2 module will therefore automatically assign to the slave the value predefined in the configuration The following table shows the procedure for making the automatic insertion of a new slave effective Step Action 1 Add the new slave in the configuration screen in local mode 2 Carry out a configuration transfer to the PLC in connected mode 3 Physically link the new slave with address 0 A to the AS Interface V2 bus Note An application can be modified by carrying out the above manipulatio
37. Steady Green 10BASE TX link beat signal to indicate a 10 Mbps connection Blinking Data packets sent or received over the 10BASE TX connection Steady Amber 100BASE TX link beat signal to indicate a 100 Mbps connection Blinking Data packets sent or received over the 100BASE TX connection LAN ST Steady Green Base controller is powered on Ethernet port is ready to communicate over the network Flashing Ethernet initialization at power up twice 2 Flashes No valid MAC address long off 3 Flashes Any of three possible causes long off e No link beat detected e Ethernet network cable is not plugged correctly or faulty cable e Network device hub switch is faulty or not properly configured 4 Flashes Duplicate IP address detected over the network To long off remedy this situation try assigning a different IP address to your Twido controller 6 Flashes Using a valid converted default IP address FDR safe long off mode 9 Flashes Ethernet hardware failure long off 176 TWD USE 10AE Communications TCP Modbus Messaging Overview Message Exchange over the Ethernet Network EXCH3 Instruction You may use TCP Modbus messaging to allow the Modbus TCP Client Master controller to send and receive Ethernet messages to and from the Modbus TCP Server Slave controller As TCP Modbus is a peer to peer communications protocol a Twido Ethernet capable controller can be both Client and Serve
38. The suitable PID process control is attained in the following domain 2 6 20 T For 6 lt 2 in other words for fast control loops low or for processes with a large delay high t the PID process control is no longer suitable In such cases more complex algorithms should be used T For gt 20 a process control using a threshold plus hysterisis is sufficient TWD USE 10AE 475 Advanced Instructions Appendix 1 PID Theory Fundamentals Introduction The PID control function onboard all Twido controllers provides an efficient control to simple industrial processes that consist of one system stimulus referred to as Setpoint in this document and one measurable property of the system referred to as Measure or Process Variable The PID The Twido PID controller implements a mixed serial parallel PID correction see Controller Model PID Model Diagram below via an analog measurement and setpoint in the 0 10000 format and provides an analog command to the controlled process in the same format The mixed form of the PID controller model is described in the following diagram Tj E o 0 gt PK LU D Ta where where e the integral action acting independently and parallel to the derivative action e D the derivative action acting independently and parallel to the integral action e P the proportional action acting seriall
39. A TwidoSoft application consists of a program configuration data symbols and documentation A specialized window in the TwidoSoft that displays a graphical tree like view of an application Provides for convenient configuration and viewing of an application Twido applications are stored as file type twd American Standard Code for Information Interchange Communication protocol for representing alphanumeric characters notably letters figures and certain graphic and control characters When inserting or modifying List instructions this optional setting allows for program lines to be validated as each is entered for errors and unresolved symbols Each element must be corrected before you can exit the line Selected using the Preferences dialog box Auto load A feature that is always enabled and provides for the automatic transfer of an application from a backup cartridge to the controller RAM in case of a lost or corrupted application At power up the controller compares the application that is presently in the controller RAM to the application in the optional backup memory cartridge if installed If there is a difference then the copy in the backup cartridge is copied to the controller and the internal EEPROM If the backup cartridge is not installed then the application in the internal EEPROM is copied to the controller B Backup A command that copies the application in controller RAM into both the controller internal
40. Assignment of Word Double Word and Floating Point Tables Assignment operations can be performed on the following object tables see Tables of words p 46 Immediate whole value gt word table Example 1 or double word table Word gt word table Example 2 Word table gt word table Example 3 Table length L should be the same for both tables e Double word gt double word table Double word table gt double word table Table length L should be the same for both tables Immediate floating point value gt floating point table Floating point gt floating point table Floating point table gt floating point table Table length L should be the same for both tables Examples Examples of word table assignments LD 1 MW0 10 100 MWO0 10 100 Ex 1 10 2 LD I0 2 MWO0 10 MW11 MW0 10 MW11 Ex 2 I10 3 LDR I0 3 P MW10 20 KW30 20 MW 10 20 KW30 20 Ex 3 TWD USE 10AE 345 Basic Instructions Syntax Syntax for word double word and floating point table assignments Operator Syntax Op1 Op2 Operand 1 Op1 assumes the value of operand 2 Op2 The following table gives details operands Type Operand 1 Op1 Operand 2 Op2 word table MWi L SWi L MWi L SWi L Immediate whole value MWi KWi IW QW IWA PQWA SWi BLK x Double word MDi L Immediate whole
41. MSGx D 1 MSGx D Communication 0 Request in progress complete 1 communication done if end of transmission end character received error or reset of block MSGxX E Error 0 message length OK and link OK 1 if bad command table incorrectly configured incorrect character received speed parity and so on or reception table full 124 TWD USE 10AE Communications Limitations Error and Operating Mode Conditions Consequence of Controller Restart on the Communication It is important to note the following limitations e Port 2 availability and type see SW7 is checked only at power up or reset Any message processing on Port 1 is aborted when the TwidoSoft is connected EXCHx or MSG can not be processed on a port configured as Remote Link EXCHx aborts active Modbus Slave processing Processing of EXCHx instructions is not re tried in the event of an error Reset input R can be used to abort EXCH x instruction reception processing EXCHx instructions can be configured with a time out to abort reception Multiple messages are controlled via MSGx D If an error occurs when using the EXCHx instruction bits MSGx D and MSGx E are set to 1 and system word SW63 contains the error code for Port 1 and SW64 contains the error code for Port 2 System Words Use SWE3 EXCH1 error code 0 operation was successful 1 number of bytes to be transmitted is
42. Q0 8 M64 8 Ex 1 10 2 LD I0 2 MW100 10 16 MW 100 I0 16 Ex 2 I10 3 LDR IO0 3 P M104 16 K WO M104 16 K WO Ex 3 342 TWDUSE 10AE Basic Instructions Usage rules e For bit string gt word assignment The bits in the string are transferred to the word starting on the right first bit in the string to bit O in the word and the word bits which are not involved in the transfer length lt 16 are set to 0 e For word gt bit string assignment The word bits are transferred from the right word bit 0 to the first bit in the string Bit String Syntax for bit string assignments Assignments Operator Syntax Operand 1 Op1 Operand 2 Op2 i Op1 Op2 Operand 1 Op1 assumes the value of operand 2 Op2 MWI QWi QWAI SWi MWI MWi MDi MDi MWi Mi L Qi L Si L Xi L Immediate value MWi KWi IW IWAI YINWi VQWi QWAi VQNWi SWi BLK x S MWi MWi KWi MWi MDi MWi KDiI MWi Mi L Qi L Si L Xi L li L function block word Note The abbreviation BLK x for example C0 P is used to describe any Assignment of Words Assignment operations can be performed on the following words and double words Word indexed gt word 2 for example indexed or not Double word indexed gt double word indexed or not Immediate whole value gt word Example 3 or double word indexed or no
43. SW51 520 SW52 520 SW53 520 SW54 520 SW55 520 SW56 520 SW57 520 SW58 520 SW59 521 SW6 517 SWEOD 521 SWES 521 SW64 521 SWES 522 SWE7 522 SW7 518 SW73 523 SW74 523 SW76 523 SW77 523 SW78B 523 SW79Y 523 SW80 523 SW81 SW87 523 SW96 524 SW97 524 TM 326 VFC 396 481 481 481 A ABS 481 Absolute value 349 Accessing debugging PID 450 Accessing the configuration PID 432 Accumulator 274 ACOS 484 Action Zone 252 Add 349 Addressing analog I O modules 189 Addressing I O 40 Advanced function blocks Bit and word objects 370 Programming principles 372 Analog Channel 185 Analog Module operating 188 Analog module Example 193 Analog Modules Configuring I O 190 Analog modules addressing 189 AND instructions 308 Animation tab PID 452 Arithmetic Instructions 349 ASCII Communication 87 Communications 119 Configuring the port 122 Hardware configuration 119 Software configuration 121 ASCII Link Example 126 ASIN 484 AS Interface Bus V2 configuration screen 202 540 TWD USE 10AE Index AS Interface V2 bus accepting the new configuration 218 Changing a slave address 213 Debug screen 210 Explicit exchanges 225 Faulty slave 222 general functional description 197 I O addressing 223 Implicit exchanges 224 Operating mode 230 Presentation 196 Programming and diagnostics for the AS Interface bus 225 Sl
44. See Addressing I Os associated with slave devices connected to the AS Interface V2 bus p 223 28 TWD USE 10AE Twido Language Objects Word Objects Introduction Word objects that are addressed in the form of 16 bit words that are stored in data memory and can contain an integer value between 32768 and 32767 except for the fast counter function block which is between 0 and 65535 Examples of word objects e Immediate values Internal words MWi memory words Constant words KWi I O exchange words IWi QWi AS Interface analog I O words IWAi QWAi System words SWi Function blocks configuration and or runtime data Word Formats The contents of the words or values are stored in user memory in 16 bit binary code two s complement using the following convention FEDCBAQ876543210 Bit position o 1fol 1fofo 1 ofo 1 ojo 1 1 01 Bitstate Tt a Ooy el N i mn28Q8gNr ONJ AL ova Bit value ON S OTN In signed binary notation bit 15 is allocated by convention to the sign of the coded value e Bit 15 is set to 0 the content of the word is a positive value e Bit 15 is set to 1 the content of the word is a negative value negative values are expressed in two s complement logic Words and immediate values can be entered or retrieved in the following format e Decimal Min 32768 Max 32767 1579 for example e Hexadecimal Min 16 0000 Max 16 F
45. Selected Use IA input IB input IPres Ica Output 0 Output 1 Up down counter 10 0 1 10 0 0 10 0 2 1 10 0 3 1 Q0 0 2 1 Q0 0 3 1 UP 0 DO 1 Up Down 2 Phase l0 0 1 10 0 0 l0 0 2 1 10 0 3 1 Q0 0 2 1 Q0 0 3 1 Counter Pulse Single Up Counter 10 0 1 2 l0 0 2 1 10 0 3 1 Q0 0 2 1 Q0 0 3 1 Single Down Counter 10 0 1 2 10 0 2 1 10 0 3 1 Q0 0 2 1 Q0 0 3 1 Frequency Meter 10 0 1 2 2 2 2 2 VFC1 Selected Use IA input Input IB IPres Ica Output 0 Output 1 Up down counter l0 0 7 10 0 6 l0 0 5 1 10 0 4 1 Q0 0 4 1 Q0 0 5 1 UP 0 DO 1 Up Down 2 Phase l0 0 7 10 0 6 10 0 5 1 10 0 4 1 Q0 0 4 1 Q0 0 5 1 Counter Pulse Single Up Counter 10 0 7 2 10 0 5 1 10 0 4 1 Q0 0 4 1 Q0 0 5 1 Single Down Counter 10 0 7 2 10 0 5 1 10 0 4 1 Q0 0 4 1 Q0 0 5 1 Frequency Meter l0 0 7 2 2 2 2 2 Comments 1 optional Input IA pulse input 2 not used Input IB pulses or UP DO Ipres preset input UP DO Up Down counting Ica Catch input When not used the input or output remains a normal digital I O available to be managed by the application in the main cycle If 10 0 2 is used FCO is not available If 10 0 3 is used FC2 is not available If 10 0 4 is used FC3 is not available TWD USE 10AE 397 Advanced Instructions Illustration Specifications
46. The OR instructions perform a logical OR operation between the operand or its inverse or its rising or falling edge and the Boolean result of the preceding instruction The following diagrams are examples of logic OR instructions 10 1 Q0 3 ea MI M2 Q0 2 E U 10 M3 Q0 4 fa S 10 P 10 Q0 5 lt N S 10 LD OR ST LD ORN ST LD ORR LDF ORF I10 1 M1 Q0 3 M2 I10 2 Q0 2 M3 10 4 Q0 4 I10 5 I10 6 QO0 5 310 TWD USE 10AE Basic Instructions Permitted The following table lists the types of OR instructions with Ladder equivalents and Operands permitted operands List Instruction Ladder Equivalent Permitted Operands OR 0 1 I IA Q QA M S X BLK x Xk ORN 0 1 I WIA Q QA M S X BLK x Xk 7 ORR l VIA M P ORF l VIA M N Timing diagram The following diagram displays the timing for the OR instructions OR ORN ORR ORF y 10 1 M2 M3 10 5 A Yy M1 10 2 10 4 10 6 Q0 3 Q0 2 Q0 4 Q0 5 TWD USE 10AE 311 Basic Instructions Exclusive OR instructions KOR XORN XORR XORF Introduction The XOR instructions perform an exclusive OR
47. This data displays the slave address the response code the first word written and the number of words written starting at MW8 in the example above 142 TWD USE 10AE Communications Standard Modbus Requests Introduction These requests are used to exchange memory words or bits between remote devices The table format is the same for both RTU and ASCII modes Format Reference number Bit Mi Word MWi Modbus Master The following table represents requests 01 and 02 Read N Bits Table Most significant byte Least significant byte Index Control table 0 01 Transmission 06 Transmission length reception 1 00 Reception offset 00 Transmission offset Transmission table 2 Slave 1 247 01 or 02 Request code 3 Number of the first bit to read 4 N Number of bits to read Reception table 5 Slave 1 247 01 Response code after response 6 Number of data bytes transmitted 1 byte by bit 7 First byte read value 00 Second byte read if N gt 1 or 01 8 Third byte read if N gt 1 N 2 6 Byte N read if N gt 1 This byte also receives the length of the string transmitted after response TWD USE 10AE 143 Communications Modbus Master Read N Words The following table represents requests 03 and 04 Table Most significant byte Least significant byte Index Cont
48. controller runs a check for duplicate IP address If a duplicate IP address is located over the network the LAN ST LED of the Twido controller will emit 4 flashes periodically You must then enter a new duplicate free IP address in this field Subnetwork mask Enter the valid subnet mask assigned to your controller by your network administrator Please note that you cannot leave this field blank you must enter a value As default the TwidoSoft application automatically computes and displays a default subnet mask based on the class IP that you have provided in the IP Address field above Default subnet mask values according to the category of the Twido network IP address follow this rule Class A network gt Default subnet mask 255 0 0 0 Class B network gt Default subnet mask 255 255 0 0 Class C network gt Default subnet mask 255 255 255 0 Caution For good device communication the subnet mask configured on the PC running the TwidoSoft application and the Twido controller s subnet mask must match Note Unless your Twido controller has special need for subnetting use the default subnet mask Gateway Enter the IP address of the gateway On the LAN the gateway must be on the same segment as your Twido controller This information typically is provided to you by your network administrator Please note that no default value is provided by the application and that you must enter a valid gateway address in this
49. period periodic task user program in the Animation Table Editor SWE Controller Status Controller Status S 0 NO CONFIG 2 STOP 3 RUN 4 HALT TWD USE 10AE 517 System Bits and Words System Function Description Control Words SW7 Controller state e Bit 0 Backup restore in progress S e Setto 1 if backup restore in progress e Set to 0 if backup restore complete or disabled e Bit 1 Controller s configuration OK e Set to 1 if configuration ok e Bit 3 2 EEPROM status bits e 00 No cartridge e 01 32 Kb EEPROM cartridge e 10 64 Kb EEPROM cartridge e 11 Reserved for future use e Bit 4 Application in RAM different than EEPROM e Setto 1 if RAM application different to EEPROM e Bit 5 RAM application different to cartridge e Set to 1 if RAM application different to cartridge e Bit 6 not used status 0 e Bit 7 Controller reserved e Set to 1 if reserved e Bit 8 Application in Write mode e Setto 1 if application is protected e Bit 9 not used status 0 e Bit 10 Second serial port installed e Set to 1 if installed e Bit 11 Second serial port type 0 EIA RS 232 1 EIA RS 485 e Set to 0 EIA RS 232 e Setto 1 EIA RS 485 e Bit 12 application valid in internal memory e Set to 1 if application valid e Bit 13 Valid application in cartridge e Set to 1 if application valid e Bit 14 Valid application in RAM e Set to 1 if application
50. 0 gt 192 168 255 255 Today s networks are rarely either totally isolated from the Internet or from the rest of the company s Ethernet network Therefore if you are installing and connecting your Twido base controller to an existing network do not assign an arbitrary IP address without prior consulting with your network administrator you should follow the directions outlined below when assigning an IP address to your controller Note It is good practice to use Class C IP addresses on stand alone networks TWD USE 10AE 161 Communications TCP IP Setup Overview The following are detailed instructions on how to set up the Ethernet TCPI IP configuration for your Twido TWDLCAE4ODRF compact controller Note TCP IP setup can be performed when the TwidoSoft application program is in offline mode only 162 TWD USE 10AE Communications Calling up the The following steps detail how to call up the Ethernet Configuration dialogbox Ethernet Configuration Step Action Dialogbox 1 Open the Application Browser as shown in the figure below Result BO No heading I Ei TWDLCAE40DRF i A Hardware GT port 1 Remote Link 1 if _ Expansion Bus 7 TWDXCPRTC f hada Ethernet Port Note Make sure an Ethernet capable device such as TWDLCAE40DRF is selected as the current hardware or otherwise the Ethernet Port hardware option will not appear
51. 14 2 Basic Function Blocks 316 14 3 Numerical Processing 340 14 4 Program Instructions 359 TWD USE 10AE 297 Basic Instructions 298 TWD USE 10AE Basic Instructions 14 1 Boolean Processing At a Glance Aim of this This section provides an introduction to Boolean processing including descriptions Section and programming guidelines for Boolean instructions What s in this This section contains the following topics Section Topic Page Boolean Instructions 300 Understanding the Format for Describing Boolean Instructions 302 Load Instructions LD LDN LDR LDF 304 Assignment instructions ST STN R S 306 Logical AND Instructions AND ANDN ANDR ANDF 308 Logical OR Instructions OR ORN ORR ORF 310 Exclusive OR instructions KOR XORN XORR XORF 312 NOT Instruction N 314 TWD USE 10AE 299 Basic Instructions Boolean Instructions Introduction Testing Controller Inputs Rising Edge Detection Boolean instructions can be compared to Ladder language elements These instructions are summarized in the following table Item Instruction Example Description Test elements The Load LD LD l0 0 Contact is closed when bit instruction is equivalent l0 0 is at state 1 to an open contact Action elements The Store ST ST Q0 0 The associated bit object instruction is equivalent to a coil takes a lo
52. 190 Analog Module Status Information 192 Example of Using Analog Modules 193 TWD USE 10AE 187 Managing Analog Modules Analog Module Overview Introduction Operating Analog Modules In addition to the built in 10 bit potentiometer and 9 bit analog channel all the Twido controllers that support expansion I O are also able to configure and communicate analog I O modules These analog modules are Name Points Signal Range Encoding TWDAMI2HT 2 In 0 10 Volts or 4 20 mA 12 Bit TWDAMO1HT 1 output 0 10 Volts or 4 20 mA 12 Bit TWDAMMSHT 2 In 1 Out 0 10 Volts or 4 20 mA 12 Bit TWDALM3LT 2 In 1 Out 0 10 Volts Inputs Th or PT100 12 Bit Outputs 4 20 mA Input and output words IW and QW are used to exchange data between the user application and any of the analog channels The updating of these words is done synchronously with the controller scan during RUN mode CAUTION Unexpected start up of devices When the controller is set to STOP the analog output is set to its fall back position As is the case with digital output the fall back position is zero Failure to follow this precaution can result in injury or equipment damage 188 TWD USE 10AE Managing Analog Modules Addressing Analog Inputs and Outputs Introduction Example of Addressing Analog I O Addresses are assigned to the analog channels depending on their l
53. 2 147 483 648 in double length e A result greater than 3 402824E 38 or less than 3 402824E 38 in floating point e Division by 0 The square root of a negative number e BTI or ITB conversion not significant BCD value out of limits It must be tested by the user program after each operation where there is a risk of an overflow then reset to 0 by the user if an overflow occurs S gt U S19 Scan period overrun periodic scan Normally at 0 this bit is set to 1 by the system in the event of a scan period overrun scan time greater than the period defined by the user at configuration or programmed in SWO This bit is reset to 0 by the user S gt U TWD USE 10AE 511 System Bits and Words System Bit Function Description Init state Control S20 Index overflow Normally at 0 it is set to 1 when the address of the indexed object becomes less than 0 or more than the maximum size of an object It must be tested by the user program after each operation where there is a risk of overflow then reset to 0 if an overflow occurs S gt U S21 GRAFCET initialization Normally set to 0 it is set to 1 by Acold restart S0 1 e The user program in the preprocessing program part only using a Set Instruction S S21 or a set coil S S21 e The terminal At state 1 it causes GRAFCET initialization Active steps are deactivated and i
54. 2 Press the MOD ENTER key to enter edit mode 3 Press the gt key until you are in the field that you wish to modify 4 Press the A key to increment the value of that field 5 Continue Steps 3 and 4 until the RTC correction value is complete 6 Press the MOD ENTER key to accept the modified values or ESC to discard any modifications made while in edit mode 246 TWD USE 10AE Description of Twido Languages At a Glance Subject of this This part provides instructions for using the Ladder List and Grafcet programming Part languages to create control programs for Twido programmable controllers What s in this This part contains the following chapters parts Chapter Chapter Name Page 11 Ladder Language 249 12 Instruction List Language 271 13 Grafcet 283 TWD USE 10AE 247 Twido Languages 248 TWD USE 10AE Ladder Language 11 At a Glance Subject of this This chapter describes programming using Ladder Language Chapter What s in this This chapter contains the following topics Chapter Topit Page Introduction to Ladder Diagrams 250 Programming Principles for Ladder Diagrams 252 Ladder Diagram Blocks 254 Ladder Language Graphic Elements 257 Special Ladder Instructions OPEN and SHORT 260 Programming Advice 261 Ladder List Reversibility 265 Guidelines for Ladder List Reversibility 266 Program Documentation 268 TWD US
55. 4 Program e Po ee Configuration data eg Program Backup Here are the steps for backing up your program into EEPROM Step Action 1 The following must be true There is a valid program in RAM From the Twido software window bring down the menu under Controller scroll down to Backup and click on it 54 TWD USE 10AE User Memory Program Restore Data MWs Backup Data MWs Restore During power up there is one way the program will be restored to RAM from the EEPROM assuming there is no cartridge or extended memory in place e The RAM program is not valid To restore a program manually from EEPROM do the following e From the Twido software window bring down the menu under Controller scroll down to Restore and click on it Here are the steps for backing up data memory words into the EEPROM Step Action 1 For this to work the following must be true A valid program in RAM SW96 X6 1 The same valid program already backed up into the EEPROM Memory words configured in the program 2 Set SW97 to the length of the memory words to be saved Note Length cannot exceed the configured memory word length and it must be greater than 0 but not greater than 512 3 Set SW96 X0 to 1 Restore MWs manually by setting system bit S95 to 1 For this to work the following must be true e A valid
56. AND M0 CU _ tae SI OUT _BLK AND ymi Output i Processing ST Q0 4 END BLK TWD USE 10AE 319 Basic Instructions Example without This example shows reversible programming of a counter function block without Output Wiring wired outputs R WES EJS BLK C8 7 LDF Il 1 mie R Input I1 2 MO ADJ Y pl LD 12 Praesto cy Ci P 9999 AND MO CU END BLK _ pe Alg LD C8 D AND MI Output C8 D M1 Q0 4 ST Q0 4 Processing Note Only test and input instructions on the relevant block can be placed between the BLK and OUT_BLK instructions or between BLK and END_BLK when OUT_BLK is not programmed 320 TWD USE 10AE Basic Instructions Timer Function Block TMi Introduction Illustration There are three types of Timer function blocks e TON Timer On Delay this type of timer is used to control on delay actions e TOF Timer Off Delay this type of timer is used to control off delay actions e TP Timer Pulse this type of timer is used to create a pulse of a precise duration The delays or pulse periods are programmable and may be modified using the TwidoSott The following is an illustration of the Timer function block TMi TYPE TON TB Imin ADJ Y TMi P 9999 Timer function block TWD USE 10AE 321 Basic Instructions Parameters The Time
57. ANDN Xi OR Xi ORN Xi XOR Xi XORN Xi S Xi Activate step i Xi s R Xi Deactivate step i Xi R 1 The graphic representation is not taken into account 2 The first step i or i written indicates the start of sequential processing and thus the end of preprocessing TWD USE 10AE 285 Grafcet Grafcet Linear sequence Examples 10 5 S21 o 410 5 LD a ST S21 L Q0 1 LD I0 1 I0 1 2 2 2 10 1 wy LD 0 2 2 3 10 2 3 _ 3 QO0 2 LD I10 3 wy 1 10 2 ited POST 10 3 1 LD XI ST QO 1 Ob esse a LD ix POST ST Q0 2 10 3 Pe Q0 1 LD X3 i ST Q0 3 X2 Q0 2 X3 Q0 3 Not supported Twido Ladder Twido Instruction Language programme List programme 286 TWD USE 10AE Grafcet Alternative sequence 4 au cid i D a 3 0 0 0 10 3 _ 10 4 7 10 4 6 A poe 5 6 X Se 5 1 10 5 10 6 atte LD I0 5 I0 5 7 7 7 Wd ae 6 6 LD I10 6 I10 6 7 7 Not supported Twido Ladder Twido Instruction Language programme List prog
58. Action 1 Press the gt key until the Time Date Display is shown The month value JAN FEB will be displayed in the upper left corner of the display area The value RTC will be displayed in the upper left corner if no month has been initialized Press the MOD ENTER key to enter the edit mode Press the ED key until you are in the field that you wish to modify Press the a key increment the value of that field Continue steps 3 and 4 until the Time of Day value is complete Press the MOD ENTER key to accept the modified values or ESC to discard any modifications made while in edit mode TWD USE 10AE 245 Operator Display Operation Real Time Correction Factor Introduction Displaying and Modifying RTC You can display and modify the Real Time Correction Factor using the operator display Each Real Time Clock RTC Option module has a RTC Correction Factor value that is used to correct for inaccuracies in the RTC module s crystal The correction factor is an unsigned 3 digit integer from 0 to 127 and is displayed in the lower right corner of the display The example below shows a correction factor of 127 RTC Corr 127 To display and modify the Real Time Correction Factor Step Action Correction 1 Press the gt key until the RTC Factor Display is shown RTC Corr will be displayed in the upper line of the operator display
59. COS 484 TWD USE 10AE 541 Index Counters 329 Programming and configuring 332 D Debugging PID 450 Decrement 349 DEG_TO_RAD 486 Derivative action 474 DINT_TO_REAL 488 Direct labeling 48 Divide 349 Documenting your program 268 Double word objects 44 Addressing 39 Overview 32 Drum controller function block 387 Drum controllers programming and configuring 391 E Edge detection falling 301 Rising 300 END Instructions 360 END_BLK 266 EQUAL_ARR 494 error 350 Ethernet Connections management 173 Network connection 155 TCP IP setup 162 Event tasks Different event sources 79 Event management 81 Overview 78 Example Up Down Counter 333 EXCH 408 EXCH instruction 408 EXCHS3 177 Error code 180 Exchange function block 409 Exclusive OR instructions 312 EXP 481 EXPT 481 F Fast counter function block 393 FIFO introduction 374 operation 377 FIND_ 496 Floating objects Addressing 38 Floating point objects Overview 32 Function Blocks PWM 381 Function blocks Counters 329 Drum controller 391 drum controller 387 graphic element 259 in programming grid 255 Overview of basic function blocks 317 programming standard function blocks 319 registers 374 Schedule blocks 415 Shift Bit Register SBR 334 Step counter SCi 336 timers 321 326 G Gateway address 157 General tab PID 434 Grafcet associated actions 293 Examples 286 Instructions 284 prepr
60. EEPROM and the optional backup memory cartridge if installed Cc Client A computer process requesting service from other computer processes Coil A ladder diagram element representing an output from the controller 528 TWDUSE 10AE Glossary Cold start or restart Comment lines Comments Compact controller Configuration editor Constants Contact Counter Cross references Cross References Viewer A start up by the controller with all data initialized to default values and the program started from the beginning with all variables cleared All software and hardware settings are initialized A cold restart can be caused by loading a new application into controller RAM Any controller without battery backup always powers up in Cold Start In List programs comments can be entered on separate lines from instructions Comments lines do not have line numbers and must be inserted within parenthesis and asterisks such as COMMENTS GO HERE Comments are texts you enter to document the purpose of a program For Ladder programs enter up to three lines of text in the Rung Header to describe the purpose of the rung Each line can consist of 1 to 64 characters For List programs enter text onn unnumbered program line Comments must be inserted within parenthesis and asterisks such as COMMENTS GO HERE Type of Twido controller that provides a simple all in one configuration with limited expansion Modular is the
61. Here is a block representation of the Very Fast Counter VFC in single word mode VFCO IN F TYPE UP DN SINGLE U T_OUTO T OUTI ADJ VFCO P THO s TH1 The following table lists characteristics for the very fast counter VFC function block Function Description Values YN FC Run time Use Access Current Value Current value that is increased or decreased according VFCi V 0 gt CM Read VFCI V to the physical inputs and the function selected This 65535 VFCi VD value can be preset or reset using the preset input NFCI VD 0 gt VFCi S 4294967295 Preset value Only used by the up down counting function and single VFCi P 0 gt CM or FM Read and VFCi P up or down counting 65535 Write 1 VFCi PD VFCi PD 0 gt 4294967295 Capture Value Only used by the up down counting function and single VFCi C 0 gt CM Read VFCi C up or down counting 65535 VFCi CD VFCi CD 0 gt 4294967295 Counting Set by the system this bit is used by the up down 0 Down CM Read direction counting function to indicate to you the direction of counting VFCi U counting 1 Up counting As a single phase up or down counter 10 0 0 decides the direction for VFCO and l0 0 6 for VFC1 For a two phase up down counter it is the phase difference between the two signals that determines the direction For VFCO l0 0 is ded
62. I10 1 LD I10 0 AND I0 1 PWMO0 R 80 PWMO R 80 BLK PWMO I10 2 PWMO LD I0 2 IN IN END BLK TB PWMi0 P The following table shows a list of special operating of the PWM function block Special case Description Effect of a cold restart S0 1 Sets the PWMi R ratio to 0 In addition the value for PWMii P is reset to the configured value and this will supersede any changes made with the Animations Table Editor or the optional Operator Display Effect of a warm restart S1 1 Has no effect Effect due to the fact that outputs are dedicated to the PWM block Forcing output Q0 0 0 or Q0 0 1 using a programming device does not stop the signal generation TWD USE 10AE 383 Advanced Instructions Pulse Generator Output Function Block PLS Introduction The PLS function block is used to generate square wave signals There are two PLS functions available on the dedicated output channels Q0 0 0 or Q0 0 1 The PLS function block allows only a single signal width or duty cycle of 50 You can choose to limit the number of pulses or the period when the pulse train is executed These can be determined at the time of configuration and or updated by the user application Note Controllers with relay outputs for these two channels do not support PLS function Representation An example of the pulse generator function block in single wo
63. KDi Floating word tables MFi MFi L KFi L MFi KFi 499 Advanced Instructions Table rotate shift function General There are 2 shift functions e ROL_ARR performs a rotate shift of n positions from top to bottom of the elements in a floating word table Illustration of the ROL_ARR functions TAUNO e ROR_ARR performs a rotate shift of n positions from bottom to top of the elements in a floating word table Illustration of the ROR_ARR functions ir 500 TWD USE 10AE Advanced Instructions Structure Syntax Ladder language 13 2 pH ROL_ARR KW0 MD20 7 11 2 P ROR_ARR 2 MD20 7 11 3 Pt ROR_ARR 2 MF40 5 Instruction List Language LDR 13 2 LDR 11 2 LDR 11 3 ROL_ARR KWO MD20 7 ROR_ARR 2 MD20 7 ROR_ARR 2 MF40 5 Syntax of rotate shift instructions in floating word or double word tables ROL_ARR and ROR_ARR Function Syntax ROL_ARR Function n Tab ROR_ARR Parameters of rotate shift instructions for floating word tables ROL_ARR and ROR_ARR Type Number of positions n Table Tab Floating word tables MWi immediate value MFi L Double word tables MWi immediate value MDi L Note if the value of n is negative or null no shift is performed
64. M0 10 0 ITT Z Sia Ladder diagram In this example if we take C1 P 4 the current value of the C1 V counter will be incremented from 0 to 3 then decremented from 3 to 0 Whereas l0 0 1 C1 V oscillates between 0 and 3 TWD USE 10AE 333 Basic Instructions Shift Bit Register Function Block SBRi Introduction The Shift Bit Register function block SBRi provides a left or right shift of binary data bits 0 or 1 Illustration The following is an example of a Shift Register function block SBRi R CU CD Parameters The Shift Bit Register function block has the following parameters Parameter Label Value Register number SBRi 0to7 Register bit SBRi j Bits 0 to 15 j 0 to 15 of the shift register can be tested by a Test instruction and written using an Assignment instruction Reset input or R When function parameter R is 1 this sets register instruction bits 0 to 15 SBRi j to 0 Shift to left input or CU On a rising edge shifts a register bit to the left instruction Shift to right input or CD On a rising edge shifts a register bit to the right instruction 334 TWD USE 10AE Basic Instructions Operation Programming Special Cases The following illustration shows a bit pattern before and after a shift operation
65. MF14 contains Y3 MF16 contains X4 MF 18 contains Y4 506 TWD USE 10AE Advanced Instructions Mean function of the values of a floating point table General The MEAN function is used to calculate the mean average from a given number of values in a floating point table Structure Ladder Language 13 2 MFO MEAN MF10 5 Instruction List Language LD I3 2 MF0 MEAN MF10 5 Syntax Syntax of the floating point table mean calculation function Function Syntax MEAN Result Function Op1 Parameters of the calculation function for a given number L of values from a floating point table Operand Op1 Result Res MFi L KFi L MFi TWD USE 10AE 507 Advanced Instructions 508 TWD USE 10AE System Bits and System Words 16 At a Glance Subject of this This chapter provides an overview of the system bits and system words that can be Chapter used to create control programs for Twido controllers What s in this This chapter contains the following topics Chapter Topic Page System Bits S 510 System Words SW 517 TWD USE 10AE 509 System Bits and Words System Bits S Introduction The following section provides detailed information about the function of system bits Detailed and how they are controlled The following table provides an overview of the system bits a
66. MW3 16 0000 XAMW3 16 7172 gt MW4 16 0004 END LD 1 AND MSG2 D EXCH2 MWO0 11 LD MSG2 E ST Q0 0 END Using TwidoSoft an application program is written for both the master and the slave For the slave we simply write some memory words to a set of known values In the master the word table of the EXCHx instruction is initialized to read 4 words from the slave at Modbus address 2 starting at location MWO Note Notice the use of the RX offset set in MW1 of the Modbus master The offset of three will add a byte value 0 at the third position in the reception area of the table This aligns the words in the master so that they fall correctly on word boundaries Without this offset each word of data would be split between two words in the exchange block This offset is used for convenience Before executing the EXCH2 instruction the application checks the communication bit associated with MSG2 Finally the error status of the MSG2 is sensed and stored on the first output bit on the local base controller I O Additional error checking using SW64 could also be added to make this more accurate Step 5 Initialize the animation table editor in the master Address Current Retained Format 1 MW5 0203 0000 Hexadecimal 2 MW6 0008 0000 Hexadecimal 3 MW7 6566 0000 Hexadecimal 4 MW8 6768 0000 Hexadecimal 5 MW9 6970 0000 Hexadecimal 6 MW107172 0000 Hexadecimal TWD USE 10AE 1
67. Modbus TCP IP client Note The Remote Devices tab of the Twido controller can be configured when the TwidoSoft application program is in offline mode only You do not need to configure the Remote Devices on any controller other than the controller that you want to use the Modbus TCP IP client legacy Modbus master instruction EXCH3 The Remote Devices table stores information about remote controllers acting as Modbus TCP IP servers over the Ethernet network that can be queried by the Modbus TCP IP client using the EXCH instruction Therefore you must configure the Remote Devices table properly so that the Modbus TCP IP client controller can poll Modbus TCP IP server controllers over the network The following figure presents a sample screen of the Remote Devices tab configured on the Twido controller acting as Modbus TCP IP client Ethernet Configuration IP Address Configure Marked IP Idle Checking Remote Devices Remote Devices Connection a Index oe Unit ID Timeout 100ms 1 192 168 1 11 255 100 2 192 168 1 30 5 100 4 5 6 Vv Cancel Help 170 TWD USE 10AE Communications Configuring the Remote Devices tab The following information describes how to configure the various fields in the Remote Devices tab Field Configuring Index This is a read only field th
68. Number The following table describes the elements in the addressing format Group Item Description Symbol The percent symbol always precedes a software variable Type of M Internal bits store intermediary values while a program is object running S System bits provide status and control information for the controller X Step bits provide status of step activities Number i The maximum number value depends on the number of objects configured Examples of bit object addressing e M25 internal bit number 25 e S20 system bit number 20 e X6 step bit number 6 TwidoSoft is used to extract one of the 16 bits from words The address of the word is then completed by the bit row extracted according to the following syntax WORD 1X k Word address Position k 0 15 bit rank in the word address Examples e MW5 X6 bit number 6 of internal word MW5 e QW5 1 X10 bit number 10 of output word QW5 1 36 TWD USE 10AE Twido Language Objects Addressing Word Objects Introduction Addressing word objects except for input output addressing see Addressing Inputs Outputs p 40 and function blocks see Function Block Objects p 43 follows the format described below Syntax Use the following format to address internal constant and system words M KorS WwW i symbol lobject type Format Number Description The following table describes the elements in
69. Number of bits to write 5 00 byte not sent offset Ns Number of data bytes effect to write 6 Value of the second byte Value of the second byte Control table 7 Value of the third byte Value of the fourth byte Transmission table 6 N gt 2 2 Value of the Nond byte Reception table after response Slave 1 247 15 Response code Number of the first bit writte n Number of bits written N4 Note e The Tx Offset 7 will suppress the 7th byte in the sent frame This also allows a good correspondence of words values in the transmission table TWD USE 10AE 147 Communications Modbus Master Write of N Words This table represents Request 16 Table Most significant byte Least significant byte Index Control table 0 01 Transmission 8 2 N Transmission reception length 1 00 Reception offset 07 Transmission offset Transmission table 2 Slave 1 247 16 Request code 3 Number of the first word to write 4 N Number of words to write 5 00 byte not sent offset 2 N Number of bytes to effect write 6 First word value to write Second value to write N 5 N values to write Reception table N 6 Slave 1 247 16 Response code after response N 7 Number of the first word written N 8 Number of words written N Note The Tx Offset 7 will suppress the 5th MMSB byte in the sent f
70. PD and the current value FCi V or FCi VD with the Operator Display or Animation Tables Editor If set to N there is no access to the preset Current Value FCI V FCi VD The current value increments or decrements according the up or down counting function selected For up counting the current counting value is updated and can reach 65535 in standard mode FCi V and 4294967295 in double word mode FCi VD For down counting the current value is the preset value FCi P or FCi PD and can count down to zero Enter to enable At state 1 the current value is updated according to the pulses applied to the physical input At state 0 the current value is held at its last value Reset FCI R Used to initialize the block At state 1 the current value is reset to 0 if configured as an up counter or set to FCi P or FCiI PD if configured as a down counter The done bit FCi D is set back to its default value Done FCi D This bit is set to 1 when FCi V or FCi VD reaches the FCi P or FCi PD configured as an up counter or when FCi V or FCi VD reaches zero when configured as a down counter This read only bit is reset only by the setting FCi R to 1 Special Note If configured to be adjustable then the application can change the preset value FCi P or FCi PD and current value FCi V or FCi VD at any time But a new value is taken into account only if the input reset is active or at the
71. Q output bit remains at 1 while the IN input is at 1 When a falling edge is detected at the IN input the timer is stopped even if the timer has not reached TMi P and TMi V is set to 0 324 TWD USE 10AE Basic Instructions TP Type of Timer Introduction Timing Diagram Operation The TP Timer Pulse type of timer is used to create pulses of a precise duration This delay is programmable using the TwidoSoft The following timing diagram illustrates the operation of the TP type timer 1 2 6 4 4 The following table describes the operation of the TP type timer Phase Description 1 The timer starts on the rising edge of the IN input The current value TMi V is set to 0 if the timer has not already started The TMi Q output bit is set to 1 when the timer starts The current value TMi V of the timer increases from 0 to TMi P in increments of one unit per pulse of the time base TB The TMi Q output bit is set to 0 when the current value has reached TMi P The current value TMi V is set to 0 when TMi V equals TMi P and input IN returns to 0 6 This timer cannot be reset Once TMi V equals TMi P and input IN is 0 then TMi V is set to 0 TWD USE 10AE 325 Basic Instructions Programming and Configuring Timers Introduction Examples Configurati
72. Tab p 166 for more details about Marked IP Each TWDLCAE4ODRF base controller is assigned a unique static IP address as default The device default IP address is derived from the unique MAC physical address IEEE Global Address permanently stored in the compact controller For increased flexibility on your network other than using the default IP address the TwidoSoft application program allows you to configure a different static IP address for this device along with defining the subnetwork and gateway IP addresses A TWDLCAE40DRPF controller can be both Modbus TCP IP Client and Server depending on whether it is querying or answering a remote device respectively TCP messaging service is implemented via TCP port 502 Modbus Client is implemented via the EXCHS instruction and MSG3 function You may program several EXCH3 instructions however one EXCH3 only can be active at a time The TCP connection is automatically negotiated by the compact controller as soon as the EXCH3 instruction is active TWD USE 10AE 149 Communications Quick TCP IP Setup Guide for PC to Controller Ethernet Communication Scope Checking the Current IP Settings of your PC This Quick TCP IP Setup Guide is intended to provide Ethernet connectivity information and TCP IP configuration information to rapidly setup communication between your PC running the TwidoSoft application and the Twido Controller over a stand alone Ethernet netw
73. The parameters are used to control and switch internal operating modes to the sensor or the actuator 3 Configuration This field contains Identification the code which corresponds to I O configuration e the slave identification ID code e the slave identification codes ID1 and ID2 4 Address Physical address of slave Note The operating parameters address configuration and identification data are saved in a non volatile memory TWD USE 10AE 199 Installing the AS Interface bus Software set up principles At a Glance Set up principle To respect the philosophy adopted in TwidoSoft the user should adopt a step by step approach when creating an AS Interface application The user must know how to functionally configure his AS Interface bus See How to insert a slave device into an existing AS Interface V2 configuration p 221 The following table shows the different software implementation phases of the AS Interface bus Mode Phase Description Local Declaration of module Choice of the slot for the AS Interface Master module TWDNOI10M3 on the expansion bus Configuration of the Choice of master modes module channel Declaration of slave Selection for each device devices e of its slot number on the bus e of the type of standard or extended address slave Confirmation of Confirmation at slave level configuration parameters Glo
74. Type of Instruction Example Function Bit instruction LD M10 Reads internal bit M10 Block instruction IN TMO Starts the timer TMO Word instruction MW10 MW50 100 Addition operation Program instruction SR5 Calls subroutine 5 Grafcet instruction 8 Step 8 274 TWD USE 10AE Instruction List Language List Language Instructions Introduction List language consists of the following types of instructions e Test Instructions e Action instructions e Function block instructions This section identifies and describes the Twido instructions for List programming Test Instructions The following table describes test instructions in List language Name Equivalent graphic element Function LD 4H The Boolean result is the same as the status of the operand LDN The Boolean result is the same as the reverse status of the operand LDR The Boolean result changes to 1 on detection of the operand rising edge changing from 0 to 1 LDF The Boolean result changes to 1 on detection of the operand falling edge changing from 1 to 0 AND The Boolean result is equal to the AND logic between the Boolean result of the previous instruction and the status of the operand ANDN The Boolean result is equal to the AND logic between the Boolean result of the previous instruction and the reverse status of the operand ANDR
75. Yes No TWDLMDA20DRT_ Yes Yes TWDLCA 40DRF Yes Yes TWDLC A24DRF Yes No TWDLC A16DRF Yes No TWDLC A10DRF No No TWD USE 10AE 33 Twido Language Objects Validity Check Description of Floating Point When the result is not within the valid range the system bit S18 is set to 1 The status word SW17 bits indicate the cause of an error in a floating operation Different bits of the word SW17 SW17 X0 Invalid operation result is not a number 1 NAN or 1 NAN SW17 X1_ Reserved SW17 X2_ Divided by 0 result is infinite 1 4 INF or 1 INF SW17 X3_ Result greater in absolute value than 3 402824e 38 result is infinite 1 INF or 1 INF SW17 X4_ Reserved to X15 This word is reset to 0 by the system on cold start and also by the program for re usage purposes The following table describes floating point and double word objects and Double Word Objects Type of object Description Address Maximum Write access Indexed form number Immediate values Integers or decimal No numbers with identical format to 32 bit objects Internal floating point Objects used to store values MFi 1500 Yes MFi index Internal double word during operation in data MDi 1500 Yes MDilindex memory Floating constant Used to store constants KFi 128 Yes only using KFi index value TwidoSoft Double constant KDi 128 Yes only using KDi i
76. a number of hardware and software compatibilities described in the following paragraphs In addition this function requires the resources presented in the Performances paragraph Compatibility The Twido PID function is available on Twidos with version 1 2 or higher software If you have Twidos with an earlier version of the software you can update your firmware in order to use this PID function Note The version 1 0 analog input output modules can be used as PID input output modules without needing to be updated In order to configure and program a PID on these different hardware versions you must have version 1 2 of the TwidoSoft software Performance The PID regulation loops have the following performances Description Time Loop execution time 0 4 ms 428 TWDUSE 10AE Advanced Instructions Detailed characteristics of the PID function General The PID function completes a PID correction via an analog measurement and setpoint in the default 0 10000 format and provides an analog command in the same format or a Pulse Width Modulation PWM on a digital output All the PID parameters are explained in the windows used to configure them Here we will simply summarize the functions available indicate measurement values and describe how they integrate into PID in a functional flow diagram Note For use at full scale optimum resolution you can configure your analog input connecte
77. ambient temperature e During operation of the auto tuning make sure that no disturbances enter through the process for either computed parameters will be erroneous or the auto tuning process will simply fail e g the door of the oven shall not be opened not even momentarily e Configure the Twido PLC to scan in Periodic mode Once you have determined the correct sampling period Ts for the auto tuning the scan period must be configured so that the sampling period Ts is an exact multiple of the Twido PLC scan period Note To ensure a correct run of the PID control and of the auto tuning process it is essential that the Twido PLC be configured to execute scans in Periodic mode not Cyclic In Periodic mode each scan of the PLC starts at regular time intervals This way the sampling rate is constant throughout the measurement duration unlike cyclic mode where a scan starts as soon as the previous one ends which makes the sampling period unbalanced from scan to scan 460 TWD USE 10AE Advanced Instructions AT Operating Modes Methods for Determining the Sampling Period Ts Introducing the Process Response Curve Method The auto tuning can be used either independently AT mode or in conjunction with the PID control AT PID e AT mode After convergence of the AT process and successful completion with the determination of the PID control parameters Kp Ti and Td or after detection of an
78. and conditions are associated The following illustration shows examples of Grafcet instructions in List and Ladder programs respectively oO 3 1 LD M10 2 4 3 5 4 f 4 5 LD l0 7 6 6 7 i 5 8 LD M15 9 7 10 SOR M10 4 5 4 10 7 6 4 ey Seg M15 7 4 fd TWD USE 10AE 23 Twido Software Languages 24 TWD USE 10AE Twido Language Objects At a Glance Subject of this This chapter provides details about the language objects used for programming Chapter Twido controllers What s in this This chapter contains the following topics Chapter Topic Page Language Object Validation 26 Bit Objects 27 Word Objects 29 Floating point and double word objects 32 Addressing Bit Objects 36 Addressing Word Objects 37 Addressing floating objects 38 Addressing double word objects 39 Addressing Inputs Outputs 40 Network Addressing 42 Function Block Objects 43 Structured Objects 45 Indexed objects 48 Symbolizing Objects 50 TWD USE 10AE 25 Twido Language Objects Language Object Validation Introduction Word and bit objects are valid if they have been allocated memory space in the controller To do this they must be used in the application before downloaded to the controller Example The range of valid objects is from zero to the maximum reference for that object typ
79. as the debug window is displayed Note It is accessible in online mode The screen below is used to view the PID control PID PID number o General Input PID AT Output Animation Initialize Detach Setpoint Measure J Cancel Previous Next Help 454 TWD USE 10AE Advanced Instructions Description The following table describes the different zones of the window Field Description PID number Specify the PID number that you wish to view here The value is between 0 and 13 14 PID maximum per application Chart This zone displays the setpoint and process value graphs The scale on the horizontal axis X is determined using the menu to the top right of the window The scale on the vertical axis is determined using the PID input configuration values with or without conversion It is automatically optimized so as to obtain the best view of the graphs Horizontal axis scale menu This menu allows you to modify the scale of the horizontal axis You can choose from 4 values 15 30 45 or 60 minutes Initialize This button clears the chart and restarts tracing the graphs TWD USE 10AE 455 Advanced Instructions PID States and Errors Codes At a Glance PID State Memory Word PID State Memory Word In addition to the List of PID States available from the Animation dialog box see Animation tab o
80. diagrams below illustrate the use of the remote link with remote I O and a peer controller Step 1 Configure the Hardware 10 0 10 1 Master controller Remote I O Peer controller Q0 0 Q0 1 The hardware configuration is three base controllers of any type Port 1 is used for two communication modes One mode is to configure and transfer the application program with TwidoSoft The second mode is for the Remote Link network If available an optional Port 2 on any of the controllers can be used but a controller only supports a single Remote Link Note In this example the two first inputs on the Remote I O are hard wired to the first two outputs Step 2 Wire the controllers Mini DIN connection Master Remote controller Peer controller controller Address 1 ayadi Address 2 A B GND DPT A B GND DPT A B GND DPT T ga Ec ce Te ca NG Terminal block connection Master Remote controller Peer controller controller Address 1 tee Address 2 A B OV A B _ OV A B _ OV A B SG TWD USE 10AE 115 Communications Connect the A and B signal wires together And at each controller the DPT signal is tied to ground Although tying the signal to the ground is not required for use with a remote link
81. dialog box the Scan Period must be set so that the sampling period Ts is an exact multiple of the scan period as in the following example Scan Period Ts 76 7600 76 100 ms which satisfies the condition 2 ms lt Scan Period lt 150 ms TWD USE 10AE 465 Advanced Instructions Trial and Error The trial and error method consists in providing successive guesses of the sampling Method period to the auto tuning function until the auto tuning algorithm converges successfully towards Kp Ti and Td that are deemed satisfactory by the user Note Unlike the process response curve method the trial and error method is not based on any approximation law of the process response However it has the advantage of converging towards a value of the sampling period that is in the same order of magnitude as the actual value Top perform a trial and error estimation of the auto tuning parameters follow these steps Step Action 1 Select the AT tab from the PID configuration window Set the Output limitation of AT to 10000 Select the PID tab from the PID configuration window AJOJN Provide the first or n guess in the Sampling Period field Note If you do not have any first indication of the possible range for the sampling period set this value to the minimum possible 1 1 unit of 10 ms oa Select PLC gt Transfer PC gt PLC from menu bar to download the application program to
82. e A valid backup application is present in the EEPROM e The application in RAM matches the backup application in EEPROM e The backup memory words are valid 58 TWD USE 10AE User Memory Using the 64K Extended Memory Cartridge Introduction The following information details using the memory functions in modular controllers using a 64K extended memory cartridge At a Glance The 64K extended memory cartridge is used to extend the program memory capability of your Twido controller from 32K to 64K It must remain plugged into the controller as long as the extended program is being used If the cartridge is removed the controller will enter the stopped state Memory words are still backed up into the EEPROM in the controller Dynamic data can be stored in memory words then backed up to the EEPROM The 64K extended memory cartridge has the same power up behavior as the 32K backup cartridge Memory Here is a diagram of a controller s memory structure using an extended memory Structure cartridge The arrows show what is backed up into the EEPROM and the 64K extended memory cartridge from RAM RAM EEPROM Extended memory cartridge Dynamic words MWs Program 1st Configuration data MWs Program 2nd TWD USE 10AE 59 User Memory Configure Before you begin writing your ex
83. eror code 5 is void with the EXCHS instruction and replaced by the Ethernet specific error codes 109 and 122 described below 6 transmission 7 bad command within table 8 selected port not configured available 9 reception error 10 can not use KW if receiving 11 transmission offset larger than transmission table 12 reception offset larger than reception table 13 controller stopped EXCH processing Error codes dedicated to Modbus response 81 slave server PLC returns ILLEGAL FUNCTION response 82 slave server PLC returns ILLEGAL DATA ADDRESS response 83 slave server PLC returns ILLEGAL DATA VALUE response 84 slave server PLC returns SLAVE DEVICE FAILURE response 85 slave server PLC returns ACKNOWLEDGE response 86 slave server PLC returns SLAVE DEVICE BUSY response 87 slave server PLC returns NEGATIVE ACKNOWLEDGE response 88 slave server PLC returns MEMORY PARITY ERROR response 180 TWD USE 10AE Communications EXCH3 Error Code recorded into System Word SW65 Ethernet specific error codes for EXCH3 101 no such IP address 102 the TCP connection is broken 103 no socket available all connection channels are busy 104 network is down 105 network cannot be reached 106 network dropped connection on reset 107 connection aborted by peer device 108 connection reset by peer device 109 connection time out elapsed 110 rejection o
84. example presetting a time delay or a counter adjusting the frequency of the pulse generator or machine preheating time Adjusting the duration of a time delay from 5 to 10 s using analog potentiometer 1 For this adjustment practically the entire adjustment range of analog 10s potentiometer 1 from 0 to 1023 is used 5s 0 1023 The following parameters are selected at configuration for the time delay block TMO e Type TON e Timebase 10 ms The preset value of the time delay is calculated from the adjustment value of the potentiometer using the following equation TMO P IW0 0 0 2 500 184 TWD USE 10AE Built In Analog Functions Analog Channel Introduction Principle Programming Example Code for the above example LD 1 MW0 IW0 0 0 2 Y TMO0 P MW0 500 MW0 IW0 0 0 2 TMO0 P MW0 500 BLK TMO LD I0 0 IN I10 0 TMO Q0 0 OUT BLK A LD Q ia g Sat ST Q0 0 END BLK All Modular controllers TWDLMDA20DTK TWDLMDA20DUK TWDLMDA20DRAT TWDLMDA4ODTK and TWDLMDA40DUK have a built in analog channel The voltage input ranges from 0 to 10 V and the digitized signal from 0 to 511 The analog channel takes advantage of a simple averaging scheme that takes place over eight samples An analog to digital converter samples an input voltage from 0 to 10 V to a digital value from 0 to 511 T
85. field Note If there is no gateway device on your network simply enter your Twido controller s IP address in the Gateway field TWD USE 10AE 165 Communications Marked IP Tab Overview The following information describes how to configure the Marked IP tab of the Ethernet Configuration dialogbox Note e The Marked IP can be configured when the TwidoSoft application program is in offline mode only e You may use a Marked IP only if you configured the Twido controller s IP address manually in the IP Address Configure tab Marked IP does not function with the Default IP Address Definition of the This function allows you to reserve one of the four Ethernet TCP connection Marked IP channels supported by your Twido controller for a particular client host designated Function as Marked IP Marked IP can ensure that one TCP channel is reserved and always available for communication with the specified remote device even if the idle timeout is disabled idle timeout is set to 0 Marked IP tab The following figure presents a sample screen of the Marked IP tab showing an example of marked IP address entered by the user Ethernet Configuration IP Address Configure Marked IP Idle Checking Remote Devices V Specify a marked Please specify one IP address for marked IP Address connection 192 168 1 50 Cancel Help 166 TWD USE 10
86. following format to address inputs output exchange words 1 Q Ww x Symboli Object type Format Controller point VO Type position 40 TWD USE 10AE Twido Language Objects Description The table below describes the I O addressing format Group Item Value Description Symbol The percent symbol always precedes an internal address Object type I Input The logical image of the electrical state of a controller or expansion I O module input Q 7 Output The logical image of the electrical state of a controller or expansion I O module output Controller x 0 Master controller Remote Link master position 1 7 Remote controller Remote Link slave I O Type y 0 Base I O local I O on controller 1 7 Expansion I O modules Channel Zz 0 31 I O channel number on controller or expansion I Number O module Number of available I O points depends on controller model or type of expansion I O module Examples The table below shows some examples of I O addressing I O object Description 10 0 5 Input point number 5 on the base controller local 1 0 Q0 3 4 Output point number 4 on the expansion I O module at address 3 for the controller base expansion I O 10 0 3 Input point number 3 on base controller 13 0 1 Input point number 1 on remote I O controller at address 3 of the remote link 10 3 2 Input point number 2 on the expansion I O mo
87. following illustration shows both reversible and non reversible programming for this example Reversible programming BLK SCO SC0 3 LD SC0 3 OR 03 R 410 3 SCO a I10 2 R END BLK LD SCO0 0 10 2 ST QO 1 cu LD SCO 1 ST Q0 2 LD SCO0 2 a ST QO0 3 Non reversible SC0 0 Q0 1 programming LD SCO0 3 OR 1I0 3 SC0 1 Q0 2 R LLN LD Oe CU SCO LD SC0 0 ST Q0 1 SC0 2 Q0 3 LD SC0 1 ST Q0 2 LD SCO0 2 ST Q0 3 338 TWD USE 10AE Basic Instructions Special case The following table contains a list of special cases for operating the Step Counter function block Special case Description Effect of a cold restart S0 1 Initializes the step counter Effect of a warm restart S1 1 Has no effect on the step counter TWD USE 10AE 339 Basic Instructions 14 3 Numerical Processing At a Glance Aim of this This section provides an introduction to Numerical Processing including descriptions Section and programming guidelines What s in this This section contains the following topics Section Topic Page Introduction to Numerical Instructions 341 Assignment Instructions 342 Comparison Instructions 347 Arithmetic Instructions on Integers 349 Logic Instructions 352 Shift Instructions 354 Conversion Instructions 356 Single double word conversion instructions 358
88. input O or activation of instruction O the data word lowest in the queue is loaded into output word Ri O and the contents of the register are moved down one place in the queue Fig b When the register is empty output E 1 no further retrieval is possible Output word Ri O does not change and retains its value 3 The queue can be reset at any time state 1 at input R or activation of instruction R Retrieval of the first data item which is then loaded into Ri O 20 b 80 Ri O 50 _ gt 50 20 80 TWD USE 10AE 377 Advanced Instructions Programming and Configuring Registers Introduction The following programming example shows the content of a memory word MW34 being loaded into a register R2 1 on reception of a storage request l0 2 if register R2 is not full R2 F 0 The storage request in the register is made by M1 The retrieval request is made by input l0 3 and R2 0 is loaded into MW20 if the register is not empty R2 E 0 378 TWD USE 10AE Advanced Instructions Programming The following illustration is a register function block with examples of reversible and Example non reversible programming R R2 E M1 I FL 410 3 TYPE FIFO 0 10 3 R2 E MW20 R2 0 I0 2 R2 F R2 1 MW34 M1
89. internal EEPROM When restoring memory words save restore this value is updated with the number of memory words restored to RAM function For the save operation when this number is set to 0 memory words will not be stored The user must define the user logic program Otherwise this program is set to 0 in the controller application except in the following case On cold start this word is set to 1 if the internal Flash EEPROM has no saved memory word MW file In the case of a cold start where the internal Flash EEPROM contains a memory word MW list the value of the number of saved memory words in the file must be set in this system word SW97 System Function Description Control Words SW101 Value of the port s When bit S101 is set to 1 you can change the Modbus address of port S SW102 Modbus address 1 or port 2 The address of port 1 is SW101 and that of port 2 is SW102 524 TWDUSE 10AE System Bits and Words System Words Function Description Control SW 103 gt SW104 Configuration for use of the ASCII protocol When bit S103 Comm 1 or S104 Comm 2 is set to 1 the ASCII protocol is used System word SW103 Comm 1 or SW104 Comm 2 must be set according to the elements below 15 14 113 12 11 10 9 8 7 5 407 3 2 1J0 it End of the character string S 7 Parity Baud rate O bi Stop bit o Baud rate 0 1200 b
90. its I O extension Peer controller Yes Run mode is independent of the Master s INW and QNW A maximum of 4 input words and 4 output words can be transmitted to and from each peer 108 TWD USE 10AE Communications Remote Controller Scan Synchronization Master Controller Restart The update cycle of the remote link is not synchronized with the master controller s scan The communications with the remote controllers is interrupt driven and happens as a background task in parallel with the running of the master controller s scan At the end of the scan cycle the most up to date values are read into the application data to be used for the next program execution This processing is the same for remote I O and peer controllers Any controller can check for general link activity using system bit S111 But to achieve synchronization a master or peer will have to use system bit S110 This bit is set to 1 when a complete update cycle has taken place The application program is responsible for resetting this to 0 The master can enable or disable the remote link using system bit S112 Controllers can check on the proper configuration and correct operation of the remote link using S113 The DPT signal on Port 1 used to determine if TwidoSoft is connected is sensed and reported on S100 All these are summarized in the following table System Bit Status Indication
91. lists the types of Shift instructions Instruction Function Logic shift SHL op2 i Logic shift of i positions to 0 the left S17 SHR op2 i Logic shift of i positions to 0 the right S17 Rotate shift ROR op2 i Rotate shift of i positions to the left 0 S17 ROL op2 i Rotate shift of i positions 0 to the right S17 overrun Note System bit S17 See System Bits S p 510 is used for capacity 354 TWD USE 10AE Basic Instructions Structure Shift operations are performed as follows 10 1 7 LDR I0 1 P MW0 SHL MW10 5 MW0 SHL MW10 5 Ae LDR I0 2 pL MW 10 ROR KWS 8 MW10 ROR KW9 8 Syntax The syntax depends on the operators used as shown in the table below Operator Syntax SHL SHR Op1 Operator Op2 i ROL ROR Operands Types Operand 1 Op1 Operand 2 Op2 Words MWi QWi PMWi KWi IW VQWAI SWi IWAI SQW PQWAI SWi BLK x Double word MDi MDi KDi TWD USE 10AE 355 Basic Instructions Conversion Instructions Introduction Review of BCD Code Structure Conversion instructions perform conversion between different representations of numbers The following table lists the types of Conversion instructions Instruction Function BTI BCD gt Binary conversion ITB Binary gt BCD conversio
92. method also provides a very dynamic command which can express itself through unwanted overshoots during the change of setpoints pulses In this case lower the production value until you get the required behavior The method is interesting because it does not require any assumptions about the nature and the order of the procedure You can apply it just as well to the stable procedures as to real integrating procedures It is really interesting in the case of slow procedures glass industry because the user only requires the beginning of the response to regulate the coefficients Kp Ti and Td TWD USE 10AE 471 Advanced Instructions Role and influence of PID parameters Influence of Proportional action is used to influence the process response speed The higher the proportional gain the faster the response and the lower the static error in direct proportion action though the more stability deteriorates A suitable compromise between speed and stability must be found The influence of integral action on process response to a scale division is as follows A Kp too high Kp correct A C 4 O ea a Bi tas aA Static error 472 TWDUSE 10AE Advanced Instructions Influence of Integral action is used to cancel out static error deviation between the process value integral action and the setpoint The higher the level of integral action low Ti the faster the response and the
93. numerical operations e Controller internal variables such as bits and words TWD USE 10AE 273 Instruction List Language Operation of List Instructions Introduction Operation Supported List Instructions List instructions have only one explicit operand the other operand is implied The implied operand is the value in the Boolean accumulator For example in the instruction LD l0 1 l0 1 is the explicit operand An implicit operand is stored in the accumulator and will be written over by value of l0 1 A List instruction performs a specified operation on the contents of the accumulator and the explicit operand and replaces the contents of the accumulator with the result For example the operation AND l1 2 performs a logical AND between the contents of the accumulator and the Input 1 2 and will replace the contents of the accumulator with this result All Boolean instructions except for Load Store and Not operate on two operands The value of the two operands can be either True or False and program execution of the instructions produces a single value either True or False Load instructions place the value of the operand in the accumulator while Store instructions transfer the value in the accumulator to the operand The Not instruction has no explicit operands and simply inverts the state of the accumulator The following table shows a selection of instructions in List Instruction language
94. objects and specific words that can be accessed by the program Example of a The following illustration shows a counter function block Function Block Ci _IR E Apy B Ci P 9999 U Up down counter block Bit Objects Bit objects correspond to the block outputs These bits can be accessed by Boolean test instructions using either of the following methods e Directly for example LD E if they are wired to the block in reversible programming see Standard function blocks programming principles p 319 e By specifying the block type for example LD Ci E Inputs can be accessed in the form of instructions Word Objects Word objects correspond to specified parameters and values as follows e Block configuration parameters some parameters are accessible by the program for example pre selection parameters and some are inaccessible by the program for example time base e Current values for example Ci V the current count value TWD USE 10AE 43 Twido Language Objects Word Objects Objects Accessible by the Program Double word objects increase the computational capability of your Twido controller while executing system functions such as fast counters FC very fast counters VFC and pulse generators PLS Addressing of 32 bit double word objects used with function blocks simply consists in appending the original syntax of the standard word objects with the D ch
95. on each PLC scan But the result of the ASI_CMD bus reading instruction is available only at the end if the following PLC scan TWD USE 10AE 227 Installing the AS Interface bus Details of the In the case when bus status is read by the ASI_CMD instruction value of the MWx results of the parameter is equal to 16 the format of the result in the MWx 1 word is as follows mere to MWx 1 Designation 1 OK 0 NOK read bus status least significant bit 0 Configuration OK bit 1 LDS 0 slave present with address 0 bit 2 Auto addressing active bit 3 Auto addressing available bit 4 Configuration Mode active bit 5 Normal operation active bit 6 APF power supply problem bit 7 Offline ready most significant bit 0 Peripheral fault bit 1 Data exchange active bit 2 Offline Mode bit 3 Normal mode 1 bit 4 Communication fault with the AS Interface Master bit 5 ASI_CMD instruction in progress bit 6 ASI_CMD instruction error 228 TWD USE 10AE Installing the AS Interface bus Details of the results of the In the case of slave diagnostics by ASI_CMD instruction MWx value between 4 and 15 the slaves status is returned in the bits 1 OK of the MWx 1 word The ASI_CMD following table gives the detail of the results according to the value of the MWx instruction to word read slave status MWx MWx 1 value most sig
96. operands TRUNC whole part of a floating point value division of two operands EXP natural exponential LOG base 10 logarithm EXPT power of an integer by a real LN natural logarithm Structure Ladder Language MO MFO MF10 129 7 l3 2 MF1 SQRT MF10 13 3 P MF2 ABS MF20 13 5 P MF8 TRUNC MF2 Instruction List Language LD MO MFO MF10 129 7 LD 13 2 SMF1 SQRT MF10 LDR 13 3 MF2 ABS MF20 LDR I3 5 MF8 TRUNC MF2 TWD USE 10AE 481 Advanced Instructions Ladder Language MO MFO0 LOG MF10 13 2 MF2 LN MF20 I13 3 P MF4 EXP MF40 13 4 P MF6 EXPT MF50 MW52 Instruction List Language LD MO MF 0 LOG MF10 LD 13 2 SMF2 LN MF20 LDR 13 3 SMF 4 EXP MF40 LDR 13 4 MF6 EXPT SMF50 SMW52 Syntax Operators and syntax of arithmetic instructions on floating point Operators Syntax Op1 Op2 Operator Op3 SQRT ABS TRUNC Op1 Operator Op2 LOG EXP LN EXPT Op1 Operator Op2 Op3 482 TWD USE 10AE Advanced Instructions Note When you perform an addition or subtraction between 2 floating point numbers the two operands must comply with the condition Op1 gt Op2 x 2 74 where Op1 gt Opz If this condition is not respected the result is equal to operand 1 Op1 This phenomenon
97. operation between the operand or its inverse or its rising or falling edge and the Boolean result of the preceding instruction Examples The following example shows the use of XOR instructions Schematic using XOR instruction I10 1 M1 Q0 3 LD 0 1 jonl XOR MI ea ST Q0 3 Schematic NOT using XOR instruction I0 1 MI1 Q0 3 LD I10 1 ANDN M1 OR MI ANDN IO0 1 ST Q0 3 Permitted The following table lists the types of XOR instructions and permitted operands Operands List instruction Permitted Operands XOR l WIA VQ PQA M S X BLK x Xk XORN l WIA VQ WQA M S X BLK x Xk XORR l IA M XORF l VIA M 312 TWDUSE 10AE Basic Instructions Timing Diagram The following diagram displays the timing for the XOR instructions XOR 10 1 M1 Q0 3 Special Cases The following are special precautions for using XOR instructions in Ladder programs e Do not insert XOR contacts in the first position of a rung e Do not insert XOR contacts in parallel with other ladder elements see the following example As shown in the following example inserting an element in parallel with the XOR contact will generate a validation error M13 I1 5 Q1 10 lx RI XOR M10 TWD USE
98. other type of Twido controller Specialized TwidoSoft window used to manage hardware and software configuration A configured value that cannot be modified by the program being executed A ladder diagram element representing an input to the controller A function block used to count events up or down counting Generation of a list of operands symbols line rung numbers and operators used in an application to simplify creating and managing applications A specialized window in the TwidoSoft application for viewing cross references Data variable Date Clock functions See Variable Allow control of events by month day of month and time of day See Schedule Blocks TWD USE 10AE 529 Glossary Default gateway Drum controller The IP address of the network or host to which all packets addressed to an unknown network or host are sent The default gateway is typically a router or other device A function block that operates similar to an electromechanical drum controller with step changes associated with external events EEPROM Erase Executive loader Expansion bus Expansion I O modules Electrically Erasable Programmable Read Only Memory Twido has an internal EEPROM and an optional external EEPROM memory cartridge This command deletes the application in the controller and has two options e To delete the contents of the controller RAM the controller internal EEPROM and the installed opt
99. output Q0 2 Start month June Start activity in June End month September Stop activity in September Start date 21 Start activity on the 21st day of June End date 21 Stop activity on the 21st day of September Day of week Monday Wednesday Run activity on Monday Wednesday and Friday Friday Start time 21 00 Start activity at 21 00 Stop time 22 00 Stop activity at 22 00 Using the following program the schedule block can be disabled through a switch or a humidity detector wired to input l0 1 I10 1 SW114 X6 LD I0 1 ST SWI114 X6 416 TWD USE 10AE Advanced Instructions The following timing diagram shows the activation of output Q0 2 I0 1 21 June Q0 2 o Time Dating by Date and time are both available in system words SW50 to SW53 see System Program Words SW p 517 It is therefore possible to perform time and date stamping in the controller program by making arithmetic comparisons between the current date and time and the immediate values or words MWi or KWi which can contain setpoints TWD USE 10AE 417 Advanced Instructions Time Date Stamping Introduction Dating an Event Programming System words SW49 to SW53 contain the current date and time in BCD format see Review of BCD Code p 356 which is useful for display on or transmission to a peripheral
100. output e End of transmission if transmission e End of reception end character received Error e Reset the block State 0 request in progress Fault Error MSGxX E State 1 comm done if output e Bad command e Table incorrectly configured e Incorrect character received speed parity etc e Reception table full not updated State 0 message length OK link OK If an error occurs when using an EXCH instruction bits MSGx D and MSGx E are set to 1 and system word SW63 contains the error code for Port 1 and SWE64 contains the error code for Port 2 See System Words SW p 517 Reset Input R When Reset Input set to 1 e Any messages that are being transmitted are stopped e The Fault Error output is reset to 0 e The Done bit is set to 1 A new message can now be sent Fault Error The error output is set to 1 either because of a communications programming error Output or a message transmission error The error output is set to 1 if the number of bytes MSGx E defined in the data block associated with the EXCH instruction word 1 least significant byte is greater than 128 80 in hexadecimal by FA The error output is also set to 1if a problem exists in sending a Modbus message to a Modbus device In this case the user should check wiring and that the destination device supports Modbus communication Communications When the Done output is set to 1 the Twido controller is re
101. period PWMi P Yes PLS Word Number of pulses PLSi N Yes Word Preset value PLSi P Yes Bit Current output enabled PLSI Q No Bit Generation done PLSi D No SBR Bit Register Bit SBRi J No SC Bit Step counter Bit SCi j Yes MSG Bit Done MSGi D No Bit Error MSGi E No TWD USE 10AE 371 Advanced Instructions Programming Principles for Advanced Function Blocks At a Glance All Twido applications are stored in the form of List programs even if written in the Ladder Editor and therefore Twido controllers can be called List machines The term reversibility refers to the ability of TwidoSoft to represent a List application as Ladder and then back again By default all Ladder programs are reversible As with basic function blocks advanced function blocks must also take into consideration reversibility rules The structure of reversible function blocks in List language requires the use of the following instructions e BLK Marks the block start and the input portion of the function block e OUT_BLK Marks the beginning of the output portion of the function block e END _BLK Marks the end of the function block Note The use of these reversible function block instructions is not mandatory for a properly functioning List program For some instructions it is possible to program in List language without being reversible Dedicated Inputs The Fast Counter Very Fast Counter PLS and PWM adva
102. produces an indeterminate or infinite result and changes bit S18 to 1 the word SW17 indicates the cause of the error TWD USE 10AE 483 Advanced Instructions Trigonometric Instructions General These instructions enable the user to perform trigonometric operations SIN sine of an angle expressed as a ASIN T T radian arc sine result within 2 and 2 COS cosine of an angle expressed ACOS arc cosine result within 0 and 7 as a radian TAN tangent of an angle expressed ATAN T T as a radian arc tangent result within 2 and 2 Structure Ladder language MO MFO SIN MF10 l3 2 MF2 TAN MF10 13 3 P MF4 ATAN MF20 Instruction List Language LD MO MF0 SIN MF10 LD 13 2 MF2 TAN MF10 LDR 13 3 MF4 ATAN SMF20 484 TWD USE 10AE Advanced Instructions Syntax Rules of use Structured text language IF M0 THEN SMFO SIN SMF10 END_IF IF 13 2 THEN SMF2 TAN MF10 END_IF IF 13 3 THEN SMF4 ATAN MF20 END_IF Operators operands and syntax of instructions for trigonometric operations Operators Syntax Operand 1 Op1 Operand 2 Op2 SIN COS TAN ASIN Op1 Operator Op2 MFi MFi KFi ACOS ATAN e when the operand of the function is an invalid number e g arc cosine of a number g
103. proportional production Ti integration time and TD diversion time TWD USE 10AE 469 Advanced Instructions Open loop adjustment Note This adjustment method provides a very dynamic command which can express itself through unwanted overshootsduring the change of setpoint pulses In this case lower the production value until you get the required behaviour As the regulator is in manual mode you apply a level to the output and make the procedure response start the same as an integrator with pure delay time Output AS a t 4 Measure j Integrator Process response AM AS Tu Tg y gt gt a The intersection point on the right hand side which is representative of the integrator with the time axes determines the time Tu Next Tg time is defined as the time necessary for the controlled variable measurement to have the same variation size of the scale as the regulator output According to the kind of PID or PI regulator the adjustment of the coefficients is executed with the following values Kp Ti Td PID 1 2 Tg Tu 2x Tu 0 5 x Tu Pl 0 9 Tg Tu 3 3 x Tu where Kp proportional production Ti integration time and TD diversion time 470 TWD USE 10AE Advanced Instructions Note Attention to the units If the adjustment is carried out in PL7 multiply the value obtained for KP by 100 This adjustment
104. quick examination and analysis of program logic and greatly simplifies the development and testing of an application For example WASH_END is a symbol that could be used to identify a timer function block that represents the end of a wash cycle Recalling the purpose of this name should be easier than trying to remember the role of a program address such as TM3 The following are guidelines for defining symbols e A maximum of 32 characters e Letters A Z numbers 0 9 or underscores _ e First character must be an alphabetical or accented character You can not use the percentile sign e Do not use spaces or special characters e Not case sensitive For example Pump1 and PUMP1 are the same symbol and can only be used once in an application Symbols are defined and associated with language objects in the Symbol Editor Symbols and their comments are stored with the application on the PC hard drive but are not stored on the controller Therefore they can not be transferred with the application to the controller 50 TWD USE 10AE User Memory At a Glance Subject of this This chapter describes the structure and usage of Twido user memory Chapter What s in this This chapter contains the following topics 2 Chapter Topic Page User Memory Structure 52 Backup and Restore without Backup Cartridge or Extended Memory 54 Backup and Restore with a 32K Backup Cartridge 56 Usi
105. register SBR x yy Register Bit Read Write Message MSGx D Done Read MSGx E Error Read AS Interface slave SIAX Y Z Value Read Force input 238 TWD USE 10AE Operator Display Operation Object Variable Attribute Description Access AS Interface analog IWAx y z Value Read slave input AS Interface slave QAX y Z Value Read Write Force output AS Interface analog QWAx y z Value Read Write slave output Notes 1 means a 32 bit double word variable The double word option is available on all controllers with the exception of the Twido TWDLC A10DRF controllers 2 Variables will not be displayed if they are not used in an application since Twido uses dynamic memory allocation 3 If the value of MW is greater than 32767 or less than 32768 the operator display will continue to blink 4 Ifthe value of SW is greater than 65535 the operator display continues to blink except for SWO and SW11 If a value is entered that is more than the limit the value will return to the configured value 5 Ifa value is entered for PLS P that is more than the limit the value written is the saturation value TWD USE 10AE 239 Operator Display Operation Displaying and Modifying Objects and Variables Data Values and Display Formats Each type of system object is accessed by starting with the Input Object l sequencing through to the Message object MSG and finally looping b
106. s internal RTC is updated from the values written in these words SW54 Date and time of the System words containing the date and time of the last power failure S SW55 last stop or controller stop in BCD eke SW54 SS Seconds SW57 F SW55 HHMM Hour and minute SW56 MMDD Month and day SW57 CCYY Century and year SW58 Code of last stop Displays code giving cause of last stop S 1 Run Stop input edge 2 Stop at software fault controller scan overshoot Stop command Power outage 5 Stop at hardware fault 520 TWD USE 10AE System Bits and Words System Function Description Control Word SW59 Adjust current Adjusts the current date U date Contains two sets of 8 bits to adjust current date The operation is always performed on rising edge of the bit This word is enabled by bit S59 Increment Decrement Parameter bit 0 bit 8 Day of week bit 1 bit 9 Seconds bit 2 bit 10 Minutes bit 3 bit 11 Hours bit 4 bit 12 Days bit 5 bit 13 Month bit 6 bit 14 Years bit 7 bit 15 Centuries SWEO RTC correction RTC correction value U SWE3 EXCH1 block EXCH1 error code S error code 0 operation was successful 1 number of bytes to be transmitted is too great gt 250 2 transmission table too small 3 word table too small 4 receive table overflowed 5 time out elapsed 6 transmission 7 bad command within table 8 selected port not configured avail
107. show the number of input and output channels They are automatically implemented when the IO code is entered 206 TWD USE 10AE Installing the AS Interface bus Step Action For each parameter define e the system s acknowledgement box checked in Bits view or decimal value between 0 and 15 in Decimal view aname that is more meaningful than Parameter X optional Note The selected parameters are the image of permanent parameters to be provided to the AS Interface Master If needed modify Address within the limit of available addresses on the bus by clicking the up down arrows to the left of the address access is then given to authorized addresses or by entering the address using the keyboard Confirm the slave configuration by clicking on the OK button The result is the check that the IO and ID are authorized e the slave address is authorized if keyboard entry is used according to the ID code bank B slaves are only available if the ID code is equal to A If an error occurs an error message warns the user for example The slave cannot have this address and the screen is displayed again with the initial values in the profile or address depending on the error Note The software limits the number of analog slave declarations to 7 Note About the Schneider AS Interface catalog when you click Catalog you can create and configure
108. slaves I O format Function Block Format Simple Format Network I O format Step Counter Format Shift bit register format 240 TWD USE 10AE Operator Display Operation Input Output Format AS Interface slaves I O format The input output objects l Q IW and QW have three part addresses e g IX Y Z and are displayed as follows e Object type and controller address in the upper left e Expansion address in the upper center e I O channel in the upper right In the case of a simple input l and output Q the lower left portion of the display will contain a character that is either U for unforced or F for a forced bit The force value is displayed in the lower right of the screen The output object Q0 3 11 appears in the display area as follows Q 0 3 11 F 1 AS Interface slave I O objects IA QA IWA and QWA have four part addresses e g IAx y z and are displayed as follows e The object type in the upper left e AS Interface master address on the expansion bus in the upper left center e Address of the slave on the AS Interface bus in the upper right center e Slave I O channel in the upper right In the case of a simple input lA and output QA the lower left portion of the display will contain a character that is either U for unforced or F for a forced bit The force value is displayed in the lower right of the screen The output object QA1 3A 2 appears in the display ar
109. slaves in Private family other than those in the Schneider AS Interface catalog TWD USE 10AE 207 Installing the AS Interface bus AS Interface The Catalog button can be used to facilitate configuration of slaves on the bus Catalog When you use a slave from the Schneider family use this button to simplify and speed up configuration Clicking on Catalog in the window Configure an AS Interface slave opens the following window AS Interface Catalog Families of AS Interface profiles 6 Illuminated columns AS Interface Catalog Illuminated columns Profile AS Interface Name Comment 7 F F F XVBC21A std XVB illuminated column base 8 F F F XVA S102 std XVA illuminated column base Details OK Cancel 208 TWD USE 10AE Installing the AS Interface bus The drop down menu gives you access to all the families of the Schneider AS Interface catalog AS Interface Catalog Families of AS Interface profiles 5 Keyboards 5 Keyboards 6 Illuminated columns 7 Command and signaling 4 Motor starters 11 Inductive sensors 9 Phototronic sensors 1 Private family 18 Compact IP20 interfaces 12 Telefast IP20 interfaces Details OK Cancel When you have chosen your family the list of corresponding slaves appears Click on the required slave and validate
110. subroutine e Subroutine instructions are not permitted between parentheses and must not be placed between the instructions AND OR and a close parenthesis instruction yn e The label can only be placed before a LD or BLK instruction marking the start of a Boolean equation or rung e Calling the subroutine should not be followed by an assignment instruction This is because the subroutine may change the content of the boolean accumulator Therefore upon return it could have a different value than before the call See the following example Example of programming a subroutine L YAO O 10 0 SRO S 0 0 gt gt SRO 290 0 LD I0 0 ST Q0 0 SRO TWD USE 10AE 365 Basic Instructions 366 TWD USE 10AE Advanced Instructions 15 At a Glance Subject of this This chapter provides details about instructions and function blocks that are used to Chapter create advanced control programs for Twido programmable controllers What s in this This chapter contains the following sections Chapter Section Topic Page 15 1 Advanced Function Blocks 369 15 2 Clock Functions 413 15 3 PID Function 424 15 4 Floating point instructions 480 15 5 Instructions on Object Tables 491 TWD USE 10AE 367 Advanced Instructions 368 TWD USE 10AE Advanced Instructions 15 1 Advanced Function Blocks At a Glanc
111. than the Max value Min value or Max value can be internal words MW0 to MW2999 internal constants KWO to KW255 or a value between 32768 and 32767 Alarms Check this box if you wish to activate alarms on input variables Note The alarm values should be determined relative to the process variable obtained after the conversion phase They must therefore be between Min value and Max value when conversion is active Otherwise they will be between 0 and 10000 Low Specify the high alarm value in the Low field Output This value can be an internal word MWO0 to MW2999 an internal constant KWO to KW255 or a direct value Output must contain the address of the bit which will be set to 1 when the lower limit is reached Output can be either an internal bit MO to M255 or an output Qx 0 to Qx 32 High Specify the low alarm value in the High field Output This value can be an internal word MWO0 to MW2999 an internal constant KWO to KW255 or a direct value Output must contain the address of the bit which will be set to 1 when the upper limit is reached Output can be either an internal bit MO to M255 or an output Qx 0 to Qx 32 Diagram The diagram allows you to view the different possibilities available for configuring your PID 438 TWDUSE 10AE Advanced Instructions PID tab of PID function At a Glance The tab is used to enter the internal PID parameters Note It is accessible in offli
112. the Twido PLC Launch Auto Tuning Select the Animation tab from the PID configuration screen Wait till the auto tuning process ends oO oO N O Two cases may occur e Auto tuning completes successfully You may continue to Step 9 e Auto tuning fails This means the current guess for the sampling period Ts is not correct Try anew Ts guess and repeat steps 3 through 8 as many times as required until the auto tuning process eventually converges Follow these guidelines to provide a new Ts guess e AT ends with the error message The computed time constant is negative This means the sampling period Ts is too large You should decrease the value of Ts to provide as new guess e AT ends with the error message Sampling error This means the sampling period Ts is too small You should increase the value of Ts to provide as new guess 10 You may now view the PID control parameters Kp Ti and Td in Animation tab and adjust them in the PID tab of the PID configuration screen as needed Note If the PID regulation provided by this set of control parameters does not provide results that are totally satisfactory you may still refine the trial and error evaluation of the sampling period until you obtain the right set of Kp Ti and Td control parameters 466 TWD USE 10AE Advanced Instructions Adjusting PID Parameters Limitations on Using the Auto tuning and the PID Control To
113. the Twido controller RS 485 Port 1 e By TSXPCX cable e By telephone line Modem connection Moreover the TWDLCAE40DRF compact controller has a built in RU 45 Ethernet network connection port that can be used to communicate with the Ethernet capable PC running the TwidoSoft programming software There are two ways for the Ethernet capable PC to communicate with the TWDLCAE4ODRF Twido controller RJ 45 port e By direct cable connection via a UTP Cat5 RJ45 Ethernet crossover cable not recommended e By connection to the Ethernet network via a SFTP Cat5 RJ45 Ethernet cable available from the Schneider Electric catalog cable reference 490NTWO00e CAUTION EQUIPMENT DAMAGE TwidoSoft may not sense the disconnection when physically moving the TSXPCX1031 TSX PCX 3030 or Ethernet communication cable from a first controller and quickly inserting it in a second controller To avoid this condition use TwidoSoft to disconnect before moving the cable Failure to follow this precaution can result in injury or equipment damage TWD USE 10AE 89 Communications TSXPCX Cable Connection The EIA RS 232C or USB port on your personal computer is connected to the controller s Port 1 using the TSXPCX1031 or TSX PCX 3030 multi function communication cable This cable converts signals between EIA RS 232 and EIA RS 485 for the TSX PCX 1031 and between USB and EIA RS 485 for the TSX PCX 3030 This cable is equipped
114. the saved context to decide if a warm start can occur 70 TWD USE 10AE Controller Operating Modes Run Stop Input Bit Versus Auto Run Operation The Run Stop input bit has priority over the Automatic Start in Run option that is available from the Scan Mode dialog box If the Run Stop bit is set then the controller will restart in the Run Mode when power is restored The mode of the controller is determined as follows Run Stop Input Bit Auto Start in Run Resulting State Zero Zero Stop Zero One Stop Rising edge No effect Run One No effect Run Not configured in software Zero Stop Not configured in software One Run Note For all Compact type of controllers of software version V1 0 if the controller was in Run mode when power was interrupted and the Automatic Start in Run flag was not set from the Scan Mode dialog box the controller will restart in Stop mode when power is restored Otherwise will perform a cold restart Note For all Modular and Compact type of controllers of software version V1 11 if the battery in the controller is operating normally when power was interrupted the controller will startup in the mode that was in effect at the time the power was interrupted The Automatic Start in Run flag that was selected from the Scan Mode dialog will have no effect on the mode when the power is restored The table below describes the
115. transmissions or create ambiguity CAUTION Unexpected Equipment Operation Be sure that there is only one master controller on a remote link and that each slave has a unique address Failure to observe this precaution may lead to corrupted data or unexpected and ambiguous results Failure to follow this precaution can result in injury or equipment damage The master controller is configured using TwidoSoft to manage a remote link network of up to seven remote controllers These seven remote controllers can be configured either as remote I Os or as peer controllers The address of the master configured using TwidoSoft corresponds to address 0 To configure a controller as a Master Controller use TwidoSoft to configure port 1 or port 2 as remote links and select the address 0 Master Then from the Add remote controller window you can specify the slave controllers either as remote I O or as peer controllers as well as their addresses A remote controller is configured using TwidoSoft by setting port 1 or 2 as a remote link or by assigning the port an address from 1 to 7 The table below summarizes the differences and constraints of each of these types of remote controller configurations Type Application Program Data Access Remote I O No Not even a simple END statement RUN mode is coupled to the Master s l and Q Only the local I O of the controller is accessible and not
116. used to save a program and transfer that program to other Twido controllers Can be used to update the program in controller RAM Contains program and constants but no memory words 64K extended memory cartridge An optional external cartridge that stores a program up to 64K Must remain plugged into the controller as long as that program is being used 52 TWD USE 10AE User Memory Saving Memory Memory Configurations Your controllers program and memory words can be saved in the following e RAM for up to 30 days with good battery e EEPROM maximum of 32 KB Transferring the program from the EEPROM memory to the RAM memory is done automatically when the program is lost in RAM or if there is no battery Manual transfer can also be performed using TwidoSoft The following tables describe the types of memory configurations possible with Twido compact and modulare controllers Compact Controllers Memory Type 10DRF 16DRF 24DRF 40DRF 40DRF 32k 64k Internal RAM 10KB 10KB 10KB 10KB 10KB Mem 1 External RAM 16KB 32KB 32KB 64KB Mem 2 Internal EEPROM 8KB 16KB 32KB 32KB 32KB External EEPROM 32KB 32KB 32KB 32KB 64KB Maximum program size 8KB 16KB 32KB 32KB 64KB Maximum external backup 8KB 16KB 32KB 32KB 64KB Modular Controllers Memory Type 20DUK 20DRT 20DRT 20DTK 40DUK 40DUK 40DTK 32k 40DTK 64k Internal RAM 10KB 10KB 10KB Mem 1 E
117. valid e Bit 15 ready for execution e Setto 1 if ready for execution SW11 Software watchdog Contains the maximum value of the watchdog The value 10 to 500 U value ms is defined by the configuration 518 TWD USE 10AE System Bits and Words System Words Function Description Control SW17 Default status for floating operation When a fault is detected in a floating arithmetic operation bit S18 is set to 1 and the default status of SW17 is updated according to the following coding e Bit 0 Invalid operation result is not a number 1 NAN or 1 4 NAN e Bit 1 Reserved e Bit 2 Divided by 0 result is infinite 1 4INF or 1 INF e Bit 3 Result greater in absolute value than 3 402824e 38 result is infinite 1 INF or 1 INF S and U SW18 SW19 100 ms absolute timer counter The counter works using two words e SW18 represents the least significant word SW19 represents the most significant word S and U SW30 Last scan time Shows execution time of the last controller scan cycle in ms Note This time corresponds to the time elapsed between the start acquisition of inputs and the end update of outputs of a scan cycle SW31 Max scan time Shows execution time of the longest controller scan cycle since the last cold start in ms Notes e This time corresponds to the time elapsed between the s
118. value MDi tables KDi MDi L KDi L Floating word MFi L Immediate floating point value MFi tables KFi MFi L KFi L Note The abbreviation BLK x for example R3 1 is used to describe any function block word 346 TWD USE 10AE Basic Instructions Comparison Instructions Introduction Comparison instructions are used to compare two operands The following table lists the types of Comparison instructions Instruction Function gt Test if operand 1 is greater than operand 2 gt Test if operand 1 is greater than or equal to operand 2 lt Test if operand 1 is less than operand 2 lt Test if operand 1 is less than or equal to operand 2 Test if operand 1 is equal than operand 2 lt gt Test if operand 1 is different from operand 2 Structure The comparison is executed inside square brackets following instructions LD AND and OR The result is 1 when the comparison requested is true Examples of Comparison instructions Q0 3 MW 10 gt 100 r t MO0 Q0 2 MW20 lt K W35 i Q0 4 MF30 gt MF40 LD ST LD AND ST LD OR ST gt MW10 gt 100 Q0 3 MO MW20 lt KW35 QO0 2 I10 2 YMF30 gt MF40 Q0 4 TWD USE 10AE 347 Basic Instructions Syntax Syntax for Comparison instructions Operat
119. wire EIA RS 485 port with a miniDIN connector and a 3 wire EIA RS 485 port with a terminal Note This module is only available for the Modular controllers When the module is attached the controller cannot have a Communication expansion module Note You can only check the presence and configuration RS232 or RS485 of port 2 at power up or reset by the firmware executive program Nominal Cabling Nominal cable connections are illustrated below for both the EIA RS 232 and the EIA RS 485 types Note If port 1 is used on the Twido controller the DPT signal on pin 5 must be tied to OV on pin 7 This signifies to the Twido controller that the communications through port 1 is ASCII and is not the protocol used to communicate with the TwidoSoft software 120 TWD USE 10AE Communications Cable connections to each device are illustrated below Mini DIN connection RS 232 EIA cable Terminal block connection Twido Remote controller peripheral TXD RXD GND TXD RXD GND 3 4 7 RS 485 EIA cable Twido Remote Remote controller peripheral peripheral A B GND DPT A B GND A B GND Master controller Remote peripheral 2 7 5 l Remote peripheral A B _ OV A B _ OV A ai OV A B
120. 0 20005 252 Ladder Diagram Blocks 0 cece cette 254 Chapter 12 Chapter 13 Part IV Chapter 14 14 1 14 2 Ladder Language Graphic Elements 00 00 e eee eeeeeees 257 Special Ladder Instructions OPEN and SHORT 20 0005 260 Programming Advice 0 00 cect teens 261 Ladder List Reversibility 0 0 0 0 cece tee eee 265 Guidelines for Ladder List Reversibility 0 0 0 e eee eee eee 266 Program Documentation 0 00 e eect teens 268 Instruction List Language 0e ee ee eee 271 Ata Glance iai Le ne Se Bea ieee tis dette onlee aia 271 Overview of List Programs 0 0 0 0 cee cette ee 272 Operation of List Instructions 2 0 0 0 eee 274 List Language Instructions 0 0 cece ees 275 Using Parentheses s eves 2 ace Seis foe oe alle le alec aL lead a Sa ane 278 Stack Instructions MPS MRD MPP 2 e eee eens 280 Grafcet saai ie a i ede al te oa ails eat 283 At arGlanCe smerne Sack ite eed Sei ee OE eds 283 Description of Grafcet Instructions 00 0 cece ee ee 284 Description of Grafcet Program Structure 0 0 0 c eee eee ee 289 Actions Associated with Grafcet Steps 000 uraan eee eee 293 Description of Instructions and Functions 295 Atay Glance sts cece neta ek ve Al dee VG Ser we ee eS 295 Basic Instructions sc ie sie ciate a ele we ee ae Sees eee le 297 Ata Gla
121. 00 192 168 1 50 255 1500 192 168 1 16 255 1500 192 168 1 20 255 100 4 At this stage if you have just made changes to your Twido s Ethernet TCP IP configuration settings you may still decide to keep the changes or to discard them and restore the previous configuration as explained below e Select Tools gt Accept Changes from the TwidoSoft menu bar to keep the changes you have made to the TCP IP Ethernet configuration e Select Tools gt Cancel Changes to discard the changes and restore the previous TCP IP Ethernet configuration settings e Select Tools gt Edit to return to the Ethernet Configuration dialogbox and modify the TCP IP configuration settings e Select Tools gt Update PLC Program to upload the complete PLC configuration file into the Twido controller 172 TWD USE 10AE Communications Ethernet Connections Management Overview The following information describes how to configure add delete select a PC to controller Ethernet TPC IP connection Setting upa New To set up an Ethernet TCP IP connection between your PC running the TwidoSoft TCP IP application and a TWDLCAE4ODRF controller installed on your network follow Connection these instructions Step Action 1 Select File gt Preferences gt Connections Management from the TwidoSoft menu bar to call up the Connections Management dialogbox as shown below Connections management N
122. 021 LD X2 022 ST Q0 2 023 LD X3 X2 Q0 3 024 ST QO0 3 You can program the actions associated with steps within List instructions or Ladder rungs In this case the List instruction or Ladder rung is not scanned unless the step is active This is the most efficient readable and maintainable way to use Grafcet Example Se 3 Q0 5 020 3 021 LD 1 s 022 S Q0 5 023 LD M10 4 024 4 025 4 026 LD 1 027 R Q0 5 a 028 Q0 5 02 R TWD USE 10AE 293 Grafcet 294 TWD USE 10AE Description of Instructions and Functions IV At a Glance Subject of this This part provides detailed descriptions about basic and advanced instructions and Part system bits and words for Twido languages What s in this This part contains the following chapters Party Chapter Chapter Name Page 14 Basic Instructions 297 15 Advanced Instructions 367 16 System Bits and System Words 509 TWD USE 10AE 295 Instructions and Functions 296 TWD USE 10AE Basic Instructions 14 At a Glance Subject of this This chapter provides details about instructions and function blocks that are used to Chapter create basic control programs for Twido controllers What s in this This chapter contains the following sections Chapter Section Topic Page 14 1 Boolean Processing 299
123. 10AE 313 Basic Instructions NOT Instruction N Introduction The NOT N instruction negates the Boolean result of the preceding instruction Example The following is an example of using the NOT instruction LD I10 1 OR M2 ST Q0 2 N AND M3 ST Q0 3 Note The NOT instruction is not reversible Permitted Not applicable Operands 314 TWD USE 10AE Basic Instructions Timing Diagram The following diagram displays the timing for the NOT instruction NOT 10 1 M2 Q0 2 M3 Q0 3 TWD USE 10AE 315 Basic Instructions 14 2 Basic Function Blocks At a Glance Aim of this This section provides descriptions and programming guidelines for using basic Section function blocks What s in this This section contains the following topics Section Topic Page Basic Function Blocks 317 Standard function blocks programming principles 319 Timer Function Block TMi 321 TOF Type of Timer 323 TON Type of Timer 324 TP Type of Timer 325 Programming and Configuring Timers 326 Up Down Counter Function Block Ci 329 Programming and Configuring Counters 332 Shift Bit Register Function Block SBRi 334 Step Counter Function Block SCi 336 316 TWD USE 10AE Basic Instructions Basic Function Blocks Introduction Ex
124. 13 completed by the current image of the bus The profiles and parameters of the expected slaves displayed correspond to those which were expected The profiles and parameters of the unknown slaves displayed correspond to the images of those detected TWD USE 10AE 217 Installing the AS Interface bus Procedure for Before transferring a new application to the module the user can for each slave Transferring the accept the detected profile and parameters transferred to the configuration screen Definitive or modify the configuration manually See Procedure for Declaring and Application to Configuring a Slave p 205 the Module The following table describes the steps to follow to confirm and transfer the definitive configuration to the module Step Action 1 Via the software disconnect the PC from the module Note No modification can be carried out in the configuration screen if the PC is connected to the module Right click on the desired slave 2 choices Select Accept Conf to accept the detected profile of the selected slave Illustration Configuration AS interface V2 Configuration Std A Slaves B Slaves a 00 XVBC21A 01 02 03 ASI20MT4IE 04 05 OUT24 06 New Ctrl N WXA36 07 Open Ctrl O 08 Cut Ctri X Copy Ctrl C 2 Paste Ctrl V 0 Clear Suppr he Accept Conf Ctri A 12
125. 13 14 15 I Unknown l ly For each of the slaves marked with a cross a message will warn the user that this operation will overwrite the initial profile displayed on screen of the slave Select the other choices in the right click menu to configure the selected slave manually 218 TWD USE 10AE Installing the AS Interface bus Step Action 4 Repeat the operation for each of the desired slaves in the configuration 5 Press the OK button to confirm and create the new application Result Automatic return to the main screen 6 Transfer the application to the module TWD USE 10AE 219 Installing the AS Interface bus Automatic addressing of an AS Interface V2 slave At a Glance Each slave on the AS Interface bus must be assigned via configuration a unique physical address This must be the same as the one declared in TwidoSoft TwidoSoft software offers an automatic slave addressing utility so that an AS Interface console does not have to be used The automatic addressing utility is used for e replacing a faulty slave e inserting a new slave Procedure The table below shows the procedure for setting the Automatic addressing parameter Step Action 1 Access the AS Interface V2 master module s configuration screen 2 Click on the Automatic addressing check box found in the Master mode zone
126. 15 e 2 Firs E gPhase 1 pPhas Phase 3 Phase 4 Second JJ tabilization iStep Response Relaxation tep Response Setpoint Measure To Cancel Previous Next Help The autotuning phases are described in the following table AT Phase Description 1 Phase 1 is the stabilization phase It starts at the time the user launches the AT process During this phase the Twido autotuning performs checks to ensure that the process variable is in steady state Note The output last applied to the process before start of the autotuning is used as both the starting point and the relaxation point for the autotuning process Phase 2 applies the fist step change to the process It produces a process step response similar to the one shown in the above figure TWD USE 10AE 457 Advanced Instructions AT Phase Description 3 Phase 3 is the relaxation phase that starts when the first step response has stabilized Note Relaxation occurs toward equilibrium that is determined as the output last applied to the process before start of the autotuning 4 Phase 4 applies the second step change to the process in the same amount and manner as in Phase 2 described above The autotuning process ends and the AT parameters are computed and stored in their respective memory words upon completion of Phase 4 Note After this phase is complete the process variable is restored to the output level last appl
127. 168 1 xxx P addresses where 192 168 1 is the network ID and xxx 0 255 is the host ID than you may specify 191 168 1 198 as a valid IP address for your PC Make sure the host ID 198 is unique over the network 6 Enter a valid Subnet Mask in dotted decimal notation If subnetting is not used on your Class C network we suggest you to specify a Class C network default subnet mask such as 255 255 255 0 TWD USE 10AE 151 Communications Configuring the TCP IP Settings of your Twido Controller Once you have configured the TCP IP settings of your PC hosting the TwidoSoft application you will need to configure the TCP P settings of the Twido controller you wish TwidoSoft to communicate with over the network as described below Step Action 1 Connect a serial cable TSXPCX1031 from the PC running TwidoSoft to the Twido controller s RS 485 console port Launch the TwidoSoft application program on your PC Select a new Hardware from the TwisoSoft Application Brower and choose the TWDLCAE4ODRF controller Select PLC gt Select a connection from the TwidoSoft menu bar and choose the COM1 port Double click on the Ethernet Port icon in the TwisoSoft Application Browser or select Hardware gt Ethernet from the menu bar to call up the Ethernet Configuration dialog box as shown below Ethernet Configuration IP Address Configure Marked IP Idle Checking Remote Devic
128. 340 TWD USE 10AE Basic Instructions Introduction to Numerical Instructions At a Glance Numerical instructions generally apply to 16 bit words see Word Objects p 29 and to 32 bit double words See Floating point and double word objects p 32 They are written between square brackets If the result of the preceding logical operation was true Boolean accumulator 1 the numerical instruction is executed If the result of the preceding logical operation was false Boolean accumulator 0 the numerical instruction is not executed and the operand remains unchanged TWD USE 10AE 341 Basic Instructions Assignment Instructions Introduction Assignment Assignment of Assignment instructions are used to load operand Op2 into operand Op1 Syntax for Assignment instructions Op1 Op2 lt gt Assignment operations can be performed on Bit strings Words Double words Floating word Word tables Double word tables Floating word tables Op2 gt Op1 Operations can be performed on the following bit strings see Structured Objects Bit Strings p 45 e Bit string gt bit string Example 1 e Bit string gt word Example 2 or double word indexed e Word or double word indexed gt bit string Example 3 e Immediate value gt bit string Examples Examples of bit string assignments LD 1 Q0 8 M64 8
129. 39 Communications After downloading and setting each controller to run open an animation table on the master Examine the response section of the table to check that the response code is 3 and that the correct number of bytes was read Also in this example note that the words read from the slave beginning at MW7 are aligned correctly with the word boundaries in the master Modbus Link The diagram below illustrates the use of Modbus request 16 to write output words to Example 2 a slave This example uses two Twido Controllers Step 1 Configure the Hardware 1 Controller RS 485 EIA Port 1 To serial COM 1 Modbus master RS 485EIAPort2 TSXPCX1031 p 2 1 3 0 2 Controller RS 485 EIA Port 1 Modbus slave RS 485 EIA Port 2 The hardware configuration is identical to the previous example Step 2 Connect the Modbus Communications Cable RS 485 Mini DIN connection Twido Twido Modbus Master Modbus Slave A B OV A B GND T 2 _ ee cee eee Terminal block connection Twido Twido Modbus Master Modbus Slave A B _ OV A T OV A B SG The Modbus communications cabling is identical to the previous example 140 TWD USE 10AE Communications Step 3 Port Configuration Hardware gt Ad
130. 6 TWD USE 10AE Glossary Prefix that identifies internal memory addresses in the controller that are used to store the value of program variables constants I O and so on A Addresses Analog potentiometer Analyze program Animation table Internal registers in the controller used to store values for program variables constants I O and so on Addresses are identified with a percentage symbol prefix For example l0 1 specifies an address within the controller RAM memory containing the value for input channel 1 An applied voltage that can be adjusted and converted into a digital value for use by an application A command that compiles a program and checks for program errors syntax and structure errors symbols without corresponding addresses resources used by the program that are not available and if the program does not fit in available controller memory Errors are displayed in the Program Errors Viewer Table created within a language editor or an operating screen When a PC is connected to the controller provides a view of controller variables and allows values to be forced when debugging Can be saved as a separate file with an extension of tat TWD USE 10AE 527 Glossary Animation Tables Editor Application Application browser Application file ASCII Auto line validate A specialized window in the TwidoSoft application for viewing and creating Animation Tables
131. AE Communications Cable Connection to Each Device Note You can only check the presence and configuration RS232 or RS485 of port 2 at power up or reset by the firmware executive program Note The DPT signal on pin 5 must be tied to OV on pin 7 in order to signify the use of remote link communications When this signal is not tied to ground the Twido controller as either the master or slave will default to a mode of attempting to establish communications with TwidoSoft Note The DPT to OV connection is only necessary if you are connected to a base controller on Port 1 The cable connections made to each remote device are shown below Mini DIN connection Master Remote Remote controller controller controller A B OV DPT A B OV DPT A B OV DPT 1 2 7 5 Terminal block connection Master Remote Remote controller controller controller A B _ OV A B _ OV A a OV A B SG TWD USE 10AE 107 Communications Software Configuration Master Controller Configuration Remote Controller Configuration There must be only one master controller defined on the remote link In addition each remote controller must maintain a unique slave address Multiple masters or slaves using identical addresses can either corrupt
132. AE Communications Configuring the To configure the Marked IP tab follow these steps Marked IP tab Step Action 1 Check the box labeled Specify a marked IP address to enable the Marked IP function Note that Marked IP is disabled as default Result The IP address box becomes active in the right portion of the frame as shown in the previous figure 2 Enter the IP address of the client host you wish to mark the IP in the provided IP address box Note There is no default value in this field You must provide the IP address of the marked device or otherwise uncheck the Specify a marked IP address box to disable this function TWD USE 10AE 167 Communications Idle Checking Tab Overview Definition of Idle Checking Idle Checking tab The following information describes how to configure the Idle Checking tab of the Ethernet Configuration dialogbox Note The Idle Checking of the Twido controller can be configured when the TwidoSoft application program is in offline mode only Idle Checking applies an idle timeout to all current Ethernet TCP connections of the Twido controller The idle timeout is the amount of time that any of the four Ethernet TCP connection channels may remain idle before the remote client host connection to this channel is dropped Note The idle timer is reset whenever there is data traffic on the monitored connection channel The following fig
133. AS Interface syntax IA for example Illustration Reminder of the principles of addressing IA QA IWA QWA x n Symbol Type of object Expansion slave Channel module address no address Specific Values The table below gives specific values to AS Interface V2 slave objects Part Values Comment IA Image of the physical digital input of the slave QA Image of the physical digital output of the slave IWA Image of the physical analog input of the slave QWA Image of the physical analog output of the slave x 1to7 Address of AS Interface module on the expansion bus n OA to 31B Slot 0 cannot be configured i 0to3 TWD USE 10AE 223 Installing the AS Interface bus Examples The table below shows some examples of I O addressing O object Description IWA4 1A 0 Analog input 0 of slave 1A of the AS Interface module situated in position 4 on the expansion bus QA2 5B 1 Digital output 1 of slave 5B of the AS Interface module situated in position 2 on the expansion bus IAI 12A 2 Digital input 2 of slave 12A of the AS Interface module situated in position 1 on the expansion bus Implicit The objects described below are exchanged implicitly in other words they are Exchanges exchanged automatically on each PLC cycle 224 TWD USE 10AE Installing the AS Interface bus Programming and diagnostics for the AS Interface V2 bus Explicit Exchanges Reserved Specific System
134. Advanced Instructions Parameters The Counter function block has the following parameters Parameter Label Value Register number Ri 0 to 3 Type FIFO or Queue or Stack LIFO Input word Ri Register input word Can be read tested and written Output word Ri O Register output word Can be read tested and written Storage Input or I In On a rising edge stores the contents of word Ri in instruction the register Retrieval Input or O Out On a rising edge loads a data word of the register into instruction word Ri O Reset input or R Reset At state 1 initializes the register instruction Empty Output E Empty The associated bit Ri E indicates that the register is empty Can be tested Full Output F Full The associated bit Ri F indicates that the register is full Can be tested TWD USE 10AE 375 Advanced Instructions LIFO Operation Introduction In LIFO operation Last In First Out the last data item entered is the first to be retrieved Operation The following table describes LIFO operation Step Description Example 1 When a storage request is Storage of the contents of Ri received rising edge at input at the top of the stack or activation of instruction 1 the contents of input word Ri I 20 which has already been y loaded are stored at the top of Ri the stack Fig a
135. CHx instruction before a second can be launched The MSGx function block must be used when sending several messages TWD USE 10AE 123 Communications MSGx Function Block The processing of the EXCHx list instruction occurs immediately with any transmissions started under interrupt control reception of data is also under interrupt control which is considered background processing The use of the MSGx function block is optional it can be used to manage data exchanges The MSGx function block has three purposes Communications error checking The error checking verifies that the parameter L length of the Word table programmed with the EXCHx instruction is large enough to contain the length of the message to be sent This is compared with the length programmed in the least significant byte of the first word of the word table Coordination of multiple messages To ensure the coordination when sending multiple messages the MSGx function block provides the information required to determine when transmission of a previous message is complete Transmission of priority messages The MSGx function block allows current message transmissions to be stopped in order to allow the immediate sending of an urgent message The MSGx function block has one input and two outputs associated with it Input Output Definition Description R Reset input Set to 1 re initializes communication or resets block YMSGx E 0 and
136. D USE 10AE Instruction List Language Name Equivalent Function graphic element JMP Connect unconditionally to a labeled sequence upstream gt gt Li or downstream SRn Connection at the beginning of a subroutine gt gt HSRi RET Return from a subroutine lt RET gt END End of program lt END gt ENDC End of the conditioned program at a Boolean result of 1 lt ENDC gt ENDCN End of the conditioned program at a Boolean result of 0 lt ENDCN gt Function Block The following table describes function blocks in List language Instructions Name Equivalent Function graphic element Timers counters registers and so on For each of the function blocks there are 4 instructions for controlling the block A structured form is used to hardwire the block inputs and outputs directly Note Outputs of function blocks can not be connected to each other vertical shorts TWD USE 10AE 277 Instruction List Language Using Parentheses Introduction Example Using an AND Instruction Example Using an OR Instruction In AND and OR logical instructions parentheses are use to specify divergences in Ladder Editors Parentheses are associated with instructions as follows e Opening the parentheses is associated with the AND or OR instruction e Closing the parentheses is an instruction which is required for each open p
137. DCD RX TX DTR SG NC RTS CTS OoN ONAN NC TWD USE 10AE 91 Communications Telephone Line Connection A modem See Communication between TwidoSoft and a Modem p 95 connection enables programming of and communication with the controller using a telephone line The modem associated with the controller is a receiving modem connected to port 1 of the controller The modem associated with the PC can be internal or external and connected to a COM serial port This connection is illustrated in the diagram below PC Serial Port EIA RS 232 External Modem modem Telephone line TSXPCX1031 position 2 SUB D female with Tx Rx inversion connector Note Only one modem can be connected to port 1 of the controller Note Caution Remember to install the software provided with the modem as TwidoSoft only takes into account the installed modems 92 TWD USE 10AE Communications Ethernet Network A Note Although direct cable connection using a Ethernet crossover cable is Connection supported between the Twido TWDLCAE40DRF and the PC running the TwidoSoft programming software we do not recommend it Therefore you should always favor a connection via a network Ethernet hub switch The following figure shows a PC to Twido connection vi
138. DNAC232D 2 Communication adapter equipped with a 3 wire EIA RS 232 port with a miniDIN connector Note This adapter is only available for the Compact 16 24 and 40 I O controllers and the Operator Display expansion module TWD USE 10AE 129 Communications Remote Port Specifications TWDNAC485D 2 Communication adapter equipped with a 3 wire EIA RS 485 port with a miniDIN connector Note This adapter is only available for the Compact 16 24 and 40 I O controllers and the Operator Display expansion module TWDNAC485T 2 Communication adapter equipped with a 3 wire EIA RS 485 port with a terminal connector Note This adapter is only available for the Compact 16 24 and 40 I O controllers and the Operator Display expansion module TWDXCPODM 2 Operator Display expansion module equipped with a 3 wire EIA RS 232 port with a miniDIN connector a 3 wire EIA RS 485 port with a miniDIN connector and a 3 wire EIA RS 485 port with a terminal Note This module is only available for the Modular controllers When the module is attached the controller cannot have a Communication expansion module Note The presence and configuration RS232 or RS485 of Port 2 is checked at power up or at reset by the firmware executive program Nominal Cabling Nominal cable connections are illustrated below for both the EIA RS 232 and the EIA RS 485 types Note If port 1 is used on the Twi
139. E 45 Twido Language Objects Available Types Available types of bits for bit strings of Bits Type Address Maximum size Write access Discrete input bits l0 0 L or 11 0 L 1 O lt L lt 17 No Discrete output bits Q0 0 L or Q1 0 L 1 O lt L lt 17 Yes System bits Si L 0 lt L lt 17 and i L lt 128 Depending on i with i multiple of 8 Grafcet Step bits Xi L 0 lt L lt 17 and i L lt 95 Yes by program with i multiple of 8 2 Internal bits Mi L O lt L lt 17 and i L lt 256 Yes with i multiple of 8 3 Key 1 Only I O bits 0 to 16 can be read in bit string For controllers with 24 inputs and 32 I O modules bits over 16 cannot be read in bit string 2 Maximum of i L for TWWDLCAA10DRF and TWDLCAA16DRPRF is 62 3 Maximum of i L for TWWDLCAA10DRF and TWDLCAA16DPRF is 128 Tables of words L Example Word table KW10 7 KW10 16 bits KW16 Word tables are a series of adjacent words of the same type and of a defined length Word tables can be used with the Assignment instruction see Assignment Instructions p 342 Available Types Available types of words for word tables of Words Type Address Maximum size Write access Internal words MWi L 0 lt L lt 256 and i L lt 3000 Yes Constant words KWi L 0 lt L lt 256 and i L lt 256 No System Words SWi L O lt L and i L lt 128 Depending on i 46
140. E ACTION Analog output PID controller Operation mode ae Integral PERIOD Ti jj dt HIGH umri SETPOINT m NUMERICAL i KP is corr Digital e b OUTPUT Lmrrer gt OUTPUT f VARIABLE Output Q AT SETPOINT A TD d LOW LIMIT Operation mode dt ne CONVERSION Auto manual Autotuning algorithm External MANUAL measurement ALARM OUTPUT LOW ALARM HIGH Kiz f SAMPLING PERIOD TWD USE 10AE 443 Advanced Instructions AT Tab ofthe PID The screen below is used to enable disable the AT function and enter the AT function parameters Note It is accessible in offline mode only PID EAEI PID number o General Input PID AT Output Animation Trace r AT mode Process Variable PV Limit AT Output Setpoint M Authorize m PID Output PID controller J Cancel Previous Next Help 444 TWD USE 10AE Advanced Instructions Description WARNING The Process Variable PV Limit and the Output Setpoint values must be set carefully PID Auto Tuning is an open loop process that is acting directly on the control process without regulation or any limitation other than provided by the Process Variable PV Li
141. E 10AE 249 Ladder Language Introduction to Ladder Diagrams Introduction Ladder Equivalents to Relay Circuits Ladder diagrams are similar to relay logic diagrams that represent relay control circuits The main differences between the two are the following features of Ladder programming that are not found in relay logic diagrams e All inputs are represented by contact symbols 41F e All outputs are represented by coil symbols e Numerical operations are included in the graphical Ladder instruction set The following illustration shows a simplified wiring diagram of a relay logic circuit and the equivalent Ladder diagram LS1 PBI CRI M1 LS1 PB1 CR1 M1 10 0 I0 2 10 4 Q0 4 4 4a I 4 O E LS2 SSI LS2 SS1 I0 1 10 7 a o Relay logic circuit Ladder diagram Notice that in the above illustration all inputs associated with a switching device in the relay logic diagram are shown as contacts in the Ladder diagram The M1 output coil in the relay logic diagram is represented with an output coil symbol in the Ladder diagram The address numbers appearing above each contact coil symbol in the Ladder diagram are references to the locations of the external input output connections to the controller 250 TWD USE 10AE Ladder Language Ladder Rungs Example of Ladder Rungs A program written in Ladder language is composed of ru
142. E aerate shade EEN 83 Communications 000 cece eee eee eee 85 At a GlanCe araa na p n ek OA ete a S E a a a eet a ete 85 Presentation of the different types of communication sasssa uaaa aaau 87 TwidoSoft to Controller communications aaea aeaaaee 89 Communication between TwidoSoft and a Modem 000ee eee 95 Remote Link Communications 00 00 0 cece tees 105 ASCII Communications 0 000 eee eee 119 Modbus Communications 0 000 cee teens 129 Standard Modbus Requests 0 0 c cece eee teens 143 Ethernet TCP IP Communications Overview 0 00e eee eee eee 149 Quick TCP IP Setup Guide for PC to Controller Ethernet Communication 150 Connecting your Controller to the Network 00 cece eee eee 155 IP ACCrESSING ce ait are ee ted ee ay Sela alee aban was She 8 Sat aetie eles ofan acs 156 Assigning IP Addresses 0 0 e eee 158 TCP IP SCtup ses itech bk ane Seta te wed la Gee we ee de Ae ee 162 IP Address Configure Tab nananana aanne ee ee 164 Marked IP Tabs merter tonn neea Goon a A E he 4G E DEVE he 166 Idle Ghecking Tab dinat este Bi E cb E E ce A Oe EE 168 Remote Devices Tab 1 2 20 0c cece eee 170 Viewing the Ethernet Configuration 1 0 0 0 0 0 c eee ee eee 172 Ethernet Connections Management 0 0 eee e eee 173 Ethernet LED Indicators 0 0 0 c eects 175 TCP Modbus Messaging 0 ccc eee eect t
143. Effect of warm restart Has no effect S1 1 Effect of modifying the preset Takes effect immediately PLSi P Effect due to the fact that Forcing output Q0 0 0 or Q0 0 1 using a programming outputs are dedicated to the device does not stop the signal generation PLS block Note PLSx D is set when the number of desired pulses has been reached It is reset by either setting the IN or the R inputs to 1 386 TWD USE 10AE Advanced Instructions Drum Controller Function Block DR Introduction The drum controller operates on a principle similar to an electromechanical drum controller which changes step according to external events On each step the high point of a cam gives a command which is executed by the controller In the case of a drum controller these high points are symbolized by state 1 for each step and are assigned to output bits Qi j or internal bits Mi known as control bits Illustration The following is an illustration of the drum controller function block DRi R FL U STEPS 8 Drum controller function block TWD USE 10AE 387 Advanced Instructions Parameters The drum controller function block has the following parameters Parameter Label Value Number DRi 0 to 3 Compact Controller0 to 7 Modular Controllers Current step number DRI S 0 lt DRi S lt 7 Word which can be read and wr
144. FFF for example 16 A536 Alternate syntax A536 TWD USE 10AE 29 Twido Language Objects Descriptions of Word Objects The following table describes the word objects Words Description Address or value Maximum number Write access 1 Immediate values These are integer values that are in the same format as the 16 bit words which enables values to be assigned to these words Base 10 32768 to 32767 Base 16 16 0000 to 16 FFFF No Internal Memory Used as working words to store values during operation in data memory Words MWO to MW255 are read or written directly by the program MWi 3000 Yes Constants Store constants or alphanumeric messages Their content can only be written or modified by using TwidoSoft during configuration Constant words KWO through KW63 are read only by the program KWi 256 Yes only by using TwidoSoft System These 16 bit words have several functions e Provide access to data coming directly from the controller by reading SWi words e Perform operations on the application for example adjusting schedule blocks SWi 128 According toi Function blocks These words correspond to current parameters or values of function blocks TM2 P Ci P etc Yes Network exchange words Assigned to controllers connected as Remote Links These words are used for commun
145. G ONLY CONTAINS A HEADER TITLE 7 LD QO 8 OR 0 5 3 9 ORR I0 13 10 ST Q0 5 When List instructions are reversed to a Ladder diagram List Line Comments are displayed in the Ladder Editor according to the following rules e The first comment that is on a line by itself is assigned as the rung header e Any comments found after the first become the body of the rung e Once the body lines of the header are occupied then the rest of the line comments between List sequences are ignored as are any comments that are found on list li nes that also contain list instructions 268 TWD USE 10AE Ladder Language Example of Rung Header Comments Reversing Ladder Comments to List The following is an example of a Ladder program with rung header comments RUNG 0 THIS IS THE TITLE OF THE HEADER FOR RUNG 0 THIS IS THE FIRST HEADER COMMENT FOR RUNG 0 R rrr le ee Pag 10 0 M10 M101 Vi T Eora a 4 l0 1 qo Gee oE 4 RUNG 1 THIS IS THE HEADER FILE FOR RUNG 1 L5 THIS RUNG CONTAINS A LABEL 4 A M20 WKW2 16 M101 i F F F F F RUNG 2 THIS RUNG CONTAINS ONLY A HEADER FILE Q0 5 o O SE Si Q0 5 1 as aie ae at 10 3 H mo PE ce o a 4 When a Ladder diagram is reversed to List instructions rung header comments are displayed in the List Editor according to the following rules Any rung hea
146. Hz in single word or double word computational mode Because the Fast Counters are managed by specific hardware interrupts maintaining maximum frequency sampling rates may vary depending on your specific application and hardware configuration The TWDLCA 40DRF Compact controllers can accomodate up to four fast counters while all other series of Compact controllers can be configured to use a maximum of three fast counters Modular controllers can only use a maximum of two The Fast Counter function blocks FC0 FC1 FC2 and FC3 use dedicated inputs 10 0 2 l0 0 3 l0 0 4 and l0 0 5 respectively These bits are not reserved for their exclusive use Their allocation must be considered with the use of other function blocks for these dedicated resources The following is an example of a Fast Counter function block in single word mode FCO IN D TYPE UP SINGLE ADJ FC0 P R TWD USE 10AE 393 Advanced Instructions Parameters The following table lists parameters for the Fast Counter function block Parameter Label Description Function TYPE Set at configuration this can be set to either up count or down count Preset value FCi P FCi PD Initial value may be set gt between 1 and 65635 in standard mode gt between 1 and 4294967295 in double word mode Adjustable Y N If set to Y it is possible to modify the preset value FCi P or FCi
147. I SWi PIWAI QW PQWAI SWi BLK x Double word MDi MDi KDi The BTI instruction is used to process a setpoint value at controller inputs via BCD encoded thumb wheels The ITB instruction is used to display numerical values for example the result of a calculation the current value of a function block on BCD coded displays TWD USE 10AE 357 Basic Instructions Single double word conversion instructions Introduction The following table describes instructions used to perform conversions between single and double words Instruction Function LW LSB of double word extracted to a word HW MSB of double word extracted to a word CONCATW Concatenates two words into a double word DWORD Converts a 16 bit word into a 32 bit double word Structure Conversion operations are performed as follows MO MW0 HW MD10 LD MO0 MWO0 HW MD10 I10 2 LD lI0 2 MD10 DWORD KW9 MD10 DWORD KW9 10 3 MD11 CONCATW MW10 MW H LP 10 3 Y MD11 CONCATW MW10 MWS Syntax The syntax depends on the operators used as shown in the following table Operator Syntax Operand 1 Operand2 Operand 3 Op1 Op2 Op3 LW HW Op1 Operator Op2 MWi MDi KDi CONCATW Op1 Operator Op2 Op3 MDi MWi MWi KWi KWi immediate immediate value value DW
148. Identification ige aa s Cele Key Address Item Description 1 I O data Images of 248 inputs and 186 outputs of AS Interface IDI ODI V2 bus 2 Current parameters Image of the parameters of all the slaves PI PP 3 Configuration This field contains all the I O codes and the Identification identification codes for all the slaves detected CDI PCD LDS List of all slaves detected on the bus LAS List of slaves activated on the bus LPS List of slaves provided on the bus and configured via TwidoSoft 7 LPF List of slaves having a device fault 198 TWD USE 10AE Installing the AS Interface bus Structure of The standard address slaves each have Slave Devices e 4 input output bits e 4parametering bits The slaves with extended addresses each have e 4 input output bits the last bit is reserved for entry only e 3 parametering bits Each slave has its own address profile and sub profile defines variables exchange The figure below shows the structure of an extended address slave AS Interface slave Input Bit Onl LL py P A 1 I O data C DO 2 Parameters m P2 O PO Configuration 3 Aa Identification AS Interface bus a 4 4 Address Key Address Item Description 1 Input output Input data is stored by the slave and made available for the AS data Interface master Output data is updated by the master module 2 Parameters
149. It can be used to display and modify parameters in offline mode Illustration of Illustration of the configuration screen in offline mode Offline Mode Configure Module TWDNOI10M3 Position 1 Description Configuration Master AS Interface expansion module AS interface configuration Slave 1A Std A Slaves IB Slaves Characteristics 00 wy Profile IO 7 ID f ID1 f ID2 f XVBC21A 01 Comment XVB illuminated column base 02 03 ASIZOMTAIE puns 04 Bits C Decimal cay NOUT2 2 0 Binke 2 Binkes 06 1 wv Blink e2 3 vw Blinke4 WXA36 07 M 08 Inputs Outputs 09 Inputs Number Outputs Number 10 1 lA1 1A 0 1 QA1 1A 0 11 2 IA1 1A 1 2 QA1 1A 1 12 13 Master mode 14 _ Set data exchange active 15 Network down 16 x 7 Automatic addressing Cancel Help 202 TWD USE 10AE Installing the AS Interface bus Description of the Screen in Offline Mode This screen groups all data making up the bus in three blocks of information Blocks Description AS interface configuration Bus image desired by the user view of standard and extended address setting slaves expected on the bus Move the cursor down the vertical bar to access the following addresses Grayed out address
150. LD 10 3 010 ANDN I0 2 O11 3 TE 012 2 013 LD 10 4 10 4 1 014 1 015 3 016 LD 05 017 1 3 I10 5 1 Sequential processing ends with the execution of the POST instruction or with the end of the program TWD USE 10AE 291 Grafcet Post Processing Post processing consists of the following e Commands from the sequential processing for controlling the outputs e Safety interlocks specific to the outputs Example POST X1 Q0 1 018 POST 019 LD X1 020 ST Q0 1 ies 00 2 021 LD X2 022 ST Q0 2 023 LD X3 024 OR MI X3 pe 025 ANDN I0 2 026 AND 0 7 027 M1 10 2 10 7 028 ST Q0 3 i 292 TWD USE 10AE Grafcet Actions Associated with Grafcet Steps Introduction Associating Actions in Post Processing Associating Actions from an Application A TwidoSoft Grafcet program offers two ways to program the actions associated with steps e Inthe post processing section e Within List instructions or Ladder rungs of the steps themselves If there are security or running mode constraints it is preferable to program actions in the post processing section of a Grafcet application You can use Set and Reset List instructions or energize coils in a Ladder program to activate Grafcet steps Xi Example meet As 018 POST 019 LD X1 020 ST QO0 1 X2 Q0 2
151. Language Objects Addressing Inputs Outputs Introduction Multiple References to an Output or Coil Format Each input output I O point in a Twido configuration has a unique address For example the address 10 0 4 is assigned to input 4 of a controller I O addresses can be assigned for the following hardware e Controller configured as Remote Link Master e Controller configured as Remote I O e Expansion I O modules The TWDNOI10M83 AS Interface bus interface module has a special address system for the I Os of its slave devices See Addressing I Os associated with slave devices connected to the AS Interface V2 bus p 223 In a program you can have multiple references to a single output or coil Only the result of the last one solved is updated on the hardware outputs For example Q0 0 0 can be used more than once in a program and there will not be a warning for multiple occurrences So it is important to confirm only the equation that will give the required status of the output CAUTION Unintended Operation No duplicate output checking or warnings are provided Review the use of the outputs or coils before making changes to them in your application Failure to follow this precaution can result in injury or equipment damage Use the following format to address inputs outputs 1 Q x a Symbol Object type Controller point I O type point Channel number position Use the
152. ORD Op1 Operator Op2 MDi MWi KWi 358 TWD USE 10AE Basic Instructions 14 4 Program Instructions At a Glance Aim of this This section provides an introduction to Program Instructions Section What s in this This section contains the following topics ion Section Topic Page END Instructions 360 NOP Instruction 362 Jump Instructions 363 Subroutine Instructions 364 TWD USE 10AE 359 Basic Instructions END Instructions Introduction END ENDC and ENDCN The End instructions define the end of the execution of a program scan Three different end instructions are available e END unconditional end of program e ENDC end of program if Boolean result of preceding test instruction is 1 e ENDCN end of program if Boolean result of preceding test instruction is 0 By default normal mode when the end of program is activated the outputs are updated and the next scan is started If scanning is periodic when the end of period is reached the outputs are updated and the next scan is started 360 TWD USE 10AE Basic Instructions Examples Example of an unconditional END instruction M1 QO 1 LD M1 ST Q0 1 LD M2 ST Q0 2 M2 QO 2 Y7 END END Example of a conditional END instruction LD M1 ST Q0 1 LD M2 ST Q0 2 LD 10 2 ENDC If 10 2 1 end of
153. Program Documentation p 268 TWD USE 10AE 253 Ladder Language Ladder Diagram Blocks Introduction Contacts Coils and Program Flow Ladder diagrams consist of blocks representing program flow and functions such as the following Contacts Coils Program flow instructions Function blocks Comparison blocks Operate blocks Contacts coils and program flow jump and call instructions occupy a single cell of the ladder programming grid Function blocks comparison blocks and operate blocks occupy multiple cells The following are examples of a contact and a coil ac 1 1 1 1 1 aden aden aden 4 Contact Coil 254 TWD USE 10AE Ladder Language Function Blocks Function blocks are placed in the test zone of the programming grid The block must appear in the first row no ladder instructions or lines of continuity may appear above or below the function block Ladder test instructions lead to the function block s input side and test instructions and or action instructions lead from the block s output side Function blocks are vertically oriented and occupy two columns by four rows of the programming grid The following is an example of a counter function block y7 E y CO R E h Sis H i t S ADJY D _4 ar H C0 P 9999 f is H u i ro sms CD 5 i aaa F7 r mane EA
154. SE 10AE 441 Advanced Instructions AT tab of PID function At a Glance AT Requirements The setting of correct PID parameters may be tedious time consuming and error prone All these make process control difficult to setup for the yet experienced but not necessarily process control professional user Thus optimum tuning may sometimes be difficult to achieve The PID Auto Tuning algorithm is designed to determine autmatically and adequately the following four PID terms e Gain factor e Integral value e Derivative value and e Direct or Reverse action Thus the AT function can provide rapid and optimum tuning for the process loop PID Auto tuning is particularly suited for temperature control processes In a general manner the processes that the AT function can be used to control must meet the following requirements e the process is mostly linear over the entire operating range e the process response to a level change of the analog output follows a transient asymptotic pattern and e there is little disturbance in process variables In the case of a temperature control process this implies there is no abnormally high rate of heat exchange between the process and its environment 442 TWD USE 10AE Advanced Instructions AT Operating The following diagram describes the operating principle of the AT function and how Principle it interacts with the PID loops SAMPLING PERIOD DIRECT REVERS
155. SG Software Configuration To configure the controller to use a serial connection to send and receive characters using the ASCII protocol you must Step Description 1 Configure the serial port for ASCII using TwidoSoft 2 Create in your application a transmission reception table that will be used by the EXCHx instruction TWD USE 10AE 121 Communications Configuring the Port Configuring the Transmission Reception table for ASCII mode Control table Transmission reception tables A Twido controller can use its primary port 1 or an optionally configured port 2 to use the ASCII protocol To configure a serial port for ASCII Step Action 1 Define any additional communication adapters or modules configured to the base 2 Right click on the port and click Edit Controller Comm Setup and change serial port type to ASCII 3 Set the associated communication parameters The maximum size of the transmitted and or received frames is 256 bytes The word table associated with the EXCH x instruction is composed of the transmission and reception control tables Most significant byte Least significant byte Control table Command Length transmission reception Reserved 0 Reserved 0 Transmission table Transmitted Byte 1 Transmitted Byte 2 Transmitted Byte n Transmitted Byte n 1 Reception table Received Byte 1 Received Byte 2
156. SW8O Base I O Status Bit 0 Channels in normal operation for all its channels Bit 1 Module under initialization or of initializing information of all channels Bit 2 Hardware failure external power supply failure common to all channels Bit 3 Module configuration fault Bit 4 Converting data input channel 0 in progress Bit 5 Converting data input channel 1 in progress Bit 6 Input thermocouple channel 0 not configured Bit 7 Input thermocouple channel 1 not configured Bit 8 Not used Bit 9 Unused Bit 10 Analog input data channel 0 over range Bit 11 Analog input data channel 1 over range Bit 12 Incorrect wiring analog input data channel 0 below current range current loop open Bit 13 Incorrect wiring analog input data channel 1 below current range current loop open Bit 14 Unused Bit 15 Output channel not available SW81 Expansion I O Module 1 Status Same definitions as SW80 SW82 Expansion I O Module 2 Status Same definitions as SW80 SW83 Expansion I O Module 3 Status Same definitions as SW80 SW84 Expansion I O Module 4 Status Same definitions as SW80 SW85 Expansion I O Module 5 Status Same definitions as SW80 SW8E6 Expansion I O Module 6 Status Same definitions as SW80 SW87 Expansion I O Module 7 Status Same definitions as SW80 SW81 to Expansion SW87 module status TWD USE 10AE 523 System Bits and W
157. Shortest 9 Stop Controller Real Time Date dd mm yyyy Time hh mm ss RTC Correction Init 4 Set Time nfiguri 7L 8 9 10 11 12 1314 15 16 17 18 19 20 21 22 23 Configure Ethernet Advanced 7 8 9 10 11 12 13 14 15 Stee _SetTime _Confgure _Ethemet_ A vanced ep Help oe RUN ERR STAT BATT LAN LAN ACT ST TWD USE 10AE 159 Communications Step Action 3 Click the Ethernet button located in the right portion of the screen to access the connection parameters Result The Control Operations Ethernet table appears displaying MAC current IP Subnet and Gateway information as well as Ethernet connection information as shown in the following figure Controller Operations Ethernet Ethernet MAC Address _ 00 80 f4 10 00 3a IP Address 192 168 2 168 Default Gateway Sub Mask 255 255 255 0 CH1 status Passive Server using by P Unit 192 168 2 2 CH2 status Idle server CH3 status Idle server CH4 status Idle server Package Received 198 Package Sent 197 Error Package received 0 Package sent w o 0 Ethernet STAT Normal operation Current Connection 100M 4 Note that the unique MAC address of the Twido controller is showing on the first row of the Ethernet table 5 The IP information displayed in this table varies depending on the user settings in the IP Configure tab of th
158. Specify the elapsed time in units of 100 ms that the Twido controller will keep trying to establish a TCP connection with the remote device If the connection is still not established after Timeout the Twido controller will give up trying until the next connection request by an EXCH3 instruction A valid timeout setting can range from 0 to 65535 which translates to 0 to 6553 5 s The default setting is 100 TWD USE 10AE 171 Communications Viewing the Ethernet Configuration Overview Viewing the Ethernet Configuration You may use the TwidoSoft Configuration Editor to view the current Ethernet configuration of the Twido controller To view the current Ethernet configuration settings using the Configuration Editor follow these instructions Step Action 1 Select Program gt Configuration Editor from the TwidoSoft menu bar 2 Click on the shortcut labeled ETH in the Configuration Editor taskbar or double click on the Ethernet Port shortcut in the Application Browser 3 The Ethernet TCP IP Configuration parameters appear in a table as shown in the figure below Or Geo SM WH EEREN Ethernet Configuration IP Address Configuration IP address 192 168 1 101 Subnetwork mask 255 255 255 0 Gateway address 192 168 1 101 Marked IP 192 168 1 50 Remote Server Connection Slave IP address Unit ID Timeout 192 168 1 11 255 100 192 168 1 30 5 1
159. Twido programmable controllers Software Reference Guide TWD USE 10AE eng Version 2 5 a brand of ie Telemecanique Table of Contents Part Chapter 1 Chapter 2 Chapter 3 Safety Information 256s ses0ses Gee eee ee Wee eas 11 About the BOOK sviden was gee Sea oe ee Eh 15 Description of Twido Software 005 17 Ata Glance Ao reee eee Ala Massena ak eee ee 17 Introduction to Twido Software 00e eee eens 19 At aiGlancess sneon n Serena le ara a aa Saas fas fated fed ats Rete toned t amsnaeens 19 Introduction to TwidoSoft 0 0 2 eee ee 20 Introduction to Twido Languages 0 eee eet ees 21 Twido Language Objects 00ce cece ee eens 25 At aiGlanGes dca ant ia ote ted teen ete tet ede eke cas Sia 25 Language Object Validation 0 0 cece ete ee 26 BitiObjectse anaes soars Phelan hana soy aero ana bane a a 27 Word Objects en o et ts A eh et ee Lv el git her el eee eee gt 29 Floating point and double word objects 0000 eee eee eee eee 32 Addressing Bit Objects 0 0 tte teens 36 Addressing Word Objects 0000 c eects 37 Addressing floating objects 2 0 2 ee tee 38 Addressing double word objects 0 cece eet eee 39 Addressing Inputs Outputs 0 0 eee 40 Network Addressing 2 cece ee tte 42 Function Block Objects 0 0 0 0 cece eee ee 43 Structured Objects 2 0 0 c cee eee teeta 45 Indexed Ob
160. V The output bit Ci E downcounting changes from 0 to 9999 overflow switches to 1 If the counter continues to count The output bit Ci F downcounting down overflow is reset to zero Up down count To use both the upcount and downcount functions simultaneously or to activate both instructions CD and CU the two corresponding inputs CU and CD must be controlled simultaneously These two inputs are then scanned in succession If they are both at 1 the current value remains unchanged 330 TWDUSE 10AE Basic Instructions Special Cases Operation Action Result Reset Input R is set to state 1 or the R The current value Ci V is forced to 0 instruction is activated Outputs Ci E Ci D and Ci F are at 0 The reset input has priority Preset If input S is set to 1 or the S The current value Ci V takes the instruction is activated and the reset input is at O or the R instruction is inactive Ci P value and the Ci D output is set to 1 The following table shows a list of special operating configuration cases for counters Special case Description Effect of a cold restart S0 1 e The current value Ci V is set to 0 e Output bits Ci E Ci D and Ci F are set to 0 e The preset value is initialized with the value defined during configuration Effect of a warm restart S1 1 of a controller stop Has no effect on the current value of the counter Ci V
161. What s in this This chapter contains the following topics Chapter Topic Page Cyclic Scan 62 Periodic Scan 64 Checking Scan Time 67 Operating Modes 68 Dealing with Power Cuts and Power Restoration 70 Dealing with a warm restart 72 Dealing with a cold start 74 Initialization of objects 76 TWD USE 10AE 61 Controller Operating Modes Cyclic Scan Introduction Operation Description of the phases of a cycle Cyclic scanning involves linking controller cycles together one after the other After having effected the output update third phase of the task cycle the system executes a certain number of its own tasks and immediately triggers another task cycle Note The scan time of the user program is monitored by the controller watchdog timer and must not exceed 500 ms Otherwise a fault appears causing the controller to stop immediately in Halt mode Outputs in this mode are forced to their default fallback state The following drawing shows the running phases of the cyclical scan time Processing the Processing program the program L P l Q LP l Q Scan n time Scan n 1 time a B The following table describes the phases of a cycle input Address Phase Description I P Internal The system implicitly monitors the controller managing system processing bits and words updating current timer values updating status lig
162. When the a 20 stack is full output F 1 no 80 further storage is possible 50 2 When a retrieval request is Retrieval of the data word high received rising edge at input est in the stack O or activation of instruction O the highest data word last word op to be entered is loaded into Ri O word Ri 0 Fig b When the 20 gt 20 register is empty output E 1 80 b no further retrieval is possible 50 Output word Ri O does not change and retains its value 3 The stack can be reset at any 80 time state 1 at input R or 50 activation of instruction R The element indicated by the pointer is then the highest in the stack 376 TWD USE 10AE Advanced Instructions FIFO operation Introduction Operation In FIFO operation First In First Out the first data item entered is the first to be retrieved The following table describes FIFO operation Step Description Example 1 When a storage request is received rising edge at input or activation of instruction 1 the contents of input word Ri which has already been loaded are stored at the top of the queue Fig a When the queue is full output F 1 no further storage is possible Storage of the contents of Ri at the top of the queue 20 Ri I a 20 80 50 2 When a retrieval request is received rising edge at
163. Words Objects words and bits associated with the AS Interface bus contribute data for example bus operation slave status etc and additional commands to carry out advanced programming of the AS Interface function These objects are exchanged explicitly between the Twido controller and the AS Interface Master by the expansion bus e At the request of the program user by way of the instruction ASI_CMD see Presentation of the ASI_CMD instruction below e Via the debug screen or the animation table System words reserved in the Twido controller for the AS Interface Master modules enable you to determine the status of the network SW73 is reserved for the first AS Interface expansion module and SW74 for the second Only the first 5 bits of these words are used they are read only The following table shows the bits used System Bit Description Words 0 system status 1 if configuration OK otherwise 0 SW73 1 data exchange 1 data exchange is enabled 0 if in mode and Data Exchange Off See AS Interface V2 bus interface SW74 module operating mode p 230 2 system stopped 1 if the Offline See Offline Mode p 230 mode is enabled otherwise 0 3 ASI_CMD instruction terminated 1 if terminated O if in progress 4 ASI_CMD error instruction 1 if there is an error in the instruction otherwise 0 Example of use for the first AS Interface expansion module Before usi
164. a maximum no higher than 32767 Celsius 0 1 C International thermometric scale This is only available for the TWDALMSLT input channels Fahrenheit 0 1 F Thermometric scale where the boiling point of water is 212 F 100 C and the freezing point is 32 F 0 C This is only available for the TWDALM3LT input channels TWD USE 10AE 191 Managing Analog Modules Analog Module Status Information Status Table The following table has the information you need to monitor the status of Analog I O modules System Function Description Word SW80 Base I O Status Bit 0 Channels in normal operation for all its channels Bit 1 Module under initialization or of initializing information of all channels Bit 2 Hardware failure external power supply failure common to all channels Bit 3 Module configuration fault Bit 4 Converting data input channel 0 in progress Bit 5 Converting data input channel 1 in progress Bit 6 Input thermocouple channel 0 not configured Bit 7 Input thermocouple channel 1 not configured Bit 8 Not used Bit 9 Unused Bit 10 Analog input data channel 0 over range Bit 11 Analog input data channel 1 over range Bit 12 Incorrect wiring analog input data channel 0 below current range current loop open Bit 13 Incorrect wiring analog input data channel 1 below current range current loop open Bit 14 Unused Bit 15 Output channel not available
165. a TWDNAC232D in the TWDXCPODM On the Compact controller the optional Port 2 is a TWDNAC232D To configure the controller connect the TSXPCX1031 cable not shown to Port 1 of the Twido controller Next connect the cable to the COM 1 port of the PC Be sure that the switch is in position 2 Finally connect the COM 2 port of the PC to the optional EIA RS 232 Port 2 on the Twido controller The wiring schematic is provided in the next step Step 2 ASCII Communications Cable EIA RS 232 Wiring Schematic Twido Personal controller computer TXD RXD GND TXD RXD GND 3 4 7 3 2 5 The minimum number of wires used in an ASCII communications cable is 3 Cross the transmit and receive signals Note On the PC side of the cable additional connections such as Data Terminal Ready and Data Set Ready may be needed to satisfy the handshaking No additional connections are required to satisfy the Twido controller 126 TWD USE 10AE Communications Step 3 Port Configuration Hardware gt Add Option Terminal Emulator on a PC TWDNOZ232D Hardware gt Adjust Controller Comm Setting ee Rate are Data 8 Bit Port 2 Parity None Type ASCII Stop i Baud Rate i 19200 Flow control None Data 8 Bit Parity None Stop 1 Bit End of Frame 65 Response Timeout 100 x 100 ms Use a simple Terminal Emulator application on the PC to configure
166. a a network Ethernet hub switch Twido TWDLCAE40DRF RJ 45 Ethernet Port PC Ethernet Network Port 3 E RJ 45 z Ethernet parsing Hub Switch B SFTP Cat5 RJ45 Ethernet ar I RJ 45 male connector RJ 45 male connector Note The PC running the TwidoSoft application must be Ethernet capable The Twido TWDLCAE40DRF features a RJ 45 connector to connect to the 100 BASE TX network Ethernet with auto negotiation It can accomodate both 100Mbps and 10 Mbps network speeds The following figure shows the RJ 45 connector of the Twido controller Pins e 1 The eight pins of the RJ 45 connector are arranged vertically and numbered in order from bottom to top The pinout for the RJ 45 connector is described in the table below Pinout Function Polarity NC NC RxD NC NC RxD w AJ a oin TWD USE 10AE 93 Communications Pinout Function Polarity 2 TxD 1 TxD Note e The same connector and pinout is used for both 10Base T and 100Base TX e When connecting the Twido controller to a 100Base TX network you should use at least a category 5 Ethernet cable 94 TWD USE 10AE Communications Communication between TwidoSoft and a Modem General Installing the Modem Establishing Connection A PC executi
167. able 9 reception error 10 can not use KW if receiving 11 transmission offset larger than transmission table 12 reception offset larger than reception table 13 controller stopped EXCH processing YSW64 EXCH2 block EXCH2 error code See SW63 S error code TWD USE 10AE 521 System Bits and Words System Function Description Control Word SWES EXCH3 block EXCH error code is implemented on Ethernet capable S error code TWDLCAE40DRF Twido controllers only 1 4 6 13 See SW63 Note that eror code 5 is invalid and replaced by the Ethernet specific error codes 109 and 122 described below The following are dedicated to Modbus response 81 slave server PLC returns ILLEGAL FUNCTION response 82 slave server PLC returns ILLEGAL DATA ADDRESS response 83 slave server PLC returns ILLEGAL DATA VALUE response 84 slave server PLC returns SLAVE DEVICE FAILURE response 85 slave server PLC returns ACKNOWLEDGE response 86 slave server PLC returns SLAVE DEVICE BUSY response 87 slave server PLC returns NEGATIVE ACKNOWLEDGE response 88 slave server PLC returns MEMORY PARITY ERROR response The following are Ethernet specific error codes 101 no such IP address 102 the TCP connection is broken 103 no socket available all connection channels are busy 104 network is down 105 network cannot be reached 106 network dropped connection on reset 107 connectio
168. able only if Adjust is set to one 2 Access available only if configured 3 Read and write access only through the application Not the Operator Display or Animation Tables Editor CM Counting Mode FM Frequency Meter Mode Counting The very fast counting function VFC works at a maximum frequency of 20 kHz Function with a range of 0 to 65535 in standard mode and 0 to 4294967295 The pulses to Description be counted are applied in the following way Table Function Description VFCO YNFC1 IA IB IA IB Up Down Counter The pulses are applied to the physical input the 10 0 1 10 0 0 10 0 7 10 0 6 current operation upcount downcount is given by the state of the physical input IB Up Down 2 Phase Counter The two phases of the encoder are applied to 10 0 1 10 0 0 10 0 7 10 0 6 physical inputs IA and IB Single Up Counter The pulses are applied to the physical input IA IB is 10 0 1 ND 10 0 7 ND not used Single Down Counter The pulses are applied to the physical input IA IB is 10 0 1 ND 10 0 7 ND not used 400 TWD USE 10AE Advanced Instructions Notes on Function Blocks Notes on Function Block Outputs Upcount or downcount operations are made on the rising edge of pulses and only if the counting block is enabled There are two optional inputs used in counting mode ICa and IPres ICa is used to capture t
169. accessible by the Accessible by program that are associated with the various advanced function blocks Please note the Program that write access in the table below depends on the Adjustable setting selected during configuration Setting this allows or denies access to the words or bits by TwidoSoft or the operator interface Advanced Associated Words and Bits Address Write Function Block Access R Word Register input Ri Yes Word Register output Ri O Yes Bit Register output full Ri F No Bit Register output empty RI E No DR Word Current step number DRi S Yes Bit Last step equals current step DRi F No FC Word Current Value FCI V Yes Word Preset value FCI P Yes Bit Done FCi D No 370 TWD USE 10AE Advanced Instructions Advanced Associated Words and Bits Address Write Function Block Access NFC Word Current Value YN FCI V No Word Preset value NFCI P Yes Bit Counting direction NFCI U No Word Capture Value NFCI C No Word Threshold 0 Value NFCi SO Yes Word Threshold Value NFCI S1 Yes Bit Overflow NFCI F No Bit Reflex Output 0 Enable NFCI R Yes Bit Reflex Output 1 Enable YNFCI S Yes Bit Threshold Output 0 NFCi THO No Bit Threshold Output 1 NFCI TH1 No Bit Frequency Measure Time Base VFCi T Yes PWM Word Percentage of pulse at 1 in PWMi R Yes relationship to the total period Word Preset
170. ace bus Illustration of the The illustration of the debug screen in online mode only looks like this Debug Screen Configure Module TWDNOI10M3 Position 2 x Description MasterAS Interfaceexpansionmodule i s lt s i i is SOSOS S SOOOOOO Configuration AS interface V2 configuration _______________ Slave 1A Std A Slaves Slaves aa Characteristics 00 Profile io 7 pE mf mf Co De Comment XVB illuminated column base 02 03 f AS120MT41E Rerameters 04 Bits C Decimal 05 ff inout2412 at en e ee 06 WXA36 fov 0O 3 08 m Inputs Outputs 09 Inputs Value Format Outputs Value Format 10 IA1 1A 0 0 Dec QA1 1A 0 0 Dec 11 i Unknown IA1 1A 1 0 Dec QA1 1A 1 0 Dec 12 13 m Error on the network 14 15 16 v AS Interface Bus Auto addressing OI Slave at adcress 0 OE Cutin power SlavesOK ON Protected Mode OFF Auto adcressing active ONT Network down OFE Cancel Help TWD USE 10AE 211 Installing the AS Interface bus Description of the Debug Screen Displaying Slave Status The Debug screen provides the same information as theconfiguration screen See Description of the Screen in Offline Mode p 203 The differences are listed in the follo
171. ack to the Input Object l To display a system object Step Action 1 Press the D key until the Data Display screen is shown The Input object I will be displayed in the upper left corner of the display area The letter or the name of the object previously viewed as data is not blinking 2 Press the MOD ENTER key to enter edit mode The Input Object I character or previous object name viewed as data begins blinking 3 Press the 7 N key to step sequentially through the list of objects 4 Press the D key to step sequentially through the field of an object type and press the a key to increment through the value of that field You can use the gt key and a key to navigate and modify all fields of the displayed object Repeat steps 3 and 4 until editing is complete Press the MOD ENTER key to accept the modified values Note The object s name and address have to be validated before accepting any modifications That is they must exist in the configuration of the controller prior to using the operator display Press ESC to discard any changes made in edit mode In general the data value for an object or variable is shown as a signed or unsigned integer in the lower right of the display area In addition all fields suppress leading zeros for displayed values The address of each object is displayed on the Operator Display in one of the following seven formats e O format AS Interface
172. acteristics of the PID function 429 How to access the PID configuration 432 General tab of PID function 434 Input tab of the PID 437 PID tab of PID function 439 AT tab of PID function 442 Output tab of the PID 447 How to access PID debugging 450 Animation tab of PID function 452 Trace tab of PID function 454 PID States and Errors Codes 456 PID Tuning With Auto Tuning AT 460 PID parameter adjustment method 469 Role and influence of PID parameters 472 Appendix 1 PID Theory Fundamentals 476 Appendix 2 First Order With Time Delay Model 478 424 TWDUSE 10AE Advanced Instructions Overview General Key Features The PID regulation function is a TwidoSoft programming language function It allows programming of PID regulation loops on Twido version 1 2 or higher controllers This function is particularly adapted to e Answering the needs of the sequential process which need the auxiliary adjustment functions examples plastic film packaging machine finishing treatment machine presses etc e Responding to the needs of the simple adjustment process examples metal furnaces ceramic furnaces small refrigerating groups etc It is very easy to install as it is carried out in the e Configuration e and Debug screens associated with a program line operation block in Ladder Language or by simply calling the PID in Instruction List indicating the number of the PID used Example of a program line in Ladder Language
173. ady to send another Done output message Use of the MSGx D bit is recommended when multiple messages are MSGx D sent If it is not used messages may be lost 410 TWD USE 10AE Advanced Instructions Transmission of Several Successive Messages Reinitializing Exchanges Execution of the EXCH instruction activates a message block in the application program The message is transmitted if the message block is not already active MSGx D 1 If several messages are sent in the same cycle only the first message is transmitted The user is responsible for managing the transmission of several messages using the program Example of a transmission of two messages in succession on port 2 10 0 MSG2 D p EXCH2 MW2 4 LDR I10 0 ep eb AND MSG2 D Mo EXCH2 MW2 4 fs S MO S LD MSG2 D MSGD M0 an EXCH2 MW8 3 EXCH2 MWS8 3 R MO MO R aay An exchange is cancelled by activating the input or instruction R This input initializes communication and resets output MSGx E to 0 and output MSGx D to 1 It is possible to reinitialize an exchange if a fault is detected Example of reinitializing an exchange F BLK MSGI MO0 MSGI S rR D R END BLK E TWD USE 10AE 411 Advanced Instructions Special Cases The following table the special operating cases for the MSGx function
174. ailed and what caused for the failure as outlined in the following table Op1 Mwi Description 0 Successful interpolation 1 Interpolation error Bad array Xm lt Xm 1 Interpolation error Op2 out of range X lt X4 Interpolation error Op2 out of range X gt Xm ao A N Invalid size of data array Op3 is set as odd number or e Op3 lt 6 Note Op1 does not contain the computed interpolation value Y For a given X value the result of the interpolation Y is contained in MF2 of the Op3 array See Definition of Op3 below Op2 is the floating point variable MFO of the Op3 floating point array that contains the user defined X value for which to compute the interpolated Y value e Valid range for Op2 is as follows X SOp2 lt X 504 TWD USE 10AE Advanced Instructions Definition of Op3 Structure Op3 sets the size Op3 2 of the floating point array where the X Y data pairs are stored X and Y data are stored in floating point objects with even indexes starting at MF4 note that MFO and MF2 floating point objects are reserved for the user set point X and the interpolated value Y respectively Given an array of m data pairs X Y the upper index u of the floating point array MFu is set by using the following relationships e equation 3 Op3 2 m e equation 4 u 2 Op3 1 The floating point array Op3 MFi
175. alue or minimum found in the table Structure Ladder language l1 2 MDO MIN_ARR MD20 7 MF8 MIN_ARR MF40 5 Instruction List Language LD 11 2 MDO MIN ARR MD20 7 MF8 MIN_ ARR MF40 5 Syntax Syntax of table search instructions for max and min values Function Syntax MAX_ARR Res Function Tab MIN_ARR Parameters of table search instructions for max and min values Type Result Res Table Tab Double word tables MDi MDi L KDi L Floating word tables MFi MFi L KFi L 498 TWD USE 10AE Advanced Instructions Number of occurrences of a value in a table General Structure Syntax TWD USE 10AE This search function e OCCUR_ARR searches in a double word or floating word table for a number of elements equal to a given value Ladder language 13 2 MW5 OCCUR_ARR MF20 7 KFO l1 2 MW0 OCCUR_ARR MD20 7 MD1 Instruction List Language LD 13 2 LD 11 2 SMW5 OCCUR_ARR MF20 7 KFO SMWO OCCUR_ ARR MD20 7 MD1 Syntax of table search instructions for max and min values Function Syntax OCCUR_ARR Res Function Tab Val Parameters of table search instructions for max and min values Type Result Res Table Tab Value Val Double word tables MWi MDi L KDi L MDi
176. ame should be blocked or transmitted based on its destination address 536 TWD USE 10AE Glossary Symbol A symbol is a string of a maximum of 32 alphanumeric characters of which the first character is alphabetic It allows you to personalize a controller object to facilitate the maintainability of the application Symbol table A table of the symbols used in an application Displayed in the Symbol Editor T TCP Transmission Control Protocol TCP IP A protocol suite consisting of the Transmission Control Protocol and the Internet Protocol the suite of communications protocols on which the Internet is based Threshold Coils that are controlled directly by the very fast counter VFC according to the outputs settings established during configuration Timer A function block used to select a time duration for controlling an event Twido A line of Schneider Electric controllers consisting of two types of controllers Compact and Modular Expansion Modules to add I O points and options such as Real Time Clock communications operator display and backup memory cartridges TwidoSoft A 32 Bit Windows graphical development software for configuring and programming Twido controllers U Unresolved A symbol without a variable address symbol V Variable Memory unit that can be addressed and modified by a program TWD USE 10AE 537 Glossary Very fast counter A function block that provides for faster counting tha
177. ame Connection type Configuration Timeout Break timeol erial COM7 Serial COM7 5000 120 TCPIPO1 TCPIIP 192 168 1 101 5000 5000 TCPIPO2 TCP IP 192 168 1 50 5000 5000 TCPIPO3 TCP IP 192 168 1 30 5 5000 5000 v d l 5 Add Modify Delete Click the Add button in the Connections Management dialogbox Result A new connection line is added The new line displays suggested default connection settings You will need to change these settings Note To set a new value in a field you have two options e Click once to select the desired field then click the Modify button e Double click the desired field In the Name field enter a descriptive name for the new connection A valid name may contain up to 32 alphanumeric characters In the Connection Type field click to unfold the dropdown list and select TCP IP as you are setting up a new Ethernet connection between your PC anda Ethernet capable Twido controller TWD USE 10AE 173 Communications Step Action 5 In the Configuration field enter a valid IP address and Unit ID if any which is the IP information of the Twido TWDLCAE40DRF controller you wish to connect to The IP address and the Unit ID must be seperated by a comma IP address Depending on how you chose to configure the Twido controller enter either the Default IP Address or the user specified Static IP Address assigned to the con
178. amount of data between the master controller and up to seven remote slave controllers Application or I O data is transferred depending on the configuration of the remote controllers A mixture of remote controller types is possible where some can be remote I O and some can be peers ASCII The ASCII protocol is a simple half duplex character mode protocol used to transmit and or receive a character string to from a simple device printer or terminal This protocol is supported only via the EXCH instruction Modbus The Modbus protocol is a master slave protocol that allows for one and only one master to request responses from slaves or to act based on the request The master can address individual slaves or can initiate a broadcast message to all slaves Slaves return a message response to queries that are addressed to them individually Responses are not returned to broadcast queries from the master Modbus master The modbus master mode allows the Twido controller to send a modbus query to a slave and await its reply The modbus master mode is supported only via the EXCH instruction Both Modbus ASCII and RTU are supported in modbus master mode Modbus Slave The modbus slave mode allows the Twido controller to respond to modbus queries from a modbus master and is the default communications mode if no other type of communication is configured The Twido controller supports the standard modbus data and control functions and serv
179. ample of a Function Block Bit Objects Word Objects Function blocks are the sources for bit objects and specific words that are used by programs Basic function blocks provide simple functions such as timers or up down counting The following illustration is an example of an up down Counter function block Ci IR E TS Apy D Ci P 9999 CD F Up down counter block Bit objects correspond to the block outputs These bits can be accessed by Boolean test instructions using either of the following methods e Directly for example LD E if they are wired to the block in reversible programming see Standard function blocks programming principles p 319 e By specifying the block type for example LD Ci E Inputs can be accessed in the form of instructions Word objects correspond to specified parameters and values as follows e Block configuration parameters Some parameters are accessible by the program for example pre selection parameters and some are inaccessible by the program for example time base e Current values For example Ci V the current count value TWD USE 10AE 317 Basic Instructions Accessible Bit The following table describes the Basic function blocks bit and word objects that can and Word be accessed by the program Objects Basic Symbol Range Types of Description Address Write Function i Objects Acces
180. and 2 Op2 MFi MWi KWi Example integer word conversion gt floating 147 gt 1 47e 02 Operators and syntax double conversion of integer word gt floating Operators Syntax DINT_TO_REAL Op1 DINT_TO_REAL Op2 Operands double conversion of integer word gt floating Operand 1 Op1 Operand 2 Op2 MFi MDi KDi Example integer double word conversion gt floating 68905000 gt 6 8905e 07 Operators and syntax floating conversion gt integer word or integer double word Operators Syntax REAL_TO_INT Op1 Operator Op2 REAL_TO_DINT Operators floating conversion gt integer word or integer double word Type Operand 1 Op1 Operand 2 Op2 Words MWi MFi KFi Double words MDi MFi KFi Example floating conversion gt integer word 5978 6 gt 5979 floating conversion gt integer double word 1235978 6 gt 1235979 Note If during a real to integer or real to integer double word conversion the floating value is outside the limits of the word or double word bit S18 is set to 1 TWD USE 10AE 489 Advanced Instructions Precision of Standard IEEE 754 defines 4 rounding modes for floating operations Rounding The mode employed by the instructions above is the rounded to the nearest mode if the nearest representable values are at an equal distance from th
181. ansmitting however it uses a different checksum calculation mode specified as a CRC The Modbus Data Link Layer has the following limitations e Address 1 247 e Bits 128 bits on request e Words 125 words of 16 bits on request Message The language offers two services for communication Exchange e EXCHx instruction to transmit receive messages e MSGx Function Block to control the message exchanges The Twido controller uses the protocol configured for that port when processing an EXCHx instruction Note Each communications port can be configured for different protocols or the same The EXCH x instruction or MSGx function block for each communications port is accessed by appending the port number 1 or 2 EXCHx The EXCHx instruction allows the Twido controller to send and or receive Instruction information to from Modbus devices The user defines a table of words MWi L containing control information and the data to be sent and or received up to 250 bytes in transmission and or reception The format for the word table is described earlier A message exchange is performed using the EXCH x instruction Syntax EXCHx MWi L where x port number 1 or 2 L number of words in the control words transmission and reception tables 134 TWD USE 10AE Communications MSGx Function Block Limitations The Twido controller must finish the exchange from the first EXCHx instruction before a second can be launched The MSGx function b
182. aracter The following example shows how to address the current value of a fast counter in standard format and in double word format e FCi V is current value of the fast counter in standard format e FCi VD is the current value of the fast counter in double word format Note Double word objects are not supported by all Twido controllers Refer to Hardware compatibility p 33 to find out if your Twido controller can accommodate double words See the following appropriate sections for a list of objects that are accessible by the program e For Basic Function Blocks see Basic Function Blocks p 317 e For Advanced Function Blocks see Bit and Word Objects Associated with Advanced Function Blocks p 370 44 TWD USE 10AE Twido Language Objects Structured Objects Introduction Bit Strings Structured objects are combinations of adjacent objects Twido supports the following types of structured objects Bit Strings Tables of words Tables of double words Tables of floating words Bit strings are a series of adjacent object bits of the same type and of a defined length L Example Bit string M8 6 M8 M9 M10 M11 M12 M13 Note M8 6 is acceptable 8 is a multiple of 8 while M10 16 is unacceptable 10 is not a multiple of 8 Bit strings can be used with the Assignment instruction see Assignment Instructions p 342 TWD USE 10A
183. arentheses The following diagrams are examples of using a parentheses with an AND instruction AND 10 0 I0 1 Q0 0 10 2 10 0 I0 1 Q0 1 I0 2 LD AND OR ST LD AND OR ST I10 0 I10 1 10 2 QO0 0 10 0 I10 1 10 2 QO0 1 The following diagrams are examples of using parentheses with an OR instruction OR f LD 0 0 es ee oy AND lI0 1 OR I0 2 10 2 I0 3 Sg 10 3 ST Q0 0 278 TWD USE 10AE Instruction List Language Modifiers Nesting Parenthesis Examples of Nesting Parentheses The following table lists modifiers that can be assigned to parentheses Modifier Function Example N Negation AND N or OR N F Falling edge AND F or OR F R Rising edge AND R or OR R Comparison See Comparison Instructions p 347 It is possible to nest up to eight levels of parentheses Observe the following rules when nesting parentheses Each open parentheses must have a corresponding closed parentheses Labels Li subroutines SRi jump instructions JMP and function block instructions must not be placed in expressions between parentheses Store instructions ST STN S and R must not be programmed between parentheses Stack instructions MPS MRD and MPP cannot be used between parentheses The
184. as a floating value e Indefinite for example the square root of a negative number the symbol 1 4 NAN or 1 4 NAN is displayed Representation precision is 2 24 To display floating point numbers it is unnecessary to display more than 6 digits after the decimal point 32 TWD USE 10AE Twido Language Objects Limit range of Arithmetic Functions on Floating Point Hardware compatibility Note e the value 1285 is interpreted as a whole value in order for it to be recognized as a floating point value it must be written thus 1285 0 The following table describes the limit range of arithmetic functions on floating point objects Arithmetic Funtion Limit range and invalid operations Type Syntax QNAN Invalid INF Infinite Square root of an SQRT x x lt 0 x gt 1 7E38 operand Power of aninteger EXPT y x x lt 0 y In x gt 88 by a real where EXPT MF MW x4y MWA MF Base 10 logarithm LOG x x lt 0 x gt 2 4E38 Natural logarithm LN x x lt 0 x gt 1 65E38 Natural exponential EXP x x lt 0 x gt 88 0 Floating point and double word operations are not supported by all Twido controllers The following table shows hardware compatibility Twido controller Double words Floating supported points supported TWDLMDA40DUK Yes Yes TWDLMDA4ODTK Yes Yes TWDLMDA20DUK Yes No TWDLMDA20DTK
185. at contains the MBAP Index associated with the Ethernet network IP address of the remote device Modbus TPC IP server specified in the Slave IP Address field The MBAP Index is called by the EXCH3 instruction as one of the function s arguments to identify which remote controller specified in the table is being queried by the Modbus TCP IP client Note You may specify up to 16 different remote devices indexed from 1 to 16 in this table Slave IP Address Enter the IP address of the remote device Modbus TCP IP server controller in this field Note You must configure the slave IP addresses starting at Index 1 and in growing index number in a consecutive manner For example configuring slave IPs of index 1 than 3 is not allowed for you must first configure the entry indexed 2 prior to index 3 Unit ID Enter the Modbus Unit ID or Protocol Address in this field A valid Unit ID can range from 0 to 255 The default setting is 255 A Unit ID other than 255 makes communications with a remote device across a Modbus bridge or gateway possible If the target device is another Twido controller or a legacy Modbus device installed on another bus serial link address via a gateway than you may set the Unit ID of that remote device accordingly In the field you should set the Slave IP as the gateway or bridge IP address and the Unit ID as the Modbus serial link address of your target device Connection Timeout 100 ms
186. ation set in the application to determine the type of communication Step 3 Port Configuration Hardware gt Add Option Hardware gt Add Option TWDNOZ485 TWDNOZ485 Hardware gt Controller Comm Setting Hardware gt Controller Comm Setting Port 2 Port 2 Type Modbus Type Modbus Address 1 Address 2 Baud Rate 19200 Baud Rate 19200 Data 8 Bit Data 8 Bit Parity None Parity None Stop 1 Bit Stop 1 Bit End of Frame 65 End of Frame 65 Response Timeout 10 x 100 ms Response Timeout 100 x 100 ms Frame Timeout 10 ms Frame Timeout 10 ms In both the master and slave applications the optional EIA RS 485 ports are configured Ensure that the controller s communication parameters are modified in Modbus protocol and at different addresses In this example the master is set to an address of 1 and the slave to 2 The number of bits is set to 8 indicating that we will be using Modbus RTU mode If this had been set to 7 then we would be using Modbus ASCII mode The only other default modified was to increase the response timeout to 1 second 138 TWD USE 10AE Communications Note Since Modbus RTU mode was selected the End of Frame parameter was ignored Step 4 Write the application LD 1 LD 1 MWO 16 0106 MWO 16 6566 gt MW1 16 0300 MW1 16 6768 gt MW2 16 0203 MW2 16 6970
187. ative 800Dh Autotuning error delay is negative 800Eh Autotuning error error calculating Kp 800Fh Autotuning error time constant over delay ratio gt 20 8010h Autotuning error time constant over delay ratio lt 2 8011h Autotuning error the limit for Kp has been exceeded 8012h Autotuning error the limit for Ti has been exceeded 8013h Autotuning error the limit for Td has been exceeded TWD USE 10AE 459 Advanced Instructions PID Tuning With Auto Tuning AT Overview of PID Tuning Scope of the Auto Tuning Auto Tuning Requirements The PID control function relies on the following three user defined parameters Kp Ti and Td PID tuning aims at determining these process parameters accurately to provide optimum control of the process TheAT function of the Twido PLC is especially suited for automatic tuning of thermal processes As values of the PID parameters may vary greatly from one control process to another the auto tuning function provided by the Twido PLC can help you determine more accurate values than simply provided by best guesses with less effort When using the auto tuning function make sure the control process and the Twido PLC meet all of the following four requirements e The control process must be an open loop stable system e Atthe start of the auto tuning run the control process must be in steady state with a null process input e g an oven or a furnace shall be at
188. auds 1 2400 bauds 2 4800 bauds 3 9600 bauds 4 19200 bauds 5 38400 bauds e RTS CTS e 0 disabled e 1 enabled e Parity e 00 none e 10 odd e 11 even e Stop bit e 0 1 stop bit e 1 2 stop bits e Data bits e 0 7 data bits e 1 8 data bits S SW105 SW106 Configuration for use of the ASCII protocol When bit S103 Comm 1 or S104 Comm 2 is set to 1 the ASCII protocol is used System word SW105 Comm 1 or SW106 Comm 2 must be set according to the elements below 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Timeout response ramen MS in multiple of 100 ms Timeout S SW111 Remote link status Indication Bit 0 corresponds to remote controller 1 bit 1 to remote controller 2 etc Bit 0 to 6 Setto 0 remote controller 1 7 absent e Setto 1 remote controller 1 7 present Bit 8 to bit 14 Setto 0 remote I O detected on remote controller 1 7 Setto 1 extension controller detected on remote controller 1 7 TWD USE 10AE 525 System Bits and Words System Words Function Description Control SW112 Remote Link configuration operation error code 00 successful operations 01 timeout detected slave 02 checksum error detected slave 03 configuration mismatch slave This is set to 1 by the system and must be reset by the user
189. ause of a Cold A cold start can occur Start When loading a new application into RAM When power is restored with loss of application context When system bit S0 is set to state 1 by the program From the Operator Display when the controller is in STOP mode Illustration The drawing below describes a cold restart operation in RUN mode RUN WAIT V Acquisition of inputs eooo Execution of program TOP if bit S0 1 possible process with cold restart power cut gt Micro power cut No BOT Yes Stop the processor Save application context Restoration of power AUTO TESTS Vv Completion of Set bit S0 to 0 Update outputs configuration auto tests Vv Initialization of application Vv Set bit S0 to 1 74 Controller Operating Modes Operation The table below describes the restart phases for running a program after a cold restart Phase Description 1 At start up the controller is in RUN At a cold restart after a stop due to an error the system forces a cold restart The program execution restarts at the beginning of the cycle 2 The system e Resets internal bits and words and the I O images to 0 e Initializes system bits and words e Initializes function blocks from configuration data 3 For this first restart cy
190. ave diagnostics 212 Slave insertion 221 software configuration 204 software set up principle 200 transfer of a slave image 216 Assignment instructions 306 Numerical 342 AT tab PID 442 ATAN 484 Backup and restore 32K backup cartridge 56 64K extended memory cartridge 59 memory structure 52 without cartridges 54 Basic function blocks 317 Bit objects 370 Addressing 36 Overview 27 Bit strings 45 BLK 266 Blocks in Ladder diagrams 254 Boolean accumulator 274 Bus AS Interface V2 automatic slave addressing 220 Bus AS Interface V2 bus debugging the bus 215 C Calculation 349 Checking scan time 67 Clock functions Overview 414 Schedule blocks 415 Setting date and time 420 time and date stamping 418 Closed loop adjustment 469 Coils 254 graphic elements 258 Cold start 74 Communication by modem 89 Communication overview 87 Communications ASCII 119 Modbus 129 Remote Link 105 Communications cable connection 89 Comparison block graphic element 259 Comparison blocks 256 Comparison Instructions 347 Configuration PID 432 Configuring A port for ASCII 122 Port for Modbus 131 Transmission Reception table for ASCII 122 Connections management 173 Contacts 254 graphic element 257 Control parameters Boolean instructions 300 ASCII 122 Assignment 306 Control table OR 310 Modbus 132 Understanding the format used in this Conversion instructions 356 manual 302
191. ays the object number and the step counter bit as follows e Object name and number in the upper left e Step counter bit in the upper right e The value of the step counter bit in the lower portion of the display In the following example bit number 129 of step counter number 3 is set to 1 S C 3 129 1 The shift bit register SBR appears in the display area as follows e Object name and number in the upper left e Register bit number in the upper right e Register bit value in the lower right The following example shows the display of shift bit register number 4 SBR 4 9 TWD USE 10AE 243 Operator Display Operation Serial Port Settings Introduction Displaying and Modifying Serial Port Settings The operator display allows you to display the protocol settings and change the addresses of all serial ports configured using TwidoSoft The maximum number of serial ports is two In the example below the first port is configured as Modbus protocol with an address 123 The second serial port is configured as a remote link with an address of 4 123 4 Twido controllers can support up to two serial ports To display the serial port settings using the operator display Step Action 1 Press the gt key until the Communication Display is shown The single letter of the protocol setting of the first serial port M R or A will be displayed in the upper left corner of the operator display
192. backup application is present in the EEPROM e The application in RAM matches the backup application in EEPROM e The backup memory words are valid TWD USE 10AE 55 User Memory Backup and Restore with a 32K Backup Cartridge Introduction The following information details backup and restore memory functions in modular and compact controllers using a 32K backup cartridge At a Glance The backup cartridge is used to save a program and transfer that program to other Twido controllers It should be removed from a controller and set aside once the program has been installed or saved Only program and configuration data can be saved to the cartridge MWs cannot be saved to the 32K backup cartridge Dynamic data can be stored in memory words then backed up to the EEPROM When program installation is complete any MWs that were backed up to the internal EEPROM prior to installation will be lost Memory Here is a diagram of a controller s memory structure with the backup cartridge Structure attached The arrows show what can be backed up to the EEPROM and cartridge from RAM Dynamic words MWs _ RAM Program l METOE Configuration data I MWs a l EEPROM Program e Stes eases 4 Configuration data eg Backup Program Le fhe dS a G cartridge Configuration data et 56 TWD USE 10AE User Memory Program Backup Here are the steps for back
193. bal confirmation of Confirmation of application level the application Local or Symbolization optional Symbolization of the variables associated with the connected slave devices Programming Programming the AS Interface V2 function Connected Transfer Transfer of the application to the PLC Debugging Debugging the application with the help of the debug screen used on the one hand to display slaves address parameters and on the other to assign them the desired addresses e diagnostic screens allowing identification of errors Note The declaration and deletion of the AS Interface Master module on the expansion bus is the same as for another expansion module However once two AS Interface Master modules have been declared on the expansion bus TwidoSoft will not permit another one to be declared 200 TWD USE 10AE Installing the AS Interface bus Precautions Before connecting via the software the PC to the controller and to avoid any Prior to detection problem Connection e Ensure that no slave is physically present on the bus with address 0 e Ensure that 2 slaves are not physically present with the same address TWD USE 10AE 201 Installing the AS Interface bus Description of the configuration screen for the AS Interface bus At a Glance The configuration screen of the AS Interface master module gives access to the parameters associated with the module and the slave devices
194. ble 9 reception error 10 can not use KW if receiving 11 transmission offset larger than transmission table 12 reception offset larger than reception table 13 controller stopped EXCH processing YSW64 EXCH2 error code See SW63 Master If a master slave controller restarts one of the following events happens Controller e A cold start S0 1 forces a re initialization of the communications Restart e Awarm start S1 1 forces a re initialization of the communications e In Stop mode the controller stops all Modbus communications 136 TWD USE 10AE Communications Modbus Link Example 1 To configure a Modbus Link you must 1 Configure the hardware 2 Connect the Modbus communications cable 3 Configure the port 4 Write an application 5 Initialize the Animation Table Editor The diagrams below illustrate the use of Modbus request code 3 to read a slave s output words This example uses two Twido Controllers Step 1 Configure the Hardware 1 Controller Rg 485 EIA Port 1 To serial COM 1 Master X Module RS 485 EIA Port2 ee 1A 3 0 2 Controller RS 485 EIA Port 1 a Slave Modbus RS 485 EIA Port 2 The hardware configuration is two Twido controllers One will be configured as the Modbus Master and the other as the Modbus Slave Note In this example each c
195. block Special Case Description Effect of a cold restart SO 1 Forces a reinitialization of the communication Effect of a warm restart S1 1 Has no effect Effect of a controller stop If a message transmission is in progress the controller stops its transfer and reinitializes the outputs MSGx D and MSGx E 412 TWD USE 10AE Advanced Instructions 15 2 Clock Functions At a Glance Aim of this This section describes the time management functions for Twido controllers Section What s in this This section contains the following topics ion Section Topic Page Clock Functions 414 Schedule Blocks 415 Time Date Stamping 418 Setting the Date and Time 420 TWD USE 10AE 413 Advanced Instructions Clock Functions Introduction Twido controllers have a time of day clock function which requires the Real Time Clock option RTC and provides the following e Schedule blocks are used to control actions at predefined or calculated times e Time date stamping is used to assign time and dates to events and measure event duration The Twido time of day clock can be accessed by selecting Schedule Blocks from from the TwidoSoft Software menu Additionally the time of day clock can be set by a program Clock settings continue to operate for up to 30 days when the controller is switched off if the battery has been charged for at least six consecutive hours before the contr
196. by clicking OK Note You can display the characteristics of a slave by clicking Details Note You can add and configure slaves that are not part of the Schneider catalog Simply select the private family and configure the new slave TWD USE 10AE 209 Installing the AS Interface bus Description of the debug screen At a Glance When the PC is connected to the controller after uploading the application to the controller the Debug tab appears to the right of that of Configuration it allows the debug screen to be accessed The debug screen dynamically provides an image of the physical bus that includes the e List of expected slaves entered during configuration with their name and the list of detected slaves with unknown names but otherwise expected e Status of the AS Interface module and the slave devices e Image of the profile parameters and input output values of the selected slaves It also enables the user e To obtain diagnostics of the slaves on which an error has occurred See Displaying Slave Status p 212 e To modify the address of a slave in online mode See Modification of Slave Address p 213 e To transmit the image of the slaves to the configuration screen See Updating the AS Interface bus configuration in online mode p 215 e To address all the slaves with the desired addresses during the first debugging 210 TWDUSE 10AE Installing the AS Interf
197. c operations are performed as follows aM LD M0 MW0 MW10 100 YMW0 MW 10 100 10 2 LD I0 2 MW0 SQRT MW 10 YMW0 SQRT MW10 10 3 LDR I0 3 P INC MW100 LINC MW 100 TWD USE 10AE 349 Basic Instructions Syntax Overflow and Error Conditions The syntax depends on the operators used as shown in the table below Operator Syntax REM Op1 Op 2 Operator Op3 INC DEC Operator Op1 SQRT 1 Op1 SQRT Op2 ABS 1 Op1 ABS Op2 Operands Type Operand 1 Op1 Operands 2 and 3 Op2 amp 3 1 Words MWi PQWi Immediate value PQWAI SWi MWi KWi INW IW IWAI SQNW QW QWAI gt SWi BLK x Immediate value MDi KDi Double words MDi Note 1 With this operator Op2 cannot be an immediate value The ABS function can only be used with double words MD and KD and floating points MF and KF Consequently OP1 and OP2 must be double words or floating points Addition e Overflow during word operation If the result exceeds the capacity of the result word bit S18 overflow is set to 1 and the result is not significant see Example 1 next page The user program manages bit S18 Note For double words the limits are 2147483648 and 21474836487 Multiplication e Overflow during operation If the result exceeds the capacity of the result word bit S18 overf
198. cations MSG3Function The use of the MSG3 function is identical to that of MSGx used with legacy Block Modbus MSG3 is used to manage data exchanges by providing e Communications error checking e Coordination of multiple messages e Transmission of priority messages The MSGx function block has one input and two outputs associated with it Input Output Definition Description R Reset input Set to 1 re initializes communication or resets block MSGx E 0 and MSGx D 1 MSGx D Communication 0 request in progress complete 1 communication done if end of transmission end character received error or reset of block MSGXx E Error 0 message length OK and link OK 1 if bad command table incorrectly configured incorrect character received speed parity and so on or reception table full TWD USE 10AE 179 Communications EXCHS3 Error Code When an error occurs with the EXCH instruction e bits MSG3 D and MSG3 E are set to 1 and e the Ethernet communication error code is recorded into system word SW65 The following table presents the EXCH error code EXCH3 Error Code recorded into System Word SW65 Standard error codes common to all EXCHx x 1 2 3 0 operation was successful 1 number of bytes to be transmitted is too great gt 128 2 transmission table too small 3 word table too small 4 receive table overflowed 5 time out elapsed Note that
199. cause confusion in interpreting the display of dedicated outputs for PLS or PWM pulses At the time these outputs are sampled their value will always be zero and this value will be displayed Displays and The Operator Display provides the following separate displays with the associated Functions functions you can perform for each display e Controller Identification and State Information Operations Display Display firmware revision and the controller state Change the controller state with the Run Initial and Stop commands e System Objects and Variables Data Display Select application data by the address l Q and all other software objects on the base controller Monitor and change the value of a selected software data object e Serial Port Settings Communication Display Display and modify communication port settings e Time of Day Clock Time Date Display Display and configure the current date and time if the RTC is installed e Real Time Correction RTC Factor Display and modify the RTC Correction value for the optional RTC Note 1 The TWDLCA 40DRF series of compact controllers have RTC onboard 2 On all other controllers time of day clock and real time correction are only available if the Real Time Clock RTC option cartridge TWDXCPRTC is installed 232 TWDUSE 10AE Operator Display Operation Illustration The following illustration shows a view of the Operator Display which con
200. ccount in the configuration screen in fact it is possible to transmit any modification to the configuration screen before transferring the new application to the controller The procedure to follow in order to take the physical configuration into account is the following Step Description 1 Transfer of the desired slave configuration to the configuration screen 2 Acceptance of the configuration in the configuration screen 3 Confirmation of the new configuration 4 Transfer of the application to the module TWD USE 10AE 215 Installing the AS Interface bus Transfer of a In the case when a slave that is not specified in the configuration is detected on the Slave Image to bus an Unknown slave appears in the AS interface V2 Configuration zone of the the debug screen for the detected address Configuration The following table describes the procedure for transferring the image of the Screen Unknown slave to the configuration screen Step Description 1 Access the Debug screen Select the desired slave in the AS interface V2 Configuration zone Right click on the mouse to select Transfer Conf Illustration Configuration AS interface V2 Configuration Std A Slaves B Slaves 00 XVBC21A i 01 02 03 ff asizomrae 04 05 i INOUT24 12 06 WXA36 a 07 08 09 Li 12 Transfer Conf Ctrl T
201. ch TWIDO PID When you open this screen if you are e in offline mode you will go to the General tab by default and will have access to the configuration parameters e in online mode you will go to the Animation tab and will have access to the debugging and adjustment parameters Note In some cases the grayed out tabs and fields may not be accessible for any of the two reasons listed below The PID only operating mode is selected which prevents access to the AT tab parameters that are no longer needed e The operating mode offline or online which is currently active does not allow you to access these parameters e The PID only operating mode is selected which prevents access to the AT tab parameters that are no longer needed The following paragraphs describe the General tab 434 TWD USE 10AE Advanced Instructions General Tab of The screen below is used to enter the general PID parameters the PID Function PID WE PID number lo General Input PID AT Output Animation Trace Operating mode M Configured lv PID States o Word address PID Output PID controller Cancel Previous Next Help TWD USE 10AE 435 Advanced Instructions Description The table below describes the settings that you may define Field Description PID number Specify the PID number that you wish to configure
202. ch connects networks with dissimilar network architectures and which operates at the Application Layer This term may refer to a router Grafcet Grafcet is used to represent the functioning of a sequential operation in a structured and graphic form This is an analytical method that divides any sequential control system into a series of steps with which actions transitions and conditions are associated H Host A node on a network Hub A device which connects a series of flexible and centralized modules to create a network l Init state The operating state of TwidoSoft that is displayed on the Status Bar when TwidoSoft is started or does not have an open application Initialize A command that sets all data values to initial states The controller must be in Stop or Error mode Instance A unique object in a program that belongs to a specific type of function block For example in the timer format TMi i is a number representing the instance TWD USE 10AE 531 Glossary Instruction List A program written in instruction list language IL is composed of a series of language instructions executed sequentially by the controller Each instruction is composed of a line number an instruction code and an operand Internet The global interconnection of TCP IP based computer communication networks IP Internet Protocol A common network layer protocol IP is most often used with TCP IP Address Internet Protocol Address A 32 bit address assign
203. ck does not freeze the timer The timer will continue to increment until it reaches the preset value TMi P At that point the Done bit TMi Q assigned to output Q of the timer block changes state However the associated output wired directly to the block output is not activated and not scanned by the controller Testing by bit TMi Q done bit It is advisable to test bit TMi Q only once in the program Effect of modifying the preset TMi P Modifying the present value by using an instruction or by adjusting the value only takes effect on the next activation of the timer Timers with a 1 The 1 ms time base is only available with the first five timers The four system words ms Time Base SW76 SW77 SW78 and SW79 can be used as hourglasses These four words are decremented individually by the system every millisecond if they have a positive value Multiple timing can be achieved by successive loading of one of these words or by testing the intermediate values If the value of one of these four words is less than O it will not be modified A timer can be frozen by setting the corresponding bit 15 to 1 and then unfrozen by resetting it to 0 TWD USE 10AE 327 Basic Instructions Programming Example The following is an example of programming a timer function block 328 LDR IO0 1 Launching the timer on the ris
204. ck that uses dedicated I O must be configured and then referenced in the application The dedicated I O is only allocated when a function block is configured and not when it is referenced in a program After a function block is configured its dedicated input and output cannot be used by the application or by another function block For example if you configure PLSO you can not use Q0 0 0 in DRO drum controller or in the application logic that is ST Q0 0 0 If a dedicated input or output is needed by a function block that is already in use by the application or another function block this function block cannot be configured For example if you configure FCO as an up counter you can not configure N FCO to use l0 0 2 as capture input Note To change the use of dedicated I O unconfigure the function block by setting the type of the object to not used and then remove references to the function block in your application TWD USE 10AE 373 Advanced Instructions LIFO FIFO Register Function Block Ri Introduction A register is a memory block which can store up to 16 words of 16 bits each in two different ways e Queue First In First Out known as FIFO e Stack Last In First Out know as LIFO illustration The following is an illustration of the register function block Ri R Ee a F TYPE FIFO 0 Register function block 374 TWDUSE 10AE
205. cle the system e Relaunches the task with bits S0 cold start indicator and S13 first cycle in RUN set to 1 e Resets bits S0 and S13 to 0 at the end of this first task cycle e Resets bits S31 S38 and S39 event control indicators and word SW48 number of events executed Processing of a In the event of a cold start if a particular application process is required bit SO Cold Start which is at 1 must be tested during the first cycle of the task Outputs after Once a power outage is detected outputs are set to default fallback status 0 Power Failure When power is restored outputs are at zero until they are updated again by the task TWD USE 10AE 75 Controller Operating Modes Initialization of objects Introduction Cold Start Initialization Initialization of objects identical to cold start on power up using S0 and S1 The controllers can be initialized by Twido Soft by setting system bits S0 a cold restart and S1 a warm restart For a cold start initialization system bit SO must be set to 1 To initialize objects on power up system bit S1 and SO must be set to 1 The following example shows how to program a warm restart object initialization using system bits LD S1 If S1 1 warm restart set S0 to 1 initialize the controller ST S0 These two bits are reset to 0 by the system at the end of the following scan Not
206. company and you have to first press 0 or 9 before the number use this syntax 0 0231858445 or 9 0231858445 Connection management Connection type Timeout Break timeout COM4 MODEM TOSHIBA Internal V 90 0 0231858445 Add Modify Delete OK For international calls the syntax is 19788699001 for example And if you are using a switchboard 0 19788699001 Connection management Connection type i Break timeout COM Serial COM4 DU 0 My Modem 1 MODEM TOSHIBA Internal V 90 0 19788699 5000 20 Add Modify Delete OK 100 TWD USE 10AE Communications Frequently Asked Questions When your communication has been established for a few minutes you can experience some communication errors In this case you must adjust the communication parameters Twidosoft uses a modbus driver to communicate via serial ports or internal modems When communication starts the modbus driver is visible in the toolbar Double click on the modbus driver icon to open the window You now have access to the modbus driver parameters and the runtime tab gives you information on the frames exchanged with the remote controller If the Number of timeouts increases or is other than 0 change the value using Connection management accessible using Twidosoft by clicking File then Preferences and Connection management Click on the timeout fie
207. ct to the 100BASE TX network Ethernet with auto negotiation It can accommodate both 100Mbps and 10 Mbps network speeds Note When connecting the Twido controller to a 1O0OBASE TX network you should use at least a category 5 Ethernet cable TWD USE 10AE 155 Communications IP Addressing Overview This section provides you with information on IP Address notation subnet and gateway concepts as well IP Address An IP address is a 32 bit quantity expressed in dotted decimal notation It consists of four groups of numbers ranging in value from 0 to 255 and separated from one another by a dot For example 192 168 2 168 is an IP address in dotted decimal notation note that this is a reserved IP address provided as an example only On usual networks IP addresses fall into three categories named Class A B and C networks Classes can be differentiated according to the value of their first number which ranges as described in the following table First decimal group IP class 0 127 Class A 128 191 Class B 192 223 Class C IP Subnet Mask An IP address consists of two parts the network ID and the host ID The subnet mask is used to split the network portion of the IP address to artificially create subnetworks with a larger number of host IDs Thus subnetting is used as a means of connecting multiple physical networks to logical networks All devices on the same subnetwork share th
208. ction p 229 instruction which also allows you to exit the mode and return to protected mode When the Data Exchange Off mode is engaged exchanges on the bus continue to function but data is no longer refreshed This mode can only be accessed by using the ASI_CMD See Using the ASI_LCMD Instruction p 226 instruction 230 TWD USE 10AE Operator Display Operation 10 At a Glance Subject of this This chapter provides details for using the optional Twido Operator Display Chapter What s in this This chapter contains the following topics Chapter Topic Page Operator Display 232 Controller Identification and State Information 235 System Objects and Variables 237 Serial Port Settings 244 Time of Day Clock 245 Real Time Correction Factor 246 TWD USE 10AE 231 Operator Display Operation Operator Display Introduction The Operator Display is a Twido option for displaying and controlling application data and some controller functions such as operating state and the Real Time Clock RTC This option is available as a cartridge TWDXCPODC for the Compact controllers or as an expansion module TWDXCPODY for the Modular controllers The Operator Display has two operating modes e Display Mode only displays data e Edit mode allows you to change data Note The operator display is updated at a specific interval of the controller scan cycle This can
209. ction line is added The new line displays suggested default connection settings You will need to change these settings Note To set a new value in a field you have two options e Click once to select the desired field then click the Modify button e Double click the desired field 3 In the Name field enter a descriptive name for the new connection A valid name may contain up to 32 alphnumeric characters 4 In the Connection Type field click to unfold the dropdown list and select TCP IP as you are setting up a new Ethernet connection between your PC anda Ethernet capable Twido controller 5 In the Configuration field enter a valid IP address and Unit ID if any which is the IP information of the Twido TWDLCAE40DRF controller you wish to connect to The IP address and the Unit ID must be seperated by a comma IP Address Enter the static IP address that you have specified for your Twido controller in a previous section Unit ID Leave this part of the field blank unless you are specifically connecting to a Twido controller located across a Bridge on a Modbus serial link 6 Use the default settings in Timeout and Break Timeout fields unless you have specific timeout needs For more details please refer to Ethernet Connections Management p 173 7 Click the OK button to save the new connection settings and close the Connections management dialog box Result The names of all the newly added connections are added t
210. ctions are added to the dropdown list of connections in the File gt Preferences dialog box and in the PLC gt Select a connection Modifying and Existing Ethernet TCP IP connections can be deleted or have their parameters DeletingaTCP IP modified as follows Connection e To delete a connection from the Ethernet management dialogbox click once on the Name of the desired connection and click the Delete button Note that after deletion all the connection parameters are permanently lost e To modify the parameters of an existing connection click once to select the desired field and click the Modify button Then you may start entering the new value in the selected field 174 TWD USE 10AE Communications Ethernet LED Indicators Overview Two Ethernet communications LED indicators are located on the LED panel at the front panel of the TWDLCAE40DRF controller and on the soft front panel accessible via the PLC gt Check PLC path in the TwidoSoft application as well They are label as follows e LAN ACT e LAN ST The Ethernet LEDs provide continuous monitoring of the Ethernet port connections status and diagnostics TWD USE 10AE 175 Communications LED Status The following table describes the status of both LAN ACT and LAN ST Ethernet LED indicators LED State Color Description LAN ACT Off No Ethernet signal on RJ 45 port
211. d Option Hardware gt Add Option TWDNOZ485 TWDNOZ485 Hardware gt Controller Comm Setting Hardware gt Controller Comm Setting Port 2 Port 2 Type Modbus Type Modbus Address 1 Address 2 Baud Rate 19200 Baud Rate 19200 Data 8 Bit Data 8 Bit Parity None Parity None Stop 1 Bit Stop 1 Bit End of Frame 65 End of Frame 65 Response Timeout 10 x 100 ms Response Timeout 100 x 100 ms Frame Timeout 10 ms Frame Timeout 10 ms The port configurations are identical to those in the previous example Step 4 Write the application LD1 LD 1 pF YMW18 16 FFFF MWO 16 010C END MW1 1640007 MW2 1640210 MW3 1640010 MW4 1640002 MW5 1640004 MWG6 1646566 MW7 1646768 LD 1 AND MSG2 D EXCH2 MWO0 11 LD MSG2 E ST Q0 0 END Using TwidoSoft an application program is created for both the master and the slave For the slave write a single memory word MW18 This will allocate space on the slave for the memory addresses from MWO through MW18 Without allocating the space the Modbus request would be trying to write to locations that did not exist on the slave In the master the word table of the EXCH2 instruction is initialized to read 4 bytes to the slave at Modbus address 2 at the address MW16 10 hexadecimal Note Notice the use of the TX offset set in MW1 of the Modbus master application The offset of seven
212. d look at the equipment to become familiar with the device before trying to install operate or maintain it The following special messages may appear throughout this documentation or on the equipment to warn of potential hazards or to call attention to information that clarifies or simplifies a procedure The addition of this symbol to a Danger or Warning safety label indicates A that an electrical hazard exists which will result in personal injury if the instructions are not followed injury hazards Obey all safety messages that follow this symbol to avoid possible injury or death A DANGER DANGER indicates an imminently hazardous situation which if not avoided will result in death serious injury or equipment damage A WARNING WARNING indicates a potentially hazardous situation which if not avoided can result in death serious injury or equipment damage i This is the safety alert symbol It is used to alert you to potential personal A CAUTION CAUTION indicates a potentially hazardous situation which if not avoided can result in injury or equipment damage TWD USE 10AE 11 Safety Information PLEASE NOTE Electrical equipment should be serviced only by qualified personnel No responsi bility is assumed by Schneider Electric for any consequences arising out of the use of this material This document is not intended as an instruction manual for untrained persons As
213. d of frame byte is received or the Reception table is full In this case an error receive table overflowed appears in the word SW63 and SWE64 If a non zero time out is configured reception ends when the time out is completed If a zero time out value is selected there is no reception time out Therefore to stop reception the MSGx R input must be activated The language offers two services for the communication e EXCHx instruction to transmit receive messages e MSGx Function Block to control the message exchanges The Twido controller uses the protocol configured for that port when processing an EXCHx instruction Note Each communications port can be configured for different protocols or the same The EXCHx instruction or MSGx function block for each communications port is accessed by appending the port number 1 or 2 The EXCHx instruction allows the Twido controller to send and or receive information to from ASCII devices The user defines a table of words MWi L or KWi L containing control information and the data to be sent and or received up to 256 bytes in transmission and or reception The format for the word table is described earlier A message exchange is performed using the EXCH x instruction Syntax EXCHx MWi L where x port number 1 or 2 L number of words in the control words and transmission and reception tables The Twido controller must finish the exchange from the first EX
214. d to the PID s measurement branch in 0 10000 format However if you use the default configuration 0 4095 the controller will function correctly Note In order for regulation to operate correctly it is essential that the Twido PLC is in periodic mode The PID function is then executed periodically on each cycle and the PID input data sampling complies with the period set in configuration see table below Details of The following table indicates the different functions available and their scale Available Function Scale and comment Functions Linear conversion of input Allows you to convert a value in 0 to 10000 format analog input module resolution to a value between 32768 and 32767 Proportional gain Using a factor of 100 its value is between 1 and 10000 This corresponds to a gain value varying between 0 01 and 100 Note If you enter an invalid value of gain negative or null gain TwidoSoft ignores this user setting and automatically assigns the default value of 100 to this factor Integral time Using a timebase of 0 1 seconds its value is between 0 and 20000 This corresponds to an integral time of between 0 and 2000 0 seconds Derivative time Using a timebase of 0 1 seconds its value is between 0 and 10000 This corresponds to a derivative time of between 0 and 1000 0 seconds TWD USE 10AE 429 Advanced Instructions Function Scale and comment
215. dated normally 510 TWD USE 10AE System Bits and Words System Bit Function Description Init state Control S10 I O fault Normally set to 1 This bit can be set to 0 by the system when an I O fault is detected 1 S11 Watchdog overflow Normally set to 0 This bit can be setto 1 by the system when the program execution time scan time exceeds the maximum scan time software watchdog Watchdog overflow causes the controller to change to HALT S12 PLC in RUN mode This bit reflects the running state of the controller The systems sets the bit to 1 when the controller is running Or to 0 for stop init or any other state S13 First cycle in RUN Normally at 0 this bit is set to 1 by the system during the first scan after the controller has been changed to RUN S17 Capacity exceeded Normally set to 0 it is set to 1 by the system e During a rotate or shift operation The system switches the bit output to 1 It must be tested by the user program after each operation where there is a risk of an overflow then reset to 0 by the user if an overflow occurs S gt U S18 Arithmetic overflow or error Normally set to 0 It is set to 1 in the case of an overflow when a 16 bit operation is performed that is e Aresult greater than 32 767 or less than 32 768 in single length e Aresult greater than 2 147 483 647 or less than
216. der comments are inserted between the associated List sequences Any labels Li or subroutine declarations SRi are placed on the next line following the header and immediately prior to the List sequence If the List was reversed to Ladder any comments that were ignored will reappear in the List Editor TWD USE 10AE 269 Ladder Language 270 TWD USE 10AE Instruction List Language 12 At a Glance Subject of this This chapter describes programming using Instruction List Language Chapter What s in this This chapter contains the following topics Chapter Topic Page Overview of List Programs 272 Operation of List Instructions 274 List Language Instructions 275 Using Parentheses 278 Stack Instructions MPS MRD MPP 280 TWD USE 10AE 271 Instruction List Language Overview of List Programs Introduction A program written in List language consists of a series of instructions executed sequentially by the controller Each List instruction is represented by a single program line and consists of three components e Line number e Instruction code e Operand s Example ofaList The following is an example of a List program Program 0 LD I0 1 1 ST Q0 3 2 LDN MO 0 LD 10 1 3 ST Q0 2 L Operand s 4 LDR 10 2 5 ST Q0 4 L Instruction Code 6 LDE Al0 3 L Line Number 7 ST Q0 5 Line Number Line numbers are ge
217. device These system words can be used to store the time and date of an event see System Words SW p 517 Note Date and time and also be set by using the optional Operator Display see Time of Day Clock p 245 To date an event it is sufficient to use assignment operations to transfer the contents of system words to internal words and then process these internal words for example transmission to display unit by EXCH instruction The following example shows how to date a rising edge on input l0 1 Example ory LDR lI0 0 0 oy errant DEYS P MWILS SW49 5 MW11 5 SW49 5 Once an event is detected the word table contains Encoding Most significant byte Least significant byte MW11 Day of the week MW12 00 Second YMW13 Hour Minute MW14 Month Day MW15 Century Year Note 1 1 Monday 2 Tuesday 3 Wednesday 4 Thursday 5 Friday 6 Saturday 7 Sunday 418 TWD USE 10AE Advanced Instructions Example of Word Example data for 13 40 30 on Monday 19 April 2002 Table Word Value hex Meaning MW 11 0001 Monday MW12 0030 30 seconds MW13 1340 13 hours 40 minutes MW 14 0419 04 April 19th MW15 2002 2002 Date and time of System words SW54 to SW57 contain the date and time of the last stop and the last stop word SW58 contains the code showing the cause o
218. ding the address of a remote I O It does not know which specific controller is at the address Therefore the master cannot validate that all the remote inputs and outputs used in the user application actually exist Take care that these remote inputs or outputs actually exist Note The remote I O bus and the protocol used is proprietary and no third party devices are allowed on the network CAUTION UNEXPECTED EQUIPMENT OPERATION e Be sure that there is only one master controller on a remote link and that each slave has a unique address Failure to observe this precaution may lead to corrupted data or unexpected and ambiguous results e Be sure that all slaves have unique addresses No two slaves should have the same address Failure to observe this precaution may lead to corrupted data or unexpected and ambiguous results Failure to follow this precaution can result in injury or equipment damage Note The remote link requires an EIA RS 485 connection and can only run on one communications port at a time TWD USE 10AE 105 Communications Hardware A remote link must use a minimum 3 wire EIA RS 485 port It can be configured to Configuration use either the first or an optional second port if present Note Only one communication port at time can be configured as a remote link The table below lists the devices that can be used Remote Port Specificatio
219. do controller the DPT signal on pin 5 must be tied to OV on pin 7 This signifies to the Twido controller that the communications through port 1 is Modbus and is not the protocol used to communicate with the TwidoSoft software 130 TWD USE 10AE Communications The cable connections made to each remote device are shown below Mini DIN connection RS 232 EIA cable Twido Remote controller peripheral TXD RXD GND TXD RXD GND 3 4 7 RS 485 EIA cable Twido Remote Remote controller peripheral F peripheral A B GNDIDPT TAC BC GND TAG BO GND 1 2 7 5 l Terminal block connection Remote Master Remote controller controller controller A B _ OV A B _ OV A B _ OV A B SG Software To configure the controller to use a serial connection to send and receive characters Configuration using the Modbus protocol you must Step Description 1 Configure the serial port for Modbus using TwidoSoft 2 Create in your application a transmission reception table that will be used by the EXCHx instruction Configuring the A Twido controller can use its primary port 1 or an optionally configured port 2 to use Port the Modbus protocol To configure a serial port for Modbus Step Action 1 Define any additi
220. down list Address bit You must then enter in the associated Bit textbox an internal word MWO0O to MW2999 Do not attempt to enter an internal constant or a direct value in the Bit textbox for this will trigger an execution error Limits Bit Specify here whether you want to place limits on the PID output Three options are available Enable Disable or bit address If you have selected bit address you can enable bit to 1 or disable bit to 0 limit management by the program by modifying the associated bit which is either an internal bit MO0 to M255 or an input Ix 0 to lx 32 Min Max Set the high and low limits for the PID output here Note The Min must always be less than the Max Min or Max can be internal words MWO0 to MW2999 internal constants KWO0 to KW255 or a value between 1 and 10000 Manual mode Bit Output Specify here whether you want to change the PID to manual mode Three options are available Enable Disable or bit address If you have selected bit address you can switch to manual mode bit to 1 or switch to automatic mode bit to 0 using the program by modifying the associated bit which is either an internal bit M0 to M255 or an input lx 0 to lx 32 The Output of manual mode must contain the value that you wish to assign to the analog output when the PID is in manual mode This Output can be either a word MWO0 to MW2999 or a direct value in the 0 10000 fo
221. dule at address 3 for the controller base TWD USE 10AE 41 Twido Language Objects Network Addressing Introduction Format Description of Format Application data is exchanged between peer controllers and the master controller on a Twido Remote Link network by using the network words INW and QNW See Communications p 85 for more details Use the following format for network addressing IN QN Ww x A Symbol Object type Format Controller point Word position The table below describes the network addressing format Group Element Value Description Symbol The percent symbol always precedes an internal address Object type IN Network input word Data transfer from master to peer QN Network output word Data transfer from peer to master Format W A16 bit word Controller x 0 Master controller Remote Link master position 1 7 Remote controller Remote Link slave Word j 0 3 Each peer controller uses from one to four words to exchange data with the master controller Examples The table below shows some examples of networking addressing Network object Description INW3 1 Network word number 1 of remote controller number 3 QNWO 3 Network word number 3 of the base controller 42 TWD USE 10AE Twido Language Objects Function Block Objects Introduction Function blocks provide bit
222. e Aim of this This section provides an introduction to advanced function blocks including Section programming examples What s in this This section contains the following topics Section Topic Page Bit and Word Objects Associated with Advanced Function Blocks 370 Programming Principles for Advanced Function Blocks 372 LIFO FIFO Register Function Block Ri 374 LIFO Operation 376 FIFO operation 377 Programming and Configuring Registers 378 Pulse Width Modulation Function Block PWM 381 Pulse Generator Output Function Block PLS 384 Drum Controller Function Block DR 387 Drum Controller Function Block DRi Operation 389 Programming and Configuring Drum Controllers 391 Fast Counter Function Block FC 393 Very Fast Counter Function Block VFC 396 Transmitting Receiving Messages the Exchange Instruction EXCH 408 Exchange Control Function Block MSGx 409 TWD USE 10AE 369 Advanced Instructions Bit and Word Objects Associated with Advanced Function Blocks Introduction Advanced function blocks use similar types of dedicated words and bits as the standard function blocks Advanced function blocks include LIFO FIFO registers R Drum controllers DR Fast counters FC Very fast counters VFC Pulse width modulation output PWM Pulse generator output PLS Shift Bit Register SBR Step counter SC Message control block MSG Objects The table below contains an overview of the words and bits
223. e For example if your application s maximum references for memory words is MW9 then MW0O through MW9 are allocated space MW10 in this example is not valid and can not be accessed either internally or externally 26 TWD USE 10AE Twido Language Objects Bit Objects Introduction List of Operand Bits Bit objects are bit type software variables that can be used as operands and tested by Boolean instructions The following is a list of bit objects e 1 0 bits Step bits Internal bits memory bits System bits Bits extracted from words The following table lists and describes all of the main bit objects that are used as operands in Boolean instructions Type Description Address or Maximum Write value number access 1 Immediate O or 1 False or True Oori values Inputs These bits are the logical lx y z 2 Note 4 No Outputs images of the electrical states of Qx y z 2 Yes the I O They are stored in data memory and updated during each scan of the program logic AS Interface These bits are the logical Note 5 Inputs images of the electrical states of IAX y z No Outputs the I O They are stored in data QAx y z Yes memory and updated during each scan of the program logic Internal Internal bits are internal memory Mi 128 Yes Memory areas used to store intermediary TWDLCeA10 values while a program is DRF running TWDLCeA16 Note Unused I O bits can not be DRF u
224. e IN ae vane cos ae Tea Nay yh Pelee s l a Timebase i ae i i VFCO V n fe o i fT i oele O The first frequency measurement starts here The current frequency value is updated Input IN is 1 and input S is 1 Change VFCO T to 100 ms this change cancels the current measurement and starts another one The following table shows a list of special operating of the VFC function block Special case Description Effect of cold restart S0 1 Resets all the VFC attributes with the values configured by the user or user application Effect of warm restart S1 1 Has no effect Effect of Controller stop The VFC stops its function and the outputs stay in their current state TWD USE 10AE 407 Advanced Instructions Transmitting Receiving Messages the Exchange Instruction EXCH Introduction A Twido controller can be configured to communicate with Modbus slave devices or can send and or receive messages in character mode ASCII TwidoSoft provides the following functions for these communications e EXCH instruction to transmit receive messages e Exchange control function block MSG to control the data exchanges The Twido controller uses the protocol configured for the specified port when processing an EXCH instruction Each communication port can be assigned a different protocol The communication ports are accessed by appending the por
225. e Do not set S0 to 1 for more than one controller scan 76 TWD USE 10AE Event task management In Brief At a Glance This chapter describes event tasks and how they are executed in the controller Note Event tasks are not managed by the Twido Brick 10 controller TWDLCAA10DRF What s in this This chapter contains the following topics Chapter Topic Page Overview of event tasks 78 Description of different event sources 79 Event management 81 TWD USE 10AE 77 Event task management Overview of event tasks Introduction Description of an Event The previous chapter presented periodic See Periodic Scan p 64 and cyclic See Cyclic Scan p 62 tasks in which objects are updated at the start and end of the task Event sources may cause a certain task to be stopped while higher priority event tasks are executed to allow objects to be updated more quickly An event task e is apart of a program executed when a given condition is met event source e has a higher priority than the main program e guarantees a rapid response time enabling the overall response time of the system to be reduced An event is composed of e an event source which can be defined as a software or hardware interrupt condition to interrupt the main program See Description of different event sources p 79 e a section which is a independent programmed entity related
226. e creation of a connection E TwidoSoft no heading O x File Edit Display Tools Hardware Software Program PLC Window Help C A ERA Connect Disconnect v COM Change modem configuration COM4 Check PLC My mode RUN STOP Ctri F5 Init Transfer PC gt Controller Protect the application Memory Usage Backup Restore Erase 4 Connect TwidoSoft Note If you want to use your modem connection all the time click file preferences and select my modem or the name you have given it Twidosoft will now memorize this preference Operating Modes The Twido controller sends the initialization string to the connected powered up modem When a modem is configured in the Twido application the controller first sends an FF command to establish whether the modem is connected If the controller receives an answer the initialization string is sent to the modem TWD USE 10AE 99 Communications Internal External If you are communicating with a Twido controller within your company premises you and International can use just the line extension needed to dial such as 8445 Calls Connection management Name Connection type Phone Timeout Break timeout COM1 Serial COM1 5000 1 20 COM4 Serial COM4 000 0 My Modem 1 MODEM TOSHIBA Internal V 90 8445 5000 20 Add Modify Delete OK If you are using an internal switchboard to dial telephone numbers outside your
227. e one row by four columns TWD USE 10AE 259 Ladder Language Special Ladder Instructions OPEN and SHORT Introduction The OPEN and SHORT instructions provide a convenient method for debugging and troubleshooting Ladder programs These special instructions alter the logic of a rung by either shorting or opening the continuity of a rung as explained in the following table Instruction Description List Instruction OPEN Creates a break in the continuity of a ladder AND 0 rung regardless of the results of the last logical operation SHORT Allows the continuity to pass through the OR 1 rung regardless of the results of the last logical operation In List programming the OR and AND instructions are used to create the OPEN and SHORT instructions using immediate values of 0 and 1 respectively Examples The following are examples of using the OPEN and SHORT instructions 10 1 M3 QO0 1 LD 10 1 OPEN OR QI1 5 a ANDN M3 Q1 5 AND 0 ST Q0 1 10 9 Q1 6 LD 10 9 P OR 1 L ST Q1 6 SHORT 260 TWD USE 10AE Ladder Language Programming Advice Handling Program Jumps Programming of Outputs Using Directly Wired Emergency Stop Sensors Handling Power Returns Time and Schedule Block Management Syntax and Error Checking Additional Notes on Using Parentheses Use program j
228. e A peer controller continues in its current state When the master controller enters Stop mode all slave devices continue communicating with the master When the master indicates a Stop is requested then a remote I O controller will Stop but peer controllers will continue in their current Run or Stop state 110 TWD USE 10AE Communications Remote I O Data Access The remote controller configured to be a remote I O does not have or execute its own application program The remote controller s base digital inputs and outputs are a simple extension of the master controller s The application must only use the full three digit addressing mechanism provided Note The module number is always zero for remote I O Illustration Remote Controller Address Modular Number m Channel Number Q2 0 2 17 0 4 To communicate with remote I O the master controller uses the standard input and output notation of l and Q To access the third output bit of the remote I O configured at address 2 instruction Q2 0 2 is used Similarly to read the fifth input bit of the remote I O configured at location 7 instruction I7 0 4 is used Note The master is restricted to accessing only the digital I O that is part of the remote s local I O No analog or expansion I O can be transferred unless you use peer communications TWD USE 10AE 111 Communications Illustration Remote link a Sa
229. e Ethernet Configuration dialogbox see P Address Configure Tab p 164 e if you selected Default IP Address from the IP Configure tab the above table displays the default IP address derived from MAC address of the Twido controller the default subnet and gateway as well e if you selected Configured from the IP Configure tab the above table displays the current IP address subnet and gateway settings that you have previouly entered in the IP Configure tab Note The remaining fields provide information about the current status of the Ethernet connection To find out more information please refer to See TwdoSOFT 160 TWD USE 10AE Communications Private IP Addresses Assigning an IP Address to your Controller If your network is stand alone isolated from the Internet you may therefore assign to your network node Twido controller any arbitrary IP address as long as the IP address conforms to the IANA notation rule and it doesn t conflict with the IP address of another device already connected to the network Privates IP addresses meet the need for arbitrary IP addressing over a stand alone network Note that addresses within this private address space will only be unique within the enterprise The following table outlines the private IP address space Network Valid range for private IP addresses Class A 10 0 0 0 gt 10 255 255 255 Class B 172 16 0 0 gt 172 31 255 255 Class C 192 168 0
230. e PID input parameters PID Function PID 2X PID number lo a General Input PID AT Output Animation Trace m Measure p Conversion Alarms Authorize Authorize Min value Low Output Max value High Output PID Output a PID controller Cancel Previous Next Help TWD USE 10AE 437 Advanced Instructions Description The table below describes the settings that you may define Field Description PID number Specify the PID number that you wish to configure here The value is between 0 and 13 14 PID maximum per application Measurement Specify the variable that will contain the process value to be controlled here The default scale is 0 to 10000 You can enter either an internal word MWO to MW2999 or an analog input IWx 0 to IWx 1 Conversion Check this box if you wish to convert the process variable specified as a PID input If this box is checked both the Min value and Max value fields are accessible The conversion is linear and converts a value between 0 and 10 000 into a value for which the minimum and maximum are between 32768 and 32767 Min value Specify the minimum and maximum of the conversion scale The Max value process variable is then automatically rescaled within the Min value to Max value interval Note The Min value must always be less
231. e and double words This type of addressing enables series of objects of the same type such as internal words and constants to be scanned in succession by modifying the content of the index object via the program 48 TWD USE 10AE Twido Language Objects Index Overflow system bit S20 An overflow of the index occurs when the address of an indexed object exceeds the limits of the memory zone containing the same type of object In summary e The object address plus the content of the index is less than 0 e The object address plus the content of the index is greater than the largest word directly referenced in the application The maximum number is 2999 for words MWi or 255 for words KWi In the event of an index overflow the system sets system bit S20 to 1 and the object is assigned an index value of 0 Note The user is responsible for monitoring any overflow Bit S20 must be read by the user program for possible processing The user must confirm that it is reset to 0 S20 initial status 0 e On index overflow set to 1 by the system e Acknowledgment of overflow set to 0 by the user after modifying the index TWD USE 10AE 49 Twido Language Objects Symbolizing Objects Introduction Example Guidelines for Defining Symbols Editing Symbols You can use Symbols to address Twido software language objects by name or customized mnemonics Using symbols allows for
232. e devices to communicate using those formats PWM Pulse Width Modulation A function block that generates a rectangular wave with a variable duty cycle that can be set by a program 534 TWDUSE 10AE Glossary RAM Real time clock Reflex output Registers Remote controller Remote link Resource manager Reversible instructions Router RTC RTU Random Access Memory Twido applications are downloaded into internal volatile RAM to be executed An option that will keep the time even when the controller is not powered for a limited amount of time In a counting mode the very fast counter s current value VFC V is measured against its configured thresholds to determine the state of these dedicated outputs Special registers internal to the controller dedicated to LIFO FIFO function blocks A Twido controller configured to communicate with a Master Controller on a Remote Link network High speed master slave bus designed to communicate a small amount of data between a Master Controller and up to seven Remote Controllers slaves There are two types of Remote Controllers that can be configured to transfer data to a Master Controller a Peer Controller that can transfer application data or a Remote I O Controller that can transfer I O data A Remote link network can consist of a mixture of both types A component of TwidoSoft that monitors the memory requirements of an application during programming and configu
233. e following table describes the procedure for accessing the PID configuration screens Step Action 1 Check that you are in offline mode 2 Open the browser Result TwidoSoft no heading File Edit Display Tools Hardware Software ST ERCOLA xxl E79 no heading ff TWDLMDA40DUK Hardware i Software Port 1 Remote Link 1 Expansion bus Constants Counters Drum controllers Fast Counters LIFO FIFO registers PLS PWM Schedule blocks Timers Very fast counters KI Symbols nl Programs Animation tables vse g Documentation 432 TWD USE 10AE Advanced Instructions Step Action Double click on PID Result The PID configuration window opens and displays the General See General tab of PID function p 434 tab by default Note You can also right click on PID and select the Edit option or select Software PID from the menu or use the Program Configuration Editor PID Icon menu or if using the latter method select the PID and click on the Magnifying glass icon to select a specific PID TWD USE 10AE 433 Advanced Instructions General tab of PID function At a Glance When you open PID from the browser you open the PID configuration window This window allows you to e configure each TWIDO PID e debug ea
234. e internal processing period If the operating time is longer than that allocated to the period the controller indicates that the period has been exceeded by setting the system bit S19 to 1 The process continues and is run completely However it must not exceed the watchdog time limit The following scan is linked in after writing the outputs of the scan in progress implicitly Controller in STOP the processor carries out e Internal processing e Acquisition of input TWD USE 10AE 65 Controller Operating Modes Illustration The following illustration shows the operating cycles Starting the period Vv Internal processing Acquiring inputs RUN stop AVA Program processing Vv Updating outputs Internal processing End of period Check Cycle Two checks are carried out e Period overflow e Watchdog 66 TWD USE 10AE Controller Operating Modes Checking Scan Time General Software WatchDog Periodic or Cyclic Operation Check on Periodic Operation Using Master Task Running Time The task cycle is monitored by a watchdog timer called Tmax a maximal duration of the task cycle It permits the showing of application errors infinite loops and so on and assures a maximal duration for output refreshing In periodic or cyclic operation the triggering of the watchdog causes a software error The applicatio
235. e removed from the response The first byte contains the device address the second byte contains the function code or response code and the rest contain the information associated with that function code Note This is a typical application but does not define all the possibilities No validation of the data being received will be performed except for checksum verification TWD USE 10AE 133 Communications Modbus Slave The Modbus slave mode allows the controller to respond to standard Modbus queries from a Modbus master When the TSXPCX1031 cable is attached to the controller TwidoSoft communications are started at the port temporarily disabling the communications mode that was running prior to the cable being connected The Modbus protocol supports two Data Link Layer formats ASCII and RTU Each is defined by the Physical Layer implementation with ASCII using 7 data bits and RTU using 8 data bits When using Modbus ASCII mode each byte in the message is sent as two ASCII characters The Modbus ASCII frame begins with a start character and can end with two end characters CR and LF The end of frame character defaults to OxOA line feed and the user can modify the value of this byte during configuration The check value for the Modbus ASCII frame is a simple two s complement of the frame excluding the start and end characters Modbus RTU mode does not reformat the message prior to tr
236. e same network ID All devices on the same subnetwork share the same network ID Note If you are part of a large organization then there is a good chance that subnetting is being implemented on your company s networks Check with your network administrator to obtain adequate subnetting information when you are installing your new Twido controller on the existing network 156 TWD USE 10AE Communications Gateway Address The Gateway is the networking device also called router that provides to your network segment access to other network segments on your company s global network access to the Internet or to a remote Intranet The gateway address uses the same dotted decimal notation format as the IP address described above Note Check with your network administrator to obtain adequate gateway information when you are installing your new Twido controller on the existing network TWD USE 10AE 157 Communications Assigning IP Addresses Overview Installation on a Stand alone Network MAC Address and Default IP Address of the This section provides you with information on how to determine which type of IP address you can assign to the Twido TWDLCAE40DRF controller that you wish to install on your network Your Twido TWDLCAE40DRF controller is intended for installation on a stand alone Ethernet network Note A network is called stand alone when it is not linked to
237. e theoretical result the value given will be the value whose low significance bit is equal to 0 In certain cases the result of the rounding can thus take a default value or an excess value For example Rounding of the value 10 5 gt 10 Rounding of the value 11 5 gt 12 490 TWD USE 10AE Advanced Instructions 15 5 Instructions on Object Tables At a Glance Aim of this This section describes instructions specific to tables Section e of double words e of floating point objects Assignment instructions for tables are described in the chapter on basic instructions See Assignment of Word Double Word and Floating Point Tables p 345 What s in this This section contains the following topics Section Topic Page Table summing functions 492 Table comparison functions 494 Table search functions 496 Table search functions for maxi and mini values 498 Number of occurrences of a value in a table 499 Table rotate shift function 500 Table sort function 502 Floating point table interpolation function 503 Mean function of the values of a floating point table 507 TWD USE 10AE 491 Advanced Instructions Table summing functions General The SUM_ARR function adds together all the elements of an object table e if the table is made up of double words the result is given in the form of a double word e if the table is made up of floating words the result is given i
238. e use of offset e The response frame is the same as the request frame here in a normal case e Fora bit to write 1 the associated word in the transmission table must contain the value FFOOH and 0 for the bit to write 0 TWD USE 10AE 145 Communications Modbus Master This table represents Request 06 write were Table Most significant byte Least significant byte Index Control table 0 01 Transmission 06 Transmission length reception 1 00 Reception offset 00 Transmission offset Transmission table 2 Slave 1 247 06 Request code 3 Number of the word to write 4 Word value to write Reception table 5 Slave 1 247 06 Response code after response 6 Number of the word written 7 Value written This byte also receives the length of the string transmitted after response Note e This request does not need the use of offset e The response frame is the same as the request frame here in a normal case 146 TWD USE 10AE Communications Modbus Master Write of N Bits This table represents Request 15 Table Most significant byte Least significant byte Index Control table 0 01 Transmission 8 number of bytes reception transmission 1 00 Reception Offset 07 Transmission offset Transmission table 2 Slave 1 247 15 Request code 3 Number of the first bit to write 4 N4
239. ea as follows QA 1 3A 2 F TWD USE 10AE 241 Operator Display Operation Function Block The function blocks TM C FC VFC PLS PWM DR R and Format MSGij have two part addresses containing an object number and a variable or attribute name They are displayed as follows e Function block name in the upper left e Function block number or instance in the upper right e The variable or attribute in the lower left e Value for the attribute in the lower right In the following example the current value for timer number 123 is set to 1 234 T M 123 V 1234 Simple Format A simple format is used for objects M MW KW MD KD MF KF S SW and X as follows e Object number in the upper right e Signed value for the objects in the lower portion In the following example memory word number 67 contains the value 123 M W 6 7 i 12 3 Network Input The network input output objects YINW and QNW appear in the display area as Output Format follows Object type in the upper left e Controller address in the upper center e Object number in the upper right e Signed value for the object in the lower portion In the following example the first input network word of the remote controller configured at remote address 2 is set to a value 4 I NW 2 O 242 TWD USE 10AE Operator Display Operation Step Counter Format Shift Bit Register Format The step counter SC format displ
240. ed in the status bar There are four operating states Initial Offline Online and Monitor Operator A symbol or code specifying the operation to be performed by an instruction P Packet The unit of data sent across a network PC Personal Computer Peer controller PLC PLS Preferences Program errors viewer Programmable A Twido controller configured as a slave on a Remote Link network An application can be executed in the Peer Controller memory and the program can access both local and expansion I O data but I O data can not be passed to the Master Controller The program running in the Peer Controller passes information to the Master Controller by using network words INW and QNW Twido programmable controller There are two types of controllers Compact and Modular Pulse Generation A function block that generates a square wave with a 50 on and 50 off duty cycle A dialog box with selectable options for setting up the List and Ladder program editors Specialized TwidoSoft window used to view program errors and warnings A Twido controller There are two types of controllers Compact and Modular controller Protection Refers to two different types of application protection password protection which provides access control and controller application protection which prevents all reads and writes of the application program Protocol Describes message formats and a set of rules used by two or mor
241. ed to hosts using TCP IP L Ladder editor Ladder language Ladder list rung Latching input Specialized TwidoSoft window used to edit a Ladder program A program written in Ladder language is composed of graphical representation of instructions of a controller program with symbols for contacts coils and blocks in a series of rungs executed sequentially by a controller Displays parts of a List program that are not reversible to Ladder language Incoming pulses are captured and recorded for later examination by the application LIFO Last In First Out A function block used for stack operations List editor Simple program editor used to create and edit a List program M MAC Address Media Access Control address The hardware address of a device A MAC address Master controller MBAP Memory cartridge is assigned to an Ethernet TCP IP module in the factory A Twido controller configured to be the Master on a Remote Link network Modbus Application Protocol Optional Backup Memory Cartridges that can be used to backup and restore an application program and configuration data There are two sizes available 32 and 64 Kb 532 TWD USE 10AE Glossary Memory usage indicator Modbus Modular controller Monitor state A portion of the Status Bar in the TwidoSoft main window that displays a percentage of total controller memory used by an application Provides a warning when memory is low A master s
242. een eae 177 Built In Analog Functions 0 00 eee ee eee 183 At a Glance ic 252 2 os ee E ee a E a a a ea ta esha rete E ae a 183 Chapter 8 Chapter 9 Chapter 10 Part Ill Chapter 11 Analog potentiometer saasaa anaana 184 Anadlog Ghannel caic cs i ae enana ed aie dea dd haan a A E EE tite toe aes 185 Managing Analog Modules 020202000es 187 Ata Glance ueri ora a a ee eh oe ee ee Se edie 187 Analog Module Overview 0000 eee eee eee eee eens 188 Addressing Analog Inputs and Outputs 0 0 e eee eee 189 Configuring Analog Inputs and Outputs 0 0 0 0 e eee eee 190 Analog Module Status Information 0000 cece eee eee eee 192 Example of Using Analog Modules 20000 eee eee eee 193 Installing the AS Interface V2 bus 00 200eeees 195 At aiGlanCe stoned ot seat ie Sas acl shee eck hd see tay Bae Sts hak Sed rang EA taste 195 Presentation of the AS Interface V2 bus 00 eee e eee eee 196 General functional description 0 0 c eects 197 Software set up principles 2 2 eee 200 Description of the configuration screen for the AS Interface bus 202 Configuration of the AS Interface buS 0c c cece e eee ee 204 Description of the debug screen 0 cc eee eee 210 Modification of Slave Address 00 cee eee eee eee eee 213 Updating the AS Interface bus configuration in onli
243. elected time display using input l0 0 e Push button decrements the selected time display using input l0 1 422 TWD USE 10AE Advanced Instructions The following program reads the inputs from the panel and sets the internal clock MO S59 LD MO ST S59 LD I0 2 Hour 10 2 10 0 SW59 X3 ANDR I0 0 P ST SW59 X3 LD 10 2 ANDR I0 1 10 2 10 1 SW59 X11 oT SW59 X11 P LD 03 Minute ANDR I0 0 10 3 10 0 SW59 X2 ST SW59 X2 P LD 10 3 ANDR I0 1 0 10 3 I0 1 SW59 X10 D aas Second P ANDR I0 0 ST SW59 X1 10 4 10 0 SW59 X1 LD 10 4 P ANDR I0 1 ST SW59 X9 10 4 10 1 SW59 X9 P TWD USE 10AE 423 Advanced Instructions 15 3 PID Function At a Glance Aim of this This section describes the behavior functionalities and implementation of the PID Section function Note To find out quick setup information about your PID controller as well as the PID autotuning please refer to the Twido PID Quick Start Guide available in electronic form on your TwidoSoft installation and documentation CD What s in this This section contains the following topics Section Topic Page Overview 425 Principal of the Regulation Loop 426 Development Methodology of a Regulation Application 427 Compatibilities and Performances 428 Detailed char
244. er values towards the top of the stack The following diagrams are examples of using stack instructions 10 0 M1 I10 1 Q0 0 MPS MRD MPP I10 2 Q0 1 D D Q0 2 SI 10 4 t Q0 3 LD AND MPS AND ST MRD AND ST MRD AND ST MPP AND ST 10 0 M1 1I0 1 Q0 0 10 2 Q0 1 10 3 Q0 2 10 4 Q0 3 280 TWD USE 10AE Instruction List Language Examples of Stack Operation The following diagrams display how stack instructions operate I0 0 I0 1 I0 3 QO0 0 gia FP MO0 M1 QO0 1 I10 4 Q0 2 M10 QO0 3 LD MPS AND MPS AND OR ST MPP ANDN ST MRD AND ST MPP AND ST 10 0 10 1 gt 103 N M0 Q0 0 yoo m QO0 1 10 4 Q0 2 M10 Q0 3 E TWD USE 10AE 281 Instruction List Language 282 TWD USE 10AE Grafcet 13 At a Glance Subject of this This chapter describes programming using Grafcet Language Chapter What s in this This chapter contains the following topics 2 Chapter Topic Page Description of Grafcet Instructions 284 Description of Grafcet Program Struc
245. ernal to the company and not using the entire number just the extension hence only 4 digits for the internal Toshiba V 90 modem telephone number For this test the connection parameters Twidosoft menu preferences then Connection management were established with their default value with a timeout of 5000 and break timeout of 20 e Example 2 Twidosoft connected to TWD LMDA 20DRT windows XP Pro e PC Compag Pentium 4 2 4GHz e Modem Lucent Win modem PCI bus e Twido Controller TWD LMDA 20DRT version 2 0 e Modem connected to Twido Type WESTERMO TD 33 V 90 reference SR1 MOD01 available from the new Twido catalog September 03 see Appendix 2 p 104 e Cable TSX PCX 1031 connected to Twido communication port 1 and an adaptor 9 pin male 9 pin male in order to cross Rx and Tx during connection between the Westermo modem and the Twido controller see Appendix 1 p 103 You can also use the TSX PCX 1130 cable RS485 232 conversion and Rx Tx crossing 102 TWD USE 10AE Communications Appendix 1 Compaq 2 4 GHz Lucent with modem Cable TSX PCX 1031 Crossed adaptor RE Westermo TD 33 aa SRI MODO1 The first test involves using two analog telephone lines internal to the company and not using the entire number just the extension hence only 4 digits for the internal Toshiba V 90 modem telephone number For this test the connection parameters Twidosoft menu prefe
246. error in the AT algorithm the AT numerical output is set to 0 and the following message appears in the List of PID States drop down list Auto tuning complete e AT PID mode The AT is launched first After successful completion of the AT the PID control loop starts based on the Kp TI and Td parameters computed by the AT Note on AT PID If the AT algorithm encounters an error e no PID parameter is computed e the AT numerical output is set to output last applied to the process before start of the autotuning e anerror message appears in the List of PID States drop down list e the PID control is cancelled Note Bumpless transition While in AT PID mode the transition from AT to PID is bumpless As will be explained in the two following sections see Appendix 1 PID Theory Fundamentals p 476 and Appendix 2 First Order With Time Delay Model p 478 the sampling period Ts is a key parameter of the PID control The sampling period can be deduced from the AT time constant 1 There are two methods for evaluating the correct sampling period Ts by using the auto tuning They are described in the following sections e The process response curve method e The trial and error method Both methods are described in the two following subsections This method consists in setting a step change at the control process input and recording the process output curve with time The process response curve method make
247. es Default IP Address Configured IP Address 192 168 1 101 Subnetwork mask 255 255 255 0 Gateway 192 168 1 101 Cancel Help From the IP Address Configure tab select the Configured radio button and start configuring the IP Address Subnetwork mask and Gateway address fields as explained in steps 7 9 Note At this stage we are only dealing with the basic configuration of PC to controller communication over the Ethernet network Therefore you will not need to configure the Marked IP Idle Checking and Remote Devices tabs yet 152 TWD USE 10AE Communications Step Action Enter a valid static IP Address for the Twido controller in dotted decimal notation This IP address must be compatible with that of the PC s IP address that you have configured in the previous section Note The IP addresses of the Twido controller and the PC must share the same network ID However the Twido controller s host ID must be different from the PC s host ID and unique over the network For example if the PC s Class C IP address is 192 168 1 198 then a valid address for the Twido controller is 192 168 1 xxx where 192 168 1 is the network ID and xxx 0 197 199 255 is the host ID Enter a valid Subnetwork mask in dotted decimal notation The Twido controller and the PC running TwidoSoft must be on the same network segment Therefore you mu
248. es OA to 15A TWD USE 10AE 229 Installing the AS Interface bus AS Interface V2 bus interface module operating mode At a Glance Protected Mode Offline Mode Data Exchange Off Mode The AS Interface bus interface module TWDNOI10M3 has three operating modes each of which responds to particular needs These modes are e Protected mode e Offline mode e Data Exchange Off mode Using the ASI_CMD See Presentation of the ASI_CMD Instruction p 226 instruction in a user program allows you to enter or exit these modes The protected operating mode is the mode generally used for an application which is running It assumes that the AS Interface V2 module is configured in TwidoSoft This e continually checks that the list of detected slaves is the same as the list of expected slaves e monitors the power supply In this mode a slave will only be activated if it has been declared in the configuration and been detected At power up or during the configuration phase the Twido controller forces the AS Interface module into protected mode When the module is put into Offline mode it first resets all the slaves present to zero and stops exchanges on the bus When in Offline mode the outputs are forced to zero In addition to using the PB2 button on the TWDNOI10M3 AS Interface module Offline mode can also be accessed via the software by using the ASI_CMD See Programming Examples for the ASI_CMD Instru
249. es correspond to addresses not available here for slave configuration If for example a new standard address setting slave is declared with the address 1A the address 1B is automatically grayed out Slave xxA B Configuration of the selected slave e Characteristics IO code ID code ID1 and ID2 codes profiles and comments on the slave e Parameters list of parameters modifiable in binary 4 check boxes or decimal 1 check box form at the discretion of the user Inputs Outputs list of available I Os and their respective addresses Master mode Activation or deactivation is possible for the two functionalities available for this AS Interface module for example automatic addressing Network down allows you to force the AS Interface bus to enter the offline mode Automatic addressing mode is checked by default Note The Data exchange activation function is not yet available The screen also includes 3 buttons Buttons Description OK Used to save the AS Interface Bus configuration visible on the configuration screen Then return to the main screen The configuration can then be transferred to the Twido controller Cancel Returns to the main screen without acknowledging the changes in progress Help Opens a Help window on screen Note Changes in the configuration screen can only be made in offline mode TWD USE 10AE 203 Insta
250. estoration 70 Programming documenting your program 268 Programming advice 261 Programming grid 252 Programming languages overview 21 Programming Principles 372 Proportional action 472 Protocol Modbus TCP IP 88 Protocols 87 Pulse generation 384 Pulse width modulation 381 Q Queue 374 R RAD_TO_DEG 486 REAL_TO_DINT 488 REAL_TO_INT 488 Real Time correction factor 246 Receiving messages 408 Registers FIFO 377 LIFO 376 programming and configuring 378 Remainder 349 Remote Link Communications 105 Example 115 Hardware configuration 106 Master controller configuration 108 Remote controller configuration 108 Remote controller scan synchronization 109 Remote I O data access 111 Software configuration 108 Remote link Communication 87 RET 364 Reversibility guidelines 266 introduction 265 Reversible programming 372 ROL_ARR 500 ROR_ARR 500 RTC correction 414 Run Stop bit 71 Rung Header 253 comments 269 Rungs unconditional 267 S Scan time 67 Scanning Cyclic 62 Periodic 64 Shift bit register 334 Shift instructions 354 SHORT 260 SIN 484 Single double word conversion instructions 358 Software watchdog 67 SORT_ARR 502 SQRT 481 Square root 349 SR 364 Stack 374 Stack instructions 280 Step counter 336 Subnet mask 156 Subroutine instructions 364 Subtract 349 SUM_ARR 492 Symbolizing 50 System bits 510 System words 517 TWD USE 10AE 545 I
251. eturn to the Controller Identification and State Information screen Only when editing System Objects and Variables that are not the initial entry I0 0 0 will pressing ESC take you to the first or initial system object entry To modify an object value instead of pressing the I push button to go to the first value digit press the MOD ENTER key again 234 TWD USE 10AE Operator Display Operation Controller Identification and State Information Introduction The initial display or screen of the Twido optional Operator Display shows the Controller Identification and State Information Example The firmware revision is displayed in the upper right corner of the display area and the controller state is displayed in the upper left corner of the display area as seen in the following A Controller state R U N 100 oN Firmware revision TWD USE 10AE 235 Operator Display Operation Controller States Displaying and Changing Controller States Controller states include any of the following NCF Not Configured The controller is in the NCF state until an application is loaded No other state is allowed until an application program is loaded You can test the I O by modifying system bit S8 see System Bits S p 510 STP Stopped Once an application is present in the controller the state changes to the STP or Stopped state In this state the application is not runni
252. ew date and time in BCD format see Review of BCD Code p 356 and will correspond to the coding of words SW49 to SW53 The word table must contain the new date and time Encoding Most significant byte Least significant byte MW 10 Day of the week MW 11 Second MW12 Hour Minute MW13 Month Day MW 14 Century Year Note 1 1 Monday 2 Tuesday 3 Wednesday 4 Thursday 5 Friday 6 Saturday 7 Sunday Example data for Monday 19 April 2002 Word Value hex Meaning MW10 0001 Monday SMW 11 0030 30 seconds MW12 1340 13 hours 40 minutes MW13 0419 04 April 19th MW 14 2002 2002 Using SW59 Another method of updating the date and time is to use system bit S59 and date adjustment system word SW59 Setting bit S59 to 1 enables adjustment of the current date and time by word SW59 see System Words SW p 517 YSW59 increments or decrements each of the date and time components on a rising edge TWD USE 10AE 421 Advanced Instructions Application The following front panel is created to modify the hour minutes and seconds of the Example internal clock Hour Minute Second Hours A Minutes pa Seconds Description of the Commands e The Hours Minutes Seconds switch selects the time display to change using inputs 10 2 l0 3 and l0 4 respectively e Push button increments the s
253. f PID function p 452 that allows to view and switch back to one of the 15 latest PID states the Twido PID controller also has the ability to record the current state of both the PID controller and the AT process to a user defined memory word To find out how to enable and configure the PID state memory word MWi see General tab of PID function p 434 The PID state memory word can record any of three types of PID information as follows e Current state of the PID controller PID State e Current state of the autotuning process AT State e PID and AT error codes Note The PID state memory word is read only The following is the PID controller state versus memory word hexadecimal coding concordance table PID State hexadecimal notation Description 0000h PID control is not active 2000h PID control in progress 4000h PID setpoint has been reached 456 TWD USE 10AE Advanced Instructions Description of AT State The autotuning process is divided into 4 consecutive phases Each phase of the process must be fulfilled in order to bring the autotuning to a successful completion The following process response curve and table describe the 4 phases of the Twido PID autotuning PID 2 x PID number lo General Input PID AT Output Animation Trace Morann A E HEAT parameters i l l l l l l l l i Initialize l Detach l l 301
254. f the last stop in BCD format see System Words SW p 517 TWD USE 10AE 419 Advanced Instructions Setting the Date and Time Introduction Using SW49 to SW53 You can update the date and time settings by using one of the following methods e TwidoSoft Use the Set Time dialog box This dialog box is available from the Controller Operations dialog box This is displayed by selecting Controller Operations from the Controller menu e System Words Use system words SW49 to SW53 or system word SW59 The date and time settings can only be updated when the RTC option cartridge TWDXCPRTC is installed on the controller Note that the TWDLCA 40DRPF series of compact controllers have RTC onboard To use system words SW49 to SW53 to set the date and time bit S50 must be set to 1 This results in the following e Cancels the update of words SW49 to SW53 via the internal clock e Transmits the values written in words SW49 to SW53 to the internal clock Programming Example 850 550 RA LD S50 R R R S50 I10 1 P SW49 YMW 10 LDR I10 1 SW49 MW 10 SW50 MW11 SW50 MW11 SW51 MW 12 SWS52 MW13 SW53 MW14 S S50 SWS1 MW12 SW52 MW13 SWS53 MW14 S50 ra S 420 TWD USE 10AE Advanced Instructions Words MW10 to MW14 will contain the n
255. find out if events are lost e SW48 shows how many events have been executed since the last cold start The value of the bits and words is reset to zero on a cold restart or after an application is loaded but remains unchanged after a warm restart In all cases the events queue is reset TWD USE 10AE 81 Event task management 82 TWD USE 10AE Special Functions At a Glance Subject of this This part describes communications built in analog functions managing analog I O Part modules and installing the AS Interface V2 bus for Twido controllers What s in this This part contains the following chapters parng Chapter Chapter Name Page 6 Communications 85 7 Built In Analog Functions 183 8 Managing Analog Modules 187 9 Installing the AS Interface V2 bus 195 10 Operator Display Operation 231 TWD USE 10AE 83 Special Functions 84 TWD USE 10AE Communications At a Glance Subject of this Chapter This chapter provides an overview of configuring programming and managing communications available with Twido controllers TWD USE 10AE 85 Communications What s in this This chapter contains the following topics Chapter Topic Page Presentation of the different types of communication 87 TwidoSoft to Controller communications 89 Communication bet
256. following diagrams provide examples of nesting parentheses 10 0 10 1 00 0 LD 10 0 il it is AND l0 1 ORN I0 2 10 2 M3 AND M3 bale ST Q0 0 LD 10 1 I0 1 10 2 1I0 3 I0 4 QO0 0 AND 10 2 AND I03 OR I0 5 I10 5 10 6 f AND I0 6 10 7 10 8 AND 10 4 OR I0 7 AND I0 8 ST Q0 0 TWD USE 10AE 279 Instruction List Language Stack Instructions MPS MRD MPP Introduction Operation of Stack Instructions Examples of Stack Instructions The Stack instructions process routing to coils The MPS MRD and MPP instructions use a temporary storage area called the stack which can store up to eight Boolean expressions Note These instructions can not be used within an expression between parentheses The following table describes the operation of the three stack instructions Instruction Description Function MPS Memory Push onto stack Stores the result of the last logical instruction contents of the accumulator onto the top of stack a push and shifts the other values to the bottom of the stack MRD Memory Read from stack Reads the top of stack into the accumulator MPP Memory Pop from stack Copies the value at the top of stack into the accumulator a pop and shifts the oth
257. ft Corrector Adapter SZ INPUTS OUTPUTS PLC MEASURE ORDER Process to order SENSORS ACTUATORS 426 TWD USE 10AE Advanced Instructions Development Methodology of a Regulation Application Diagram of the Principal and debugging of a regulation application The following diagram describes all of the tasks to be carried out during the creation Note The order defined depends upon your own work methods and is provided as Y an example PID Application Configuration Configuration of Digital Analog interfaces Application Data Input of constant and mnemonic data and numerical values Programming Ladder List Regulation functions Operator dialogue Y API Connector Transfer of the application in the PLC Animation tables Debugging Debugging Variable table program PC and adjustment y y y File Save Operation Operation of the Storing the of control process via PC application loops Documentation Application folder TWD USE 10AE 427 Advanced Instructions Compatibilities and Performances At a Glance The Twido PID function is a function that is available for Twido version 1 2 and higher which is why its installation is subject to
258. ftware deula kl oe x X E no heading a f i TWDLMDA40DUK Hardware on Port 1 Remote Link 1 oof Expansion bus Software jon Constants oe 32 Counters oe Drum controllers Fast Counters a LIFO FIFO registers IE PLS PWM a 7 Schedule blocks i Timers a 2 Very fast counters in PDEA 2 Programs C Symbols Animation tables mn g Documentation 450 TWD USE 10AE Advanced Instructions Step Action Double click on PID Result The PID configuration window opens and displays the Animation See Animation tab of PID function p 452 tab by default Note You can also right click on PID and select the Edit option or select Software PID from the menu or use the Program Configuration Editor PID Icon menu or if using the latter method select the PID and click on the Magnifying glass icon to select a specific PID TWD USE 10AE 451 Advanced Instructions Animation tab of PID function At a Glance Animation Tab of The tab is used to debug the PID The diagram depends on the type of PID control that you have created Only configured elements are shown The display is dynamic Active links are shown in red and inactive links are shown in black Note It is accessible in online mode
259. function provides automatic tuning of the Kp Ti Td and Direct Reverse Action parameters to achieve optimum convergence of the control process Note For a more in depth explanation of how each of the functions described in the above table works refer to the diagram below 430 TWD USE 10AE Advanced Instructions Operating The following diagram presents the operating principle of the PID function Principles Sampling period y PID CORRECTOR TI SET POINT The Setpoint branch S Integrate rs lt gt Deviat J gt gt SS e f KP SET POINT Z VE S P TD The Measurement branch d dt Derived MEASURE High alarm Conversion The PID action PROCESS MEASUREMENT VALUE Low alarm USED P V The PID operation modes High limit 1 ce AUTO 3 Limiter gt gt e Analog output oO Low limit 0 PWM 0O Manual Modulation period OPERATOR DIALOGUE Twido Soft PC Note The parameters used are described in the table on the page above and in the configuration screens TWD USE 10AE 431 Advanced Instructions How to access the PID configuration At a Glance Procedure The following paragraphs describe how to access the PID configuration screens on TWIDO controllers Th
260. ge LD I3 2 MW5 EQUAL_ARR MD20 7 KD0 7 Structured Text language MWO EQUAL ARR MD20 7 KF0 7 SMW1 EQUAL ARR MF0 5 KF0 5 494 TWDUSE 10AE Advanced Instructions Syntax Example Syntax of table comparison instruction Res EQUAL_ARR Tab1 Tab2 Parameters of table comparison instructions Type Result Res Tables Tab1 and Tab2 Double word tables MWi MDi L KDi L Floating word tables MWi MEFi L KFi L Note e itis mandatory that the tables are of the same length and same type SMW5 EQUAL ARR MD30 4 KDO 4 Comparison of 2 tables Rank Word Table Constant word tables Difference 0 MD30 10 KDO 10 1 MD31 20 KD1 20 2 MD32 30 KD2 60 Different 3 MD33 40 KD3 40 The value of the word MWS5 is 2 different first rank TWD USE 10AE 495 Advanced Instructions Table search functions General There are 3 search functions e FIND_EQR searches for the position in a double or floating word table of the first element which is equal to a given value e FIND_GTR searches for the position in a double or floating word table of the first element which is greater than a given value e FIND_LTR searches for the position in a double or floating word table of the first element which is less than a given value The result of these instructions is equal to the rank of the first element
261. gical value of the bit accumulator result of previous logic The Boolean result of the test elements is applied to the action elements as shown by the following instructions LD I0 0 AND I0 1 ST Q0 0 Boolean test instructions can be used to detect rising or falling edges on the controller inputs An edge is detected when the state of an input has changed between scan n 1 and the current scan n This edge remains detected during the current scan The LDR instruction Load Rising Edge is equivalent to a rising edge detection contact The rising edge detects a change of the input value from 0 to 1 A positive transition sensing contact is used to detect a rising edge as seen in the following diagram 10 0 LDR I0 0 p P Positive transition sensing contact 300 TWD USE 10AE Basic Instructions Falling Edge Detection Edge Detection The LDF instruction Load Falling Edge is equivalent to a falling edge detection contact The falling edge detects a change of the controlling input from 1 to 0 A negative transition sensing contact is used to detect a falling edge as seen in the following diagram LDF I0 0 I10 0 h N Negative transition sensing contact The following table summarizes the instructions and timing for detecting edges Edge Test Ladder Timing diagram Instruct
262. has a structure similar to that of the following example where Op3 8 x X X2 X3 MFO MF4 MF8 MF12 MF2 MF6 MF10 MF14 Y Y1 Y2 Y3 Op3 8 Note As a result of the above floating point array s structure Op3 must meet both of the following requirements or otherwise this will trigger an error of the LKUP function e Op3 is an even number and e Op3 26 for there must be at least 2 data points to allow linear interpolation Interpolation operations are performed as follows 13 2 LD B3 2 MF20 LKUP MFO KW1 MF20 LKUP MF0 K W 1 11 2 MIF22 LKUP MFO 10 LD I1 2 MF22 LKUP MFO 10 TWD USE 10AE 505 Advanced Instructions Example The following is an example use of a LKUP interpolation function SMW20 LKUP SMFO 10 In this example e MW20 is Op1 the output variable e MFO is the user defined X value which corresponding Y value must be computed by linear interpolation e MF2 stores the computed value Y resulting from the linear interpolation e 10 is Op3 as given by equation 3 above It sets the size of the floating point array The highest ranking item MFu where u 18 is given by equation 4 above There are 4 pairs of data points stored in Op3 array MF4 MF 18 e MF4 contains X MFE6 contains Y4 MF8 contains X5 MF10 contains Yo MF 12 contains X3
263. have an Operator Display expansion module TWDNOZ485D 2 Communication module equipped with a 3 wire EIA RS 485 port with a miniDIN connector Note This module is only available for the Modular controllers When the module is attached the controller cannot have an Operator Display expansion module TWDNOZ485T 2 Communication module equipped with a 3 wire EIA RS 485 port with a terminal Note This module is only available for the Modular controllers When the module is attached the controller cannot have an Operator Display expansion module TWD USE 10AE 119 Communications Remote Port Specifications TWDNAC232D 2 Communication adapter equipped with a 3 wire EIA RS 232 port with a miniDIN connector Note This adapter is only available for the Compact 16 24 and 40 I O controllers and the Operator Display expansion module TWDNAC485D 2 Communication adapter equipped with a 3 wire EIA RS 485 port with a miniDIN connector Note This adapter is only available for the Compact 16 24 and 40 I O controllers and the Operator Display expansion module TWDNAC485T 2 Communication adapter equipped with a 3 wire EIA RS 485 port with a terminal Note This adapter is only available for the Compact 16 24 and 40 I O controllers and the Operator Display expansion module TWDXCPODM 2 Operator Display expansion module equipped with a 3 wire EIA RS 232 port with a miniDIN connector a 3
264. he Book 16 TWD USE 10AE Description of Twido Software At a Glance Subject of this This part provides an introduction to the software languages and the basic Part information required to create control programs for Twido programmable controllers What s in this This part contains the following chapters parng Chapter Chapter Name Page 1 Introduction to Twido Software 19 2 Twido Language Objects 25 3 User Memory 51 4 Controller Operating Modes 61 5 Event task management 77 TWD USE 10AE 17 Twido Software 18 TWD USE 10AE Introduction to Twido Software At a Glance Subject of this This chapter provides a brief introduction to TwidoSoft the programming and Chapter configuration software for Twido controllers and to the List Ladder and Grafcet programming languages What s in this This chapter contains the following topics Chapter Topic Page Introduction to TwidoSoft 20 Introduction to Twido Languages 21 TWD USE 10AE 19 Twido Software Languages Introduction to TwidoSoft Introduction TwidoSoft Minimum configuration TwidoSoft is a graphical development environment for creating configuring and maintaining applications for Twido programmable controllers TwidoSoft allows you to create programs with different types of languages See Twido Languages p 21 and then transfer the application to r
265. he current value VFCi V or VFCi VD and stored it in VFCi C or FCi CD The Ica inputs are specified as l0 0 3 for VFCO and l0 0 4 for VFC1 if available When IPres input is active the current value is affected in the following ways e For up counting VFCi V or VFCi VD is reset to 0 e For downcounting VFCi V or VFCi VD is written with the content of VFCi P or VFCi PD respectively e For frequency counting VFCi V or VFCi PD is set to 0 Warning VFCi F is also set to 0 The IPres inputs are specified as 10 0 2 for NVFCO and l0 0 5 for VFC1 if available For all functions the current value is compared to two thresholds VFCi SO or NFCi SOD and VFCi S1 or VFCi S1D According to the result of this comparison two bit objects VFCi THO and VFCi TH1 are set to 1 if the current value is greater or equal to the corresponding threshold or reset to 0 in the opposite case Reflex outputs if configured are set to 1 in accordance with these comparisons Note None 1 or 2 outputs can be configured VFC U is an output of the FB it gives the direction of the associated counter variation 1 for UP 0 for DOWN TWD USE 10AE 401 Advanced Instructions Counting Function Diagram IA Up counter input Single signal or phase 1 IPres P The following is a counting function diagram in standard mode in double word mode you will use the double word function variables accordingly
266. here The value is between 0 and 13 14 PID maximum per application Configured To configure the PID this box must be checked Otherwise no action can be performed in these screens and the PID though it exists in the application cannot be used Operating mode Specify the desired operating mode here You may choose from three operating modes and a word address as follows e PID e AT e AT PID e Word address Word address You may provide an internal word in this text box MWO0O to MW2999 that is used to programmatically set the operating mode The internal word can take three possible values depending on the operating mode you wish to set e MWx 1 to set PID only e MWx 2 to set AT PID e MWx 3 to set AT only PID States If you check to enable this option you may provide a memory word in this text box MW0O to MW2999 that is used by the PID controller to store the current PID state while running the PID controller and or the autotuning function for more details please refer to PID States and Errors Codes p 456 Diagram The diagram allows you to view the different possibilities available for configuring your PID 436 TWD USE 10AE Advanced Instructions Input tab of the PID At a Glance The tab is used to enter the PID input parameters Note It is accessible in offline mode Input tab of the The screen below is used to enter th
267. his value is stored in system word IWO0 0 1 The value is linear through the entire range so that each increment is approximately 20 mV 10 V 512 Once the system detects value 511 the channel is considered saturated Controlling the temperature of an oven The cooking temperature is set to 350 C A variation of 2 5 C results in tripping of output Q0 0 and Q0 2 respectively Practically all of the possible setting ranges of the analog channel from 0 to 511 is used in this example Analog setting for the temperature set points are Temperature C Voltage System Word IW0 0 1 0 0 0 347 5 7 72 395 350 7 77 398 352 5 7 83 401 450 10 511 TWD USE 10AE 185 Built In Analog Functions Code for the above example ae LD _ IW0 0 1 395 0 i ae 7 IW0 0 1 395 J ST Q0 0 out LD IW0 0 1 lt 398 o 7 IWO 0 1 lt 398 ST Q0 1 Q0 2 LD IW0 0 1 gt 401 z 1W0 0 1 gt 401 ST Q02 186 TWD USE 10AE Managing Analog Modules At a Glance Subject of this This chapter provides an overview of managing analog modules for Twido Chapter controllers What s in this This chapter contains the following topics 2 Chapter Topit Page Analog Module Overview 188 Addressing Analog Inputs and Outputs 189 Configuring Analog Inputs and Outputs
268. hts detecting RUN STOP switches etc and processes requests from TwidoSoft modifications and animation l IW_ Acquisition of Writing to the memory the status of discrete and application specific module inputs Program Running the application program written by the user processing Q Updating of Writing output bits or words associated with discrete and QW output application specific modules 62 TWD USE 10AE Controller Operating Modes Operating mode Controller in RUN the processor carries out e Internal processing e Acquisition of input e Processing the application program e Updating of output Controller in STOP the processor carries out e Internal processing e Acquisition of input Illustration The following illustration shows the operating cycles Vv Internal Processing yY Acquiring Inputs RUN STOP W Processing Program Vv Updating Outputs Check Cycle The check cycle is performed by watchdog TWD USE 10AE 63 Controller Operating Modes Periodic Scan Introduction In this operating mode acquiring inputs processing the application program and updating outputs are done periodically according to the time defined at configuration from 2 150 ms At the beginning of the controller scan a timer the value of which is initialized at the period defined at configuration star
269. icated to IB and l0 1 to IA For VFC1 l0 6 is dedicated to IB and I0 7 to IA 398 TWD USE 10AE Advanced Instructions Function Description Values NFC Run time Use Access Enable Reflex Validate Reflex Output 0 0 Disable CM Read and Output 0 1 Enable Write 2 VFCi R Enable Reflex Validate Reflex Output 1 0 Disable CM Read and Output 1 1 Enable Write 2 VFCi S Threshold This word contains the value of threshold 0 The NFCI SO 0 gt CM Read and Value SO meaning is defined during configuration of the function 65535 Write 1 VFCi SO block Note This value must be less than VFCi S1 NFCi SOD 0 VFCi SOD gt 4294967295 Threshold This word contains the value of threshold 0 The NFCI S1 0 gt CM Read and Value S1 meaning is defined during configuration of the function 65535 Write 1 VFCi S1 block Note This value must be greater than VFCi SO VFCi S1D 0 VFCi S1D gt 4294967295 Frequency Configuration item for 100 or 1000 millisecond time base 1000 or 100 FM Read and Measure Time Write 1 Base VFCi T Adjustable Configurable item that when selected allows the user to N No CM or FM No Y N modify the preset threshold and frequency measure Y Yes time base values while running Enter to Used to validate or inhibit the current function 0 No CM or FM Read and enable Write 3 IN Preset input Depending on
270. ication between controllers Network Input INWi j 4 per remote link No Network Output QNWi j 4 per remote link Yes 30 TWD USE 10AE Twido Language Objects Words Description Address or Maximum Write value number access 1 Analog I O Assigned to analog inputs and words outputs of AS Interface slave modules Analog Inputs IWAX y Z Note 3 No Analog Outputs PQWAX Y Z Note 3 Yes Extracted It is possible to extract one of the bits 16 bits from the following words Internal MWi Xk 1500 Yes System SWi Xk 128 Depends oni Constants KWi Xk 64 No Input IWi j Xk Note 2 No Output A QWi j Xk Note 2 Yes AS Interface Slave Input IWAXx y z Xk Note 2 No AS Interface Slave Output QWAx y z X Note 2 Yes k Network Input INWi j Xk Note 2 No Network Output QNWIi j Xk Note 2 Yes Note 1 Written by the program or by using the Animation Tables Editor 2 Number is determined by the configuration 3 Where x address of the expansion module 0 7 y AS Interface address 0A 31B z channel number 0 3 See Addressing I Os associated with slave devices connected to the AS Interface V2 bus p 223 TWD USE 10AE 31 Twido Language Objects Floating point and double word objects Introduction Floating Point Format and Value TwidoSoft allows you to perform operations on fl
271. ice extensions for object access Both Modbus ASCII and RTU are supported in modbus slave mode Note 32 devices without repeaters can be installed on an RS 485 network 1 master and up to 31 slaves the addresses of which can be between 1 and 247 TWD USE 10AE 87 Communications Modbus TCP IP Note Modbus TCP IP is solely supported by TWDLCAE40DRF series of compact controllers with built in Ethernet network interface The following information describes the Modbus Application Protocol MBAP The Modbus Application Protocol MBAP is a layer 7 protocol providing peer to peer communication between programmable logic controllers PLCs and other nodes on a LAN The current Twido controller TWOLCAE40DRF implementation transports Modbus Application Protocol over TCP IP on the Ethernet network Modbus protocol transactions are typical request response message pairs A PLC can be both client and server depending on whether it is querying or answering messages 88 TWD USE 10AE Communications TwidoSoft to Controller communications At a Glance Each Twido controller has on its Port 1 a built in EIA RS 485 terminal port This has its own internal power supply Port 1 must be used to communicate with the TwidoSoft programming software No optional cartridge or communication module can be used for this port A modem however can use this port There are several ways to connect the PC to
272. ied to the process before start of the autotuning AT State Memory The following is the PID controller state versus memory word hexadecimal coding concordance table Word AT State hexadecimal notation Description 0100h Autotuning phase 1 in progress 0200h Autotuning phase 2 in progress 0400h Autotuning phase 3 in progress 0800h Autotuning phase 4 in progress 1000h Autotuning process complete 458 TWD USE 10AE Advanced Instructions PID and AT Error The following table describes the potential execution errors that may be Codes encountered during both PID control and autotuning processes PID AT Error code Processes hexadecimal Description PID Error 8001h Operating mode value out of range 8002h Linear conversion min and max equal 8003h Upper limit for digital output lower than lower limit 8004h Process variable limit out of linear conversion range 8005h Process variable limit less than 0 or greater than 10000 8006h Setpoint out of linear conversion range 8007h Setpoint less than 0 or greater than 10000 8008h Control action different from action determined at AT start Autotuning 8009h Autotuning error the process variable PV limit has been Error reached 800Ah Autotuning error due to either oversampling or output setpoint too low 800Bh Autotuning error Kp is zero 800Ch Autotuning error the time constant is neg
273. ing edge of I0 1 SW76 XXXX XXXX required value LD I10 2 optional management of freeze input 10 2 freezes ST SW76 X15 LD SW76 0 timer end test ST MO I10 1 SW76 XXXX I10 2 SW76 X15 MO o SW76 0 TWD USE 10AE Basic Instructions Up Down Counter Function Block Ci Introduction The Counter function block Ci provides up and down counting of events These two operations can be done simultaneously Illustration The following is an illustration of the up down Counter function block Ci ADI Y Zz lcu Ci P 9999 CD F Up down counter function block Parameters The Counter function block has the following parameters Parameter Label Value Counter number Ci 0 to 127 Current Value Ci V Word is incremented or decremented according to inputs or instructions CU and CD Can be read and tested but not written by the program Use the Data Editor to modify Ci V Preset value Ci P 0 lt Ci P lt 9999 Word can be read tested and written default value 9999 Edit using the ADJ e Y Yes the preset value can be modified by using Animation Tables the Animation Tables Editor Editor e N No the preset value cannot be modified by using the Animation Tables Editor Reset input or R At state 1 Ci V 0 instruction Reset input or S At state 1 Ci V Ci P instruction Upcount input or CU Increments Ci V o
274. ing up your program into the backup cartridge Step Action 1 Power down the controller Plug in the backup cartridge Powerup the controller AJOJN From the Twido software window bring down the menu under Controller scroll down to Backup and click on it oa Power down the controller Remove backup cartridge from controller Program Restore To load a program saved on a backup cartridge into a controller do the following Step Action 1 Power down the controller Plug in the backup cartridge Powerup the controller If Auto Start is configured you must power cycle again to get to run mode Power down the controller Remove backup cartridge from controller Data MWs Here are the steps for backing up data memory words into the EEPROM Backup Step Action 1 For this to work the following must be true A valid program in RAM The same valid program already backed up into the EEPROM Memory words configured in the program Set SW97 to the length of the memory words to be saved Note Length cannot exceed the configured memory word length and it must be greater than 0 but not greater than 512 Set SW96 X0 to 1 TWD USE 10AE 57 User Memory Data MWs Restore MWs manually by setting system bit S95 to 1 Restore For this to work the following must be true
275. ion YMW12 and MW13 and 4 words to receive data MW14 through MW17 Finally the error status of the MSG2 is sensed and stored on the first output bit on the local base controller I O Additional error checking using SW64 could also be added to make this more accurate Step 5 Initialize the Animation Table Editor Address Current Retained Format 1 MW10 0104 Hexadecimal 2 MW11 0000 Hexadecimal 3 MW12 4F4B Hexadecimal 4 MW13 OAOD Hexadecimal 5 MW14 TW ASCII 6 MW15 ID ASCII 7 MW16 O ASCII 8 MW17 A ASCII The final step is to download this application controller and run it Initialize an Animation Table Editor to animate and display the MW10 through MW17 words On the Terminal Emulator the characters O K CR LF are displayed The characters O K CR LF can be displayed as many times as the EXCH block response timeout has elapsed and the new EXCH block has been started On the Terminal Emulator type T W I D O A This is exchanged with the Twido controller and displayed in the Animation Table Editor 128 TWD USE 10AE Communications Modbus Communications Introduction The Modbus protocol is a master slave protocol that allows for one and only one master to request responses from slaves or to act based on the request The master can address individual slaves or can initiate a broadcast message to all slaves Slaves return a message response to queries that are addressed to
276. ion carried by Byte1 of the transmission and reception tables While Byte1 of the legacy Modbus conveys the serial link address of the slave controller Byte1 of the TCP Modbus carries the Index number of the Modbus TCP client controller The Index number is specified and stored in the Remote Devices table of the TwidoSoft Ethernet Configuration for more details seeRemote Devices Tab p 170 TWD USE 10AE 177 Communications EXCH3 Word The maximum size of the transmitted and or received frames is 128 bytes note that Table this limitation applies to the TCP Modbus client only while the TCP Modbus server supports the standard Modbus PDU length of 256 bytes Moreover the word table associated with the EXCH instruction is composed of the control transmission and reception tables as described below Most significant byte Least significant byte Control table Command Length Transmission Reception Reception Offset Transmission Offset Transmission table Transmitted Byte 1 Index as Transmitted Byte 2 as Modbus specified in the Remote Device serial Table of the TwidoSoft Ethernet Configuration dialogbox Transmitted Byte n Transmitted Byte n 1 Reception table Received Byte 1 Index as Received Byte 2 as Modbus specified in the Remote Device serial Table of the TwidoSoft Ethernet Configuration dialogbox Received Byte p Received Byte p 1 178 TWD USE 10AE Communi
277. ion diagram Rising edge LDR l0 0 Rising edge 10 0 Tan p 10 2 A time gt Boolean T 1 controller result scan time d Falling edge LDF l0 0 eer Falling edge 10 0 n 10 2 y time T Boolean cM result T 1 controller scan time gt Note It is now possible to apply edge instructions to the Mi internal bits TWD USE 10AE 301 Basic Instructions Understanding the Format for Describing Boolean Instructions Introduction Each Boolean instruction in this section is described using the following information e Brief description e Example of the instruction and the corresponding ladder diagram e List of permitted operands e Timing diagram The following explanations provide more detail on how Boolean instructions are described in this section Examples The following illustration shows how examples are given for each instruction 10 1 ST Q0 4 LDF I0 3 ST QO0 5 Ladder diagram equivalents List instructions Permitted The following table defines the types of permitted operands used for Boolean Operands instructions Operand Description 0 1 Immediate value of 0 or 1 l Controller input li j Q Controller output Qi j M Internal bit Mi S System bit Si X Step bit Xi BLK x Function block bit for example TMi Q e Xk Word bit for example MWi Xk Comparison expression for example MWi lt 1000
278. ion of all active steps e Scanning of sequential processing stopped S23 Preset and freeze GRAFCET Normally set to 0 it can only be set to 1 by the program in pre processing e Prepositioning by setting S22 to 1 e Preposition the steps to be activated by a series of S Xi instructions e Enable prepositioning by setting S23 to 1 Freezing a situation e In initial situation by maintaining S21 at 1 by program e Inan empty situation by maintaining S22 at 1 by program In a situation determined by maintaining S23 at 1 TWD USE 10AE 69 Controller Operating Modes Dealing with Power Cuts and Power Restoration Illustration The following illustration shows the various power restarts detected by the system If the duration of the cut is less than the power supply filtering time about 10 ms for an alternating current supply or 1 ms for a direct current supply this is not noticed by the program which runs normally RUN Run Application WV Power outage Standb yy Standby power Power restoration WAIT Power cut gt Auto test detected No Save context OK No Memory card identical Normal execution of program Warm Start Cold Start Note The context is saved in a battery backed up RAM At power up the system checks the state of the battery and
279. ion with the remote I O controller the master sends its local inputs to the remote I O s outputs With the external I O hard wiring of the remote I O the signals are returned and retrieved by the master 118 TWD USE 10AE Communications ASCII Communications Introduction Hardware Configuration ASCII protocol provides Twido controllers a simple half duplex character mode protocol to transmit and or receive data with a simple device This protocol is supported using the EXCHx instruction and controlled using the MSGx function block Three types of communications are possible with the ASCII Protocol e Transmission Only e Transmission Reception e Reception Only The maximum size of frames transmitted and or received using the EXCHx instruction is 256 bytes An ASCII link see system bits S103 and S104 See System Bits S p 510 can be established on either the EIA RS 232 or EIA RS 485 port and can run on as many as two communications ports at a time The table below lists the devices that can be used Remote Port Specifications TWDLCeA10 16 24DRF 1 Base controller equipped with a 3 wire EIA RS 485 port TWDLCA 40DRF with a miniDIN connector TWDLMDA20 40DTK TWDLMDA20DRT TWDNOZ232D 2 Communication module equipped with a 3 wire EIA RS 232 port with a miniDIN connector Note This module is only available for the Modular controllers When the module is attached the controller cannot
280. ional backup cartridge e To delete the contents of the installed optional backup cartridge only A 32 Bit Windows application used for downloading a new Firmware Executive program to a Twido controller Expansion I O Modules connect to the base controller using this bus Optional Expansion I O Modules are available to add I O points to a Twido controller Not all controller models allow expansion Fast counters A function block that provides for faster up down counting than available with the Counters function block A Fast Counter can count up to a rate of 5 KHz FIFO First In First Out A function block used for queue operations Firmware The Firmware Executive is the operating system that executes your applications and executive manages controller operation Forcing Intentionally setting controller inputs and outputs to 0 or 1 values even if the actual values are different Used for debugging while animating a program 530 TWD USE 10AE Glossary Frame Framing types Function block A group of bits which form a discrete block of information Frames contain network control information or data The size and composition of a frame is determined by the network technology being used Two common framing types are Ethernet Il and IEEE 802 3 A program unit of inputs and variables organized to calculate values for outputs based on a defined function such as a timer or a counter G Gateway A device whi
281. iority The other events therefore have Low priority and their order of execution depends on the order in which they are detected To manage the execution order of the event tasks there are two event queues e inone up to 16 High priority events can be stored from the same event source e inthe other up to 16 Low priority events can be stored from other event sources These queues are managed on a FIFO basis the first event to be stored is the first to be executed But they can only hold 16 events and all additional events are lost The Low priority queue is only executed once the High priority queue is empty Each time an interrupt appears linked to an event source the following sequence is launched Step Description 1 Interrupt management recognition of the physical interrupt e event stored in the suitable event queue verification that no event of the same priority is pending if so the event stays pending in the queue Save context Execution of the programming section subroutine labeled SRi linked to the event Updating of output Restore context Before the context is re established all the events in the queue must be executed System bits and words are used to check the events See System Bits and System Words p 509 e S31 used to execute or delay an event e S38 used to decide whether or not to place events in the events queue e S39 used to
282. is of little consequence in the case of an isolated operation as the resulting error is very low Ce but it can have unforeseen consequences where the calculation is repeated E g in the case where the instruction MF2 MF2 MFO is repeated indefinitely If the initial conditions are MFO 1 0 and MF2 0 the value MF2 becomes blocked at 16777216 We therefore recommend you take great care when programming repeated calculations If however you wish to program this type of calculation it is up to the client application to manage truncation errors Operands of arithmetic instructions on floating point Rules of use Operators Operand 1 Op1 Operand 2 Op2 Operand 3 Op3 MFi MFi KFi immediate value MFi KFi immediate value SQRT ABS LOG MFi MFi KFi H EXP LN TRUNC MFi MFi KFi El EXPT MEi MFi KFi MWi KWi immediate value e Operations on floating point and integer values can not be directly mixed Conversion operations See nteger Conversion Instructions lt gt Floating p 488 convert into one or other of these formats e The system bit S18 is managed in the same way as integer operations See Arithmetic Instructions on Integers p 349 the word SW17 See System Words SW p 517 indicates the cause of the fault e When the operand of the function is an invalid number e g logarithm of a negative number it
283. issa tiggq that corresponds to S 63 3 Find out graphically the initial time tinitian that corresponds the start of the process response rise 4 Compute the time constant t of the control process by using the following relationship T tiggeaytinitiay Compute the sampling period Ts based the value of t that you have just determined in the previous step using the following rule Ts 1 75 Note The base unit for the sampling period is 10ms Therefore you should round up down the value of Ts to the nearest 10ms 10 Select Program gt Scan mode edit and proceed as follows 1 Set the Scan mode of the Twido PLC to Periodic 2 Set the Scan Period so that the sampling period Ts is an exact multiple of the scan period using the following rule Scan Period Ts n where n is a positive integer Note You must choose n so that the resulting Scan Period is a positive integer in the range 2 150 ms 462 TWD USE 10AE Advanced Instructions Example of This example shows you how to measure the time constant t of a simple thermal Process process by using the process response curve method described in the previous Response Curve subsection The experimental setup for the time constant measurement is as follows e The control process consists in a forced air oven equipped with a heating lamp e Temperature measurements are gathered by the Twido PLC via a Pt100 probe and temperature da
284. itten Written value must be a decimal immediate value When written the effect takes place on the next execution of the function block Number of steps 1 to 8 default Input to return to step R Reset At state 1 sets the drum controller to step 0 O or instruction Advance input or U Upper Ona rising edge causes the drum controller to instruction advance by one step and updates the control bits Output F Full Indicates that the current step equals the last step defined The associated bit DRi F can be tested for example DRi F 1 if DRi S number of steps configured 1 Control bits Outputs or internal bits associated with the step 16 control bits and defined in the Configuration Editor 388 TWD USE 10AE Advanced Instructions Drum Controller Function Block DRi Operation Introduction Operation Timing Diagram The drum controller consists of e A matrix of constant data the cams organized in eight steps 0 to 7 and 16 data bits state of the step arranged in columns numbered 0 to F e A list of control bits is associated with a configured output Qi j k or memory word Mi During the current step the control bits take on the binary states defined for this step The example in the following table summarizes the main characteristics of the drum controller Column 0 1 2 D o F Control bits Q0 1 Q0 3 Q1 5 Q0 6 Q0 5 Q1 0 0 steps 0 0 1 1 1 0 1 steps 1 0 1 1 0 0 5 s
285. ived error or reset of block MSGx E Error 0 message length OK and link OK 1 if bad command table incorrectly configured incorrect character received speed parity and so on or reception table full It is important to note the following limitations Port 2 presence and configuration RS232 or RS485 is checked at power up or reset Any message processing on Port 1 is aborted when the TwidoSoft is connected EXCHx or MSG can not be processed on a port configured as Remote Link EXCHx aborts active Modbus Slave processing Processing of EXCHx instructions is not re tried in the event of an error TWD USE 10AE 135 Communications e Reset input R can be used to abort EXCHx instruction reception processing e EXCHx instructions can be configured with a time out to abort reception e Multiple messages are controlled via MSGx D Error and If an error occurs when using the EXCHx instruction bits MSGx D and MSGx E Operating Mode are set to 1 and system word SW6s3 contains the error code for Port 1 and Conditions SW64 contains the error code for Port 2 System Use Words SWE3 EXCH1 error code 0 operation was successful 1 number of bytes to be transmitted is too great gt 250 2 transmission table too small 3 word table too small 4 receive table overflowed 5 time out elapsed 6 transmission 7 bad command within table 8 selected port not configured availa
286. je tS ienie oiea Saad hPa eye bees a Mae be ele ek 48 Symbolizing Objects i drenler cect ete eee 50 User MGINIONY oaeee esha ata waa ace Ei ara a eg aru aca ew esa 51 Ata GlanCe sn on setae E edad ancy goa Pe ae A a eara i 51 User Memory Structure 2 0 teens 52 Backup and Restore without Backup Cartridge or Extended Memory 54 Backup and Restore with a 32K Backup Cartridge 000005 56 Using the 64K Extended Memory Cartridge 0 00 cece eee 59 Chapter 4 Controller Operating Modes 0000eeeeeeeeee 61 Chapter 5 Part Il Chapter 6 Chapter 7 AtcaiGlance ssh 2a nae ans ak ok Stan a pled Riga oan Ae ee eat a A 61 Cyclic Scan mcs A alae See e ee ae Cee 62 Periodic Scans asri hag ks ie pied eed bie hid eG te tae 64 Checking Scan Time 6 0 0 cece 67 Operating Modes 0 ccc cette 68 Dealing with Power Cuts and Power Restoration 0200000 70 Dealing with a warm restart 2 6 eee 72 Dealing with a cold start 1 2 eet tee 74 Initialization of objects 1 tees 76 Event task management 00 cess e eee eee eee 77 In Bnielsu Spi u Awe os ee ee ee ee Bede eek Vege te 3 eres 77 Overview of event taSkS 0 0 0 teens 78 Description of different event SourceS 0 000 e eee eee 79 Event management 200 e eee ee ee eee eee eee 81 Special Functions 60645 shied eee oka hee Pee ws 83 Atsa GlanCess 23 oe suas dat cree ETE
287. l ere Pe 480 Arithmetic instructions on floating point 00 eee eee eee 481 Trigonometric Instructions 20 0 0 cee eae 484 Conversion instructions 0 000 cee eee 486 Integer Conversion Instructions lt gt Floating 0 e eee eee 488 Instructions on Object Tables 00 00 c cece eee eee 491 Atiai Glance c 2 4 yrs a teen etek a an Bete se dn ee ee eee 491 Table summing functions sasaaa 492 Table comparison functionS 1 2 0 0 0 e eee ee 494 Table search functions 0 c eee tte 496 Table search functions for maxi and mini values 20 000 498 Number of occurrences of a value in a table 0 eee ee eee 499 Table rotate shift function 0 2 eae 500 Table sort function vciesiaey ccc cv RR eo eo aed 502 Floating point table interpolation function 0 2 0 e eee eee 503 Mean function of the values of a floating point table 507 Chapter 16 System Bits and System Words 00eeeeeeeee 509 AU AUGIANCEsaaceh sedan Serer a A a wate iste eo he eaten ase ade alate 509 system Bits S cic od ee epee bad beheaded e E Doe ahe 510 System Words SW 0 teen eee 517 Glossary ieee reais aed area a ee ae ee ed en a ee aed 527 INGGXS sci ae a DEE RE Ea Oe a ee hale eee 539 10 Safety Information Important Information NOTICE Read these instructions carefully an
288. lave communications protocol that allows one single master to request responses from slaves Type of Twido controller that offers flexible configuration with expansion capabilities Compact is the other type of Twido controller The operating state of TwidoSoft that is displayed on the Status Bar when a PC is connected to a controller in a non write mode N Network Interconnected devices sharing a common data path and protocol for communication Node An addressable device on a communications network O Offline operation Offline state Online operation Online state Operand An operation mode of TwidoSoft when a PC is not connected to the controller and the application in PC memory is not the same as the application in controller memory You create and develop an application in Offline operation The operating state of TwidoSoft that is displayed on the Status Bar when a PC is not connected to a controller An operation mode of TwidoSoft when a PC is connected to the controller and the application in PC memory is the same as the application in controller memory Online operation can be used to debug an application The operating state of TwidoSoft that is displayed on the Status Bar when a PC is connected to the controller A number address or symbol representing a value that a program can manipulate in an instruction TWD USE 10AE 533 Glossary Operating states Indicates the TwidoSoft state Display
289. ld then click the modification button and enter a new higher value The default value is 5000 in milliseconds Try again with a new connection Adjust the value until your connection stabilizes W MODBUS Driver MODBUS01 Configuration Runtime Debug About j Communication ModeRTU Connections ar Frames Sent we Bytes Sent J 458 Frames Received ar Bytes Received 2404 Number of Timeouts Fo Checksum Errors M o Reset Hide TWD USE 10AE 101 Communications Examples e Example 1 Twidosoft connected to a TWD LMDA 20DRT Windows 98 SE e PC Toshiba Portege 3490CT running Windows 98 e Modem internal on PC Toshiba internal V 90 modem e Twido Controller TWD LMDA 20DRT version 2 0 e Modem connected to Twido Type Westermo TD 33 V 90 reference SR1 MOD01 available from the new Twido catalog September 03 see Appendix 2 p 104 e Cable TSX PCX 1031 connected to Twido communication port 1 and an adaptor 9 pin male 9 pin male in order to cross Rx and Tx during connection between the Westermo modem and the Twido controller see Appendix 1 p 103 You can also use the TSX PCX 1130 cable RS485 232 conversion and Rx Tx crossing Toshiba Portege 3490CT Cable Modem integrated TSX PCX 1031 Crossed adaptor Westermo TD 33 Ja SRI MODO1 The first test involves using 2 analog telephone lines int
290. ler state is displayed in the upper left corner of the display area Press the MOD ENTER key to enter edit mode Press the a key to select a controller state 4 Press the MOD ENTER key to accept the modified value or press the ESC key to discard any modifications made while in edit mode 236 TWD USE 10AE Operator Display Operation System Objects and Variables Introduction System Objects and Variables The optional Operator Display provides these features for monitoring and adjusting application data e Select application data by address such as l or Q e Monitor the value of a selected software object variable e Change the value of the currently displayed data object including forcing inputs and outputs The following table lists the system objects and variables in the order accessed that can be displayed and modified by the Operator Display Object Variable Attribute Description Access Input IX Y Z Value Read Force Output QX Y Z Value Read Write Force Timer TMX V Current Value Read Write TMX P Preset value Read Write TMX Q Done Read Counter CX V Current Value Read Write Cx P Preset value Read Write Cx D Done Read CxX E Empty Read CX F Full Read Memory Bit Mx Value Read Write Word Memory MWx Value Read Write Constant Word KWx Value Read System Bit SX Value Read Write System Word SWx Value Read Write Analog Input IW
291. les of use The angle to be converted must be between 737280 0 and 737280 0 for DEG_TO_RAD conversions or between 4096r and 40962 for RAD_TO_DEG conversions For values outside these ranges the displayed result will be 1 NAN the S18 and SW17 X0 bits being set at 1 TWD USE 10AE 487 Advanced Instructions Integer Conversion Instructions lt gt Floating General Four conversion instructions are offered Integer conversion instructions list lt gt floating INT_TO_REAL conversion of an integer word gt floating DINT_TO_REAL double conversion of integer word gt floating REAL_TO_INT floating conversion gt integer word the result is the nearest algebraic value REAL_TO_DINT floating conversion gt double integer word the result is the nearest algebraic value Structure Ladder language MFO INT_TO_REAL MW10 11 8 MD4 REAL_TO_DINT MF9 Instruction List Language LD TRUE MFO INT TO REAL MW10 LD I1 8 MD4 REAL TO DINT MF9 Structured Text language MFO INT TO REAL MW10 IF 11 8 THEN MD4 REAL TO DINT MFQ END_IF 488 TWD USE 10AE Advanced Instructions Syntax Operators and syntax conversion of an integer word gt floating Operators Syntax INT_TO_REAL Op1 INT_TO_REAL Op2 Operands conversion of an integer word gt floating Operand 1 Op1 Oper
292. lling the AS Interface bus Configuration of the AS Interface bus Introduction AS Interface bus configuration takes place in the configuration screen in local mode Once the AS Interface Master and the master modes have been selected configuration of the AS Interface bus consists of configuring the slave devices 204 TWD USE 10AE Installing the AS Interface bus Procedure for Procedure for creating or modifying a slave on the AS Interface V2 bus Declaring ang Step Action Configuring a Slave 1 On the desired address cell not grayed out in the bus image e Double click access to step 3 OR e Right click Result Configure Module TWDNOI10M3 Position 1 Description Master AS Interface expansion modue AS interface V2 configuration Std A Slaves iB Slaves a 00 L XVBC21A 1 02 03 ASI20MT4IE New i Ctrl N Open creo P42 Cut Ctrl X WXA36 Copy Ctrl C Paste Ctrl V Clear Del Accept Con Ctrl A 11 12 13 14 15 16 Ba Note A shortcut menu appears This is used to e Configure a new slave on the bus e Modify the configuration of the desired slave e Copy or Ctrl C cut or Ctrl X paste a slave or Ctrl V e Delete a slave or Del TWD USE 10AE 205 Installing the AS Interface bus Step Action 2 In the sho
293. lock must be used when sending several messages The processing of the EXCHx list instruction occurs immediately with any transmissions started under interrupt control reception of data is also under interrupt control which is considered background processing The use of the MSGx function block is optional it can be used to manage data exchanges The MSGx function block has three purposes Communications error checking The error checking verifies that the parameter L length of the Word table programmed with the EXCHx instruction is large enough to contain the length of the message to be sent This is compared with the length programmed in the least significant byte of the first word of the word table Coordination of multiple messages To ensure the coordination when sending multiple messages the MSGx function block provides the information required to determine when transmission of a previous message is complete Transmission of priority messages The MSGx function block allows current message transmissions to be stopped in order to allow the immediate sending of an urgent message The MSGx function block has one input and two outputs associated with it Input Output Definition Description R Reset input Set to 1 re initializes communication or resets block MSGx E 0 and MSGx D 1 MSGx D Communication 0 request in progress complete 1 communication done if end of transmission end character rece
294. log modules Note You can only modify the parameters offline when you are not connected to a controller Addresses are assigned to the analog channels depending on their location on the expansion bus As a programming aid you can also assign previously defined symbols to manipulate the data in your user application You can configure channel types for the TWDAMO1HT TWDAMMSHT and TWDALMSLT s single output channel to be e Not used e 0 10V e 4 20mA You can configure channel types for the TWDAMI2HT and TWDAMMS3HT s two input channels to be e Not used e 0 10V e 4 20mA CAUTION Equipment damage If you have wired your input for a voltage measurement and you configure TwidoSoft for a current type of configuration you may permanently damage the analog module Ensure that the wiring is in agreement with the TwidoSoft configuration Failure to follow this precaution can result in injury or equipment damage The TWDALM3LT s two input channels can be configured of type Not used Thermocouple K Thermocouple J Thermocouple T PT 100 190 TWD USE 10AE Managing Analog Modules When a channel is configured you can choose to assign units and map the range of inputs according to the following table Range Units Description Normal None Fixed range from a minimum of 0 to a maximum of 4095 Custom None User defined with a minimum of no less than 32768 and
295. low is set to 1 and the result is not significant 350 TWD USE 10AE Basic Instructions Division remainder e Division by 0 If the divider is 0 the division is impossible and system bit S18 is set to 1 The result is then incorrect e Overflow during operation If the division quotient exceeds the capacity of the result word bit S18 is set to 1 Square root extraction e Overflow during operation Square root extraction is only performed on positive values Thus the result is always positive If the square root operand is negative system bit S18 is set to 1 and the result is incorrect Note The user program is responsible for managing system bits S17 and S18 These are set to 1 by the controller and must be reset by the program so that they can be reused see previous page for example Examples Example 1 overflow during addition ae LD MO 0 0 0 o AWO TANAN MW0 MW 1 MW2 S18 LDN S18 MW10 MWO MW 10 MWO0 a LD SI8 MW 10 32767 YOM W 10 32767 R S18 S18 rp By If SYMW1 23241 and MW2 21853 the real result 45094 cannot be expressed in one 16 bit word bit S18 is set to 1 and the result obtained 20442 is incorrect In this example when the result is greater than 32767 its value is fixed at 32767 TWD USE 10AE 351 Basic Instructions Logic Instructions Introduction o
296. low the set of List programming guidelines in Guidelines for Ladder List Reversibility p 266 TWD USE 10AE 265 Ladder Language Guidelines for Ladder List Reversibility Instructions Required for Reversibility Non Equivalent Instructions to Avoid The structure of a reversible function block in List language requires the use of the following instructions e BLK marks the block start and defines the beginning of the rung and the start of the input portion to the block e OUT_BLK marks the beginning of the output portion of the block e END_BLK marks the end of the block and the rung The use of the reversible function block instructions are not mandatory for a properly functioning List program For some instructions it is possible to program in List which is not reversible For a description of non reversible List programming of standard function blocks see Standard function blocks programming principles p 319 Avoid the use of certain List instructions or certain combinations of instructions and operands which have no equivalents in Ladder diagrams For example the N instruction inverses the value in the Boolean accumulator has no equivalent Ladder instruction The following table identifies all List programming instructions that will not reverse to Ladder List Instruction Operand Description JMPCN Li Jump Conditional Not N none Negation Not ENDCN none End Conditional Not
297. mask Switch A controller scans a program and essentially performs three basic functions First it reads inputs and places these values in memory Next it executes the application program one instruction at a time and stores results in memory Finally it uses the results to update outputs Specifies how the controller scans a program There are two types of scan modes Normal Cyclic the controller scans continuously or Periodic the controller scans for a selected duration range of 2 150 msec before starting another scan A function block used to program Date and Time functions to control events Requires Real Time Clock option A computer process that provides services to clients This term may also refer to the computer process on which the service is based A Grafcet step designates a state of sequential operation of automation A command that causes the controller to stop running an application program A physical or logical network within an IP network which shares a network address with other portions of the network A bit mask used to identify or determine which bits in an IP address correspond to the network address and which bits correspond to the subnet portions of the address The subnet mask is the network address plus the bits reserved for identifying the subnetwork A network device which connects two or more separate network segments and allows traffic to be passed between them A switch determines whether a fr
298. me H where e k the static gain computed as the ratio AS AU t the time at 63 rise the time constant 2t the time at 86 rise 3t the time at 95 rise Note When auto tuning is implemented the sampling period Ts must be chosen in the following range t 125 lt Ts lt 1 25 Ideally you should use Ts 1 75 See PID Tuning With Auto Tuning AT p 460 TWD USE 10AE 479 Advanced Instructions 15 4 Floating point instructions At a Glance Aim of this This section describes advanced floating point See Floating point and double word Section objects p 32 instructions in TwidoSoft language The Comparison and Assignment instructions are described in the Numerical Processing p 340 What s in this This section contains the following topics Section S Topic Page Arithmetic instructions on floating point 481 Trigonometric Instructions 484 Conversion instructions 486 Integer Conversion Instructions lt gt Floating 488 480 TWD USE 10AE Advanced Instructions Arithmetic instructions on floating point General These instructions are used to perform an arithmetic operation between two operands or on one operand addition of two operands SQRT square root of an operand subtraction of two operands ABS absolute value of an operand 7 multiplication of two
299. mit and the Output Setpoint Therefore both values must be carefully selected within the allowable range as specified by the process to prevent potential process overload Failure to follow this precaution can result in death serious injury or equipment damage The table below describes the settings that you may define Field Description Authorize Check this box if you wish to enable the AT mode There are two ways to use this checkbox depending on whether you set the operating mode manually or via a word address in the General tab of the PID function e Ifyou set the Operating mode to PID AT or AT from the General tab see General tab of PID function p 434 then the Authorize option is automatically checked and grayed out it cannot be unchecked e f you set the operating mode via a word address MWx MWx 2 PID AT MWx 3 AT then you must check the Authorize option manually to allow configuring the AT parameters Result In either of the above cases all the fields in this AT tab configuration screen become active and you must fill in the Setpoint and Output fields with the appropriate values Process Specify the limit that the measured process variable shall not exceed during the Variable AT process This parameter provides safety to the control system as AT is an PV Limit open loop process This value can be an internal word MWO to a maximum of MW2999 depending on amount of system me
300. more stability deteriorates It is also necessary to find a suitable compromise between speed and stability The influence of integral action on process response to a scale division is as follows A Ti too high Ti correct a Ti too low AC Note A low Ti means a high level of integral action where Kp proportional gain Ti integration time and Td derivative time TWD USE 10AE 473 Advanced Instructions Influence of Derivative action is anticipatory In practice it adds a term which takes account of derivative action the speed of variation in the deviation which makes it possible to anticipate changes by accelerating process response times when the deviation increases and by slowing them down when the deviation decreases The higher the level of derivative action high Td the faster the response A suitable compromise between speed and stability must be found The influence of derivative action on process response to a scale division is as follows A Td too high Td too low Td correct 474 TWD USE 10AE Advanced Instructions Limits of the PID If the process is assimilated to a pure delay first order with a transfer function control loop e H p Kop where t model delay 0 model time constant VOO Me eee eet BAS ee ee es ee ee Measure Mo pM Measure Mg tT The process control performance depends on the ratio 6 T
301. mory available an internal constant KWO to KW255 or a direct value This value must therefore be between 0 and 10000 when conversion is inhibited Otherwise it must be between the Min value and the Max value for the conversion TWD USE 10AE 445 Advanced Instructions Field Description AT Output Specify the AT output value here This is the value of the step change that is setpoint applied to the process This value can be an internal word MWO0 to MW2999 an internal constant KWO to KW255 or a direct value This value must therefore be between 0 and 10000 Note The AT Output Setpoint must always be larger than the output last applied to the process Note When the AT function is enabled constants Y KWx or direct values are no longer allowed only memory words are allowed in the following set of PID fields e Kp Ti and Td parameters must be set as memory words MWx in the PID tab e Action field is automatically set to Address bit in the OUT tab e Bit box must be filled in with an adequate memory bit Mx in the OUT tab Calculated Kp Once tha AT process is complete the calculated Kp Ti and Td PID coefficients Ti Td e are stored in their respective memory words MWx and Coefficients e can be viewed in the Animation tab in TwidoSoft online mode only 446 TWD USE 10AE Advanced Instructions Output tab of the PID At a Glance The tab i
302. mote I O at address 1 and a Peer PLC at address 2 Add Remote Controllers Controller Usage Remote I O Remote Address 1 Controller Usage Peer controller Remote Address 2 For the controller configured as a remote I O verify that the controller communication setup is set to Remote Link and the address is set to 1 Controller comm settings Type Remote link Address 1 For the controller configured as peer verify that the controller communication setup is set to Remote Link and the address is set to 2 Controller comm settings Type Remote link Address 2 Step 5 Write the applications For the Master controller write the following application program LD 1 MWO MWO 1 QNW2 0 MWO MW1 INW2 0 LD 10 0 ST Q1 00 0 LD 11 0 0 ST Q0 0 LD l0 1 ST Q1 0 1 LD 11 0 1 ST Q0 1 For the controller configured as a remote I O do not write any application program For the controller configured as peer write the following application LD 1 QNWO0 0 INWO 0 TWD USE 10AE 117 Communications In this example the master application increments an internal memory word and communicates this to the peer controller using a single network word The peer controller takes the word received from the master and echoes it back In the master a different memory word receives and stores this transmission For communicat
303. n Binary Coded Decimal BCD represents a decimal digit 0 to 9 by coding four binary bits A 16 bit word object can thus contain a number expressed in four digits 0000 9999 and a 32 bit double word object can therefore contain an eight figure number During conversion system bit S18 is set to 1 if the value is not BCD This bit must be tested and reset to 0 by the program BCD representation of decimal numbers Decimal 0 1 2 3 4 5 6 7 8 9 BCD 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 Examples e Word MW5 expresses the BCD value 2450 which corresponds to the binary value 0010 0100 0101 0000 e Word MW12 expresses the decimal value 2450 which corresponds to the binary value 0000 1001 1001 0010 Word MWS5 is converted to word MW12 by using instruction BTI Word MW12 is converted to word MW5 by using instruction ITB Conversion operations are performed as follows MO f LD M0 AMWO BTI AMWIO F XMW0 BTI MW10 eae LD I0 2 MW10 ITB KW9 H MW 10 ITB KW9 356 TWD USE 10AE Basic Instructions Syntax Application Example The syntax depends on the operators used as shown in the table below Operator Syntax BTI ITB Op1 Operator Op2 Operands Type Operand 1 Op1 Operand 2 Op2 Words MWi QWi MWi KWi IW RQWA
304. n e The label can only be placed before a LD LDN LDR LDF or BLK instruction e The label number of label Li must be defined only once in a program e The program jump is performed to a line of programming which is downstream or upstream When the jump is upstream attention must be paid to the program scan time Extended scan time can cause triggering of the watchdog TWD USE 10AE 363 Basic Instructions Subroutine Instructions Introduction The Subroutine instructions cause a program to perform a subroutine and then return to the main program SRn SRn and The subroutines consist of three steps RET e The SRn instruction calls the subroutine referenced by label SRn if the result of the preceding Boolean instruction is 1 e The subroutine is referenced by a label SRn with n 0 to 15 for TWDLCAA10DRF TWDLCAA16DRF and 0 to 63 for all other controllers e The RET instruction placed at the end of the subroutine returns program flow to the main program Example Examples of subroutine instructions 000 LD M15 001 AND MS5 002 ST Q0 0 003 LD YOMW24 gt MW 12 004 SR8 005 LD I10 4 __ 006 AND M13 007 _ 008 _ 009 _ 010 END 011 SR8 _ 012 LD 1 013 IN TMO 014 LD TMO0 Q 015 ST M15 010 RET Jump to subroutine SR8 Return to main subroutine 364 TWD USE 10AE Basic Instructions Guidelines e A subroutine should not call up another
305. n 20000 Computational limit is reached Autotuning error the limit for Td has been exceeded Computed value of derivative time constant Td is greater than 10000 Computational limit is reached 468 TWD USE 10AE Advanced Instructions PID parameter adjustment method Introduction Closed loop adjustment Numerous methods to adjust the PID parameters exist we suggest Ziegler and Nichols which have two variants e closed loop adjustment e open loop adjustment Before implementing one of these methods you must set the PID action direction e if anincrease in the OUT output causes an increase in the PV measurement make the PID inverted KP gt 0 e onthe other hand if this causes a PV reduction make the PID direct KP lt 0 This principal consists of using a proportional command Ti 0 Td 0 to start the process by increasing production until it starts to oscillate again after having applied a level to the PID corrector setpoint All that is required is to raise the critical production level Kpc which has caused the non damped oscillation and the oscillation period Tc to reduce the values giving an optimal regulation of the regulator Measure According to the kind of PID or PI regulator the adjustment of the coefficients is executed with the following values Kp Ti Td PID Kpc 1 7 Tc 2 Tc 8 PI Kpc 2 22 0 83xTc where Kp
306. n Blocks 370 Programming Principles for Advanced Function Blocks 372 LIFO FIFO Register Function Block Ri 0 0 cc eee 374 HRQ Operations sek iz isnt aeiute cs a tact hi AE of stam A age oe atauacere ava 376 FIFO 0peration eis ities dea e x deed peed we ey Oe eee 377 Programming and Configuring Registers 00 c cee eee eee 378 Pulse Width Modulation Function Block PWM 0002e eee eee 381 Pulse Generator Output Function Block PLS 00 0 eee eee 384 Drum Controller Function Block DR 600 0c cece eee eee 387 Drum Controller Function Block DRi Operation 2000 389 Programming and Configuring Drum Controllers 0 000000 391 Fast Counter Function Block FC 000 cee eee 393 Very Fast Counter Function Block VFC 0 000 eee eee eee 396 Transmitting Receiving Messages the Exchange Instruction EXCH 408 Exchange Control Function Block MSGx 0 00 cee eee eee 409 Clock FUNCHONS 005 db ied Baa et bb pee ee ee aieia 413 Ata Glance aco cas E E encanto NE E es tats a noe eee 413 Clock Functions e ein ice ted ted ee ore eh eter a told ead ee i ce 414 Schedule BIOCKS ios ssi seuss aka Gn ee eae ieee ede 415 Time Date Stamping a ce ca eaea cea gar oie oa eae ete ere iar ge i4 418 Setting the Date and Time 1 2 2 0 ct eee 420 PID FUNCOM Send a wees Sov ot ene Dahon Ss Ee ih er dee et end 424
307. n a rising edge instruction TWD USE 10AE 329 Basic Instructions Parameter Label Value Downcount input or CD Decrements Ci V on a rising edge instruction Downcount overflow E Empty The associated bit Ci E 1 when down counter output Ci V changes from 0 to 9999 set to 1 when Ci V reaches 9999 and reset to 0 if the counter continues to count down Preset output reached D Done The associated bit Ci D 1 when Ci V Ci P Upcount overflow F Full The associated bit Ci F 1 when Ci V changes output from 9999 to 0 set to 1 when Ci V reaches 0 and reset to 0 if the counter continues to count up Operation The following table describes the main stages of up down counter operation Operation Action Result Counting A rising edge appears at the The Ci V current value is upcounting input CU or incremented by one unit instruction CU is activated The Ci V current value is equal The preset reached output bit Ci D to the Ci P preset value switches to 1 The Ci V current value The output bit Ci F upcounting changes from 9999 to 0 overflow switches to 1 If the counter continues to count The output bit Ci F upcounting up overflow is reset to zero Downcount A rising edge appears at the The current value Ci V is downcounting input CD or decremented by one unit instruction CD is activated The current value Ci
308. n aborted by peer device 108 connection reset by peer device 109 connection time out elapsed 110 rejection on connection attempt 111 host is down 120 unknown index remote device is not indexed in configuration table 121 fatal MAC Chip Duplicated IP 122 receiving timed out elapsed after data was sent 123 Ethernet initialization in progress oSW67 Function and Contains the following information S type of controller Controller type bits 0 11 8B0 TWDLC eA10DRF 8B1 TWDLCeA16DRF 8B2 TWDLMDA20DUK DTK 8B3 TWDLCeA24DRF 8B4 TWDLMDA40DUK DTK 8B6 TWDLMDA20DRT 8B8 TWDLCAA40DRF 8B9 TWDLCAE40DRF e e Bit 12 13 14 15 not used 0 522 TWD USE 10AE System Bits and Words System Function Description Control Words SW73 AS Interface e Bit 0 Set to 1 if configuration OK S and U and System State e Bit 1 Set to 1 if data exchange enabled SW74 e Bit 2 Set to 1 if module in Offline mode e Bit 3 Set to 1 if ASI_LCMD instruction terminated e Bit 4 Set to 1 error in ASI_CMD instruction in progress SW76 to Down counters 1 These 4 words serve as 1 ms timers They are decremented individually S and U SW79 4 by the system every ms if they have a positive value This gives 4 down counters down counting in ms which is equal to an operating range of 1 ms to 32767 ms Setting bit 15 to 1 can stop decrementation
309. n as many times as necessary TWD USE 10AE 221 Installing the AS Interface bus Automatic replacement of a faulty AS Interface V2 slave Principle When a slave has been declared faulty it can be automatically replaced with a slave of the same type This happens without the AS Interface V2 bus having to stop and without requiring any manipulation since the configuration mode s Automatic addressing utility is active See Automatic addressing of an AS Interface V2 slave p 220 Two options are available e The replacement slave is programmed with the same address using the pocket programmer and has the same profile and sub profile as the faulty slave It is thus automatically inserted into the list of detected slaves LDS and into the list of active slaves LAS e The replacement slave is blank address 0 A new slave and has the same profile as the faulty slave It will automatically assume the address of the replaced slave and will then be inserted into the list of detected slaves LDS and the list of active slaves LAS 222 TWD USE 10AE Installing the AS Interface bus Addressing I Os associated with slave devices connected to the AS Interface V2 bus At a Glance This page presents the details relating to the addressing of digital or analog I Os of slave devices To avoid confusion with Remote I Os new symbols are available with an
310. n available with Counters and Fast Counters function blocks A Very Fast Counter can count up to a rate of 20 KHz WwW Warm restart A power up by the controller after a power loss without changing the application Controller returns to the state which existed before the power loss and completes the scan which was in progress All of the application data is preserved This feature is only available on modular controllers 538 TWD USE 10AE Index Symbols 481 Ci 329 DR 387 FC 393 INW 42 MSG 409 MSG3 function block Instruction 177 PLS 384 PWM 381 QNW 42 S 510 S0 510 S1 510 S10 511 S100 515 S101 515 S103 515 S104 515 S11 511 S110 515 S111 515 S112 515 S113 516 S118 516 S119 516 S12 511 S13 511 S17 511 S18 511 S19 511 S20 512 S21 69 512 S22 69 512 S23 69 512 S24 512 S31 513 S38 513 S39 513 S4 510 S5 510 S50 513 S51 513 S52 514 S59 514 S6 510 S66 514 S69 514 S7 510 S75 514 S8 510 S9 510 S95 514 S96 514 S97 514 SBR 334 SCi 336 SW 517 SWO 517 SW101 524 SW102 524 SW103 525 SW104 525 TWD USE 10AE 539 Index SW105 525 SW106 525 SW11 518 SW111 525 SW112 526 SW113 526 SW114 526 SW118 526 SW120 526 SW17 519 SW18 519 SW19 519 SW30 519 SW31 519 SW32 519 SW48 519 SW49 520 SW50 520
311. n connection attempt 111 host is down 120 unknown index remote device is not indexed in configuration table 121 fatal MAC Chip Duplicated IP 122 receiving timed out elapsed after data was sent 123 Ethernet initialization in progress TWD USE 10AE 181 Communications 182 TWD USE 10AE Built In Analog Functions At a Glance Subject of this This chapter describes how to manage the built in analog channel and Chapter potentiometers What s in this This chapter contains the following topics Chapter Topic Page Analog potentiometer 184 Analog Channel 185 TWD USE 10AE 183 Built In Analog Functions Analog potentiometer Introduction Programming Example Twido controllers have e An analog potentiometer on TWDLC A10DRF TWDLCeA16DREF controllers and on all modular controllers TWDLMDA20DTK TWDLMDA20DUK TWDLMDA20DRT TWDLMDA4O0DTK and TWDLMDA4ODUK e Two potentiometers on the TWDLC A24DRF and TWDLCA 40DRF controllers The numerical values from 0 to 1023 for analog potentiometer 1 and from 0 to 511 for analog potentiometer 2 corresponding to the analog values provided by these potentiometers are contained in the following two input words e IWO 0 0 for analog potentiometer 1 on left e IWO0 0 1 for analog potentiometer 2 on right These words can be used in arithmetic operations They can be used for any type of adjustment for
312. n passes into a HALT state and sets system bit S11 to 1 The relaunching of the task necessitates a connection to Twido Soft in order to analyze the cause of the error modification of the application to correct the error then reset the program to RUN Note The HALT state is when the application is stopped immediately because of an application software error such as a scan overrun The data retains the current values which allows for an analysis of the cause of the error The program stops on the instruction in progress Communication with the controller is open In periodic operation an additional check is used to detect the period being exceeded e S19 indicates that the period has been exceeded It is set to e 1 by the system when the scan time is greater that the task period e 0 by the user e SWO0 contains the period value 0 150 ms It is e Initialized when starting from a cold start by the value selected on the configuration e Able to be modified by the user The following system words are used for information on the controller scan cycle time e SW11 initializes to the maximum watchdog time 10 to 500 ms e SW30 contains the execution time for the last controller scan cycle e SW31 contains the execution time for the longest controller scan cycle since the last cold start e SW32 contains the execution time for the shortest controller scan cycle since the last cold start Note This different i
313. n the form of a floating word Structure Ladder language 13 2 MD5 SUM_ARR MD3 1 NMID5 SUM_ARR KD5 2 MFO SUM_ARR KF8 5 Instruction List Language LD 13 2 MD5 SUM_ARR MD3 1 MD5 SUM_ARR KD5 2 MFO SUM_ ARR KF8 5 Syntax Syntax of table summing instruction Res SUM_ARR Tab Parameters of table summing instruction Type Result res Table Tab Double word tables MDi MDi L KDi L Floating word tables MFi MFi L KFi L Note When the result is not within the valid double word format range according to the table operand the system bit S18 is set to 1 492 TWD USE 10AE Advanced Instructions Example MD5 SUM MD30 4 where MD30 10 MD31 20 MD32 30 MD33 40 MD5 10 20 30 40 100 TWD USE 10AE 493 Advanced Instructions Table comparison functions General The EQUAL _ARR function carries out a comparison of two tables element by element If a difference is shown the rank of the first dissimilar elements is returned in the form of a word otherwise the returned value is equal to 1 The comparison is carried out on the whole table Structure Ladder language 13 2 MW5 EQUAL_ARR MD20 7 KD0 7 MW0 EQUAL_ARR MD20 7 KF0 7 MW1 EQUAL_ARR MF0 5 KF0 5 Instruction List Langua
314. nce st ctx sistance arate boa ie canteen eh E a aie tn ahis bobo us oaks 297 Boolean Processing cece eee eee eee eee 299 Ata Glance niee e ach ed ack ye Ye er Se a ed 299 Boolean INStructions sepr Sesma 4 Ste ee ut ie Wha at eee dd oe ee 300 Understanding the Format for Describing Boolean Instructions 302 Load Instructions LD LDN LDR LDF 2 00000 eee 304 Assignment instructions ST STN R S 0 000 e eee eee eee 306 Logical AND Instructions AND ANDN ANDR ANDF 308 Logical OR Instructions OR ORN ORR ORF 2000 0 eee 310 Exclusive OR instructions KOR XORN XORR XORF 312 NOT Instruction N ecse ie eho eet Pei dita beak Gen teeta 314 Basic Function Blocks 0 00 a a A teens 316 Ata GlanCee ois 62 iho eae dd teil ieee hae bo Bde sh oS 316 Basic Function Blocks 20 0 0 eee tees 317 Standard function blocks programming principles 005 319 Timer Function Block TMi 0 0 0 0 cee eee 321 TOF Type Of Timet erris set aaia See ae th wikis bok ee eee ae 323 TON Type of Timer eisie ere e teens 324 TP Type ot TiMens ce sessy derep eea red cd hee ene ae kyle ag bre akira 46 325 Programming and Configuring Timers 0 00 c cece eee eee 326 Up Down Counter Function Block Ci 0 0 0 0 cee eee 329 14 3 14 4 Chapter 15 15 1 15 2 15 3 Programming and Configuring Co
315. nced functions use and Outputs dedicated inputs and outputs but these bits are not reserved for exclusive use by any single block Rather the use of these dedicated resources must be managed When using these advanced functions you must manage how the dedicated inputs and outputs are allocated TwidoSoft assists in configuring these resources by displaying input output configuration details and warning if a dedicated input or output is already used by a configured function block The following tables summarizes the dependencies of dedicated inputs and outputs and specific functions When used with counting functions Inputs Use 10 0 0 FCO Up Down management or Phase B 10 0 1 FCO Pulse input or Phase A 10 0 2 FCO Pulse input or VFCO pre set input 10 0 3 FC1 Pulse input or VFCO capture input 10 0 4 FC2 Pulse input or VFC1 capture input l0 0 5 FC1 pre set input 10 0 6 FC1 Up Down management or Phase B 10 0 7 VFC1 Pulse input or Phase A 372 TWD USE 10AE Advanced Instructions Using Dedicated Inputs and Outputs When used with counting or special functions Outputs Use Q0 0 0 PLSO or PWMO output Q0 0 1 PLS1 or PWM1 output Q0 0 2 Reflex outputs for VFCO Q0 0 3 Q0 0 4 Reflex outputs for VFC1 Q0 0 5 TwidoSoft enforces the following rules for using dedicated inputs and outputs e Each function blo
316. nd how they are Description controlled System Bit Function Description Init Control state SO Cold Start Normally set to 0 it is set to 1 by 0 S or U gt S e A power return with loss of data battery fault e The user program or Animation Table Editor e Operations Display This bit is set to 1 during the first complete scan It is reset to 0 by the system before the next scan S1 Warm Start Normally set to 0 it is set to 1 by 0 S or U gt S e A power return with data backup e The user program or Animation Table Editor e Operations Display It is reset to 0 by the system at the end of the complete scan S4 S5 S6 S7 Time base 10 ms The rate of status changes is measured by an internal S Time base 100 ms clock They are not synchronized with the controller Time base 1 s scan Time base 1 min Example 84 5ms 5ms S8 Wiring test Initially set to 1 this bit is used to test the wiring when 1 U the controller is in non configured state To modify the value of this bit use the operations display keys to make the required output status changes Set to 1 output reset e Set to 0 wiring test authorized S9 Reset outputs Normally set to 0 It can be set to 1 by the program or 0 U by the terminal in the Animation Table Editor e Atstate 1 outputs are forced to 0 when the controller is in RUN mode e Atstate 0 outputs are up
317. ndex T X TAN 484 XOR 312 Task cycle 67 TCP Client Server 149 TCP IP Protocol 88 TCP IP setup 162 Test Zone 252 Timers 322 introduction 321 programming and configuring 326 time base of 1 ms 327 TOF type 323 TON type 324 TP type 325 TOF timer 323 TON timer 324 TP type timer 325 Trace tab PID 454 Transmitting messages 408 TRUNC 481 TwidoSoft Introduction 20 U Unconditional rungs 267 Unit ID 171 V Very fast counters function block VFC 396 W Warm restart 72 Word Objects 370 Word objects Addressing 37 Overview 29 546 TWD USE 10AE
318. ndex TwidoSoft 34 TWD USE 10AE Twido Language Objects Possibility of Overlap between Objects Single double length and floating words are stored in the data space in one memory zone Thus the floating word MFi and the double word MDi correspond to the single length words MWi and MWi 1 the word MWi containing the least significant bits and the word MWi 1 the most significant bits of the word MFi The following table shows how floating and double internal words overlap Floating Odd Internal and address words Double MFO MWO YeMDO MF1 MW1 MF2 MD1 MW2 MD2 MF3 MW3 MF4 MD3 MW4 MD4 a MW5 MFi MWi MFi 1 MDI MWi 1 MDi 1 The following table shows how floating and double constants overlap Floating Odd Internal and address words Double KFO KWO KDO KF1 eKW1 KF2 KD1 KW2 KD2 KF3 KW3 KF4 KD3 KW4 KD4 KW5 kFi KWi KFi 1 kDi KWi 1 KDi 1 Example MFO corresponds to MW0 and MW1 KF543 corresponds to KW543 and KW544 TWD USE 10AE 35 Twido Language Objects Addressing Bit Objects Syntax Description Bit Objects Extracted from Words Use the following format to address internal system and step bit objects M S or X i symbol lobject type
319. ndexed object address There are two types of object addressing e Direct addressing e Indexed addressing A direct address of an object is set and defined when a program is written Example M26 is an internal bit with the direct address 26 An indexed address of an object provides a method of modifying the address of an object by adding an index to the direct address of an object The content of the index is added to the object s direct address The index is defined by an internal word MWi The number of index words is unlimited Example MW108 MW2 is a word with an address consisting of the direct address 108 plus the contents of word MW2 If word MW2 has a value of 12 writing to MW108 MW2 is equivalent to writing to MW120 108 plus 12 The following are the available types of objects for indexed addressing Type Address Maximum size Write access Internal words MWi MWj Os i MWj lt 3000 Yes Constant words KWi MW Os i MWj lt 256 No Internal double words MDi MWj Os i MWj lt 2999 Yes Double constant KDiI MW Os i MWj lt 255 No words Internal floating MFi MWj Os i MWj lt 2999 Yes points Constant floating KFi gt MWj Os i MWj lt 255 No points Indexed objects can be used with the assignment instructions see Assignment Instructions p 342 for single and double words and in comparison instructions see Comparison Instructions p 347 for singl
320. ne cycle BOT lt Vv Set bit S1 to 0 Vv Update outputs al 72 TWD USE 10AE Controller Operating Modes Restart of the Program Execution Processing of a Warm Start Outputs after Power Failure The table below describes the restart phases for running a program after a warm restart Phase Description 1 The program execution resumes from the same element where it was prior to the power cut without updating the outputs Note Only the same element from the user code is restarted The system code for example the updating of outputs is not restarted At the end of the restart cycle the system e Unreserves the application if it was reserved and provokes a STOP application in case of debugging Reinitializes the messages The system carries out a restart cycle in which it e Relaunches the task with bits S1 warm start indicator and S13 first cycle in RUN set to 1 e Resets bits S1 and S13 to 0 at the end of the first task cycle In the event of a warm start if a particular application process is required bit S1 must be tested at the start of the task cycle and the corresponding program called up Once a power outage is detected outputs are set to default fallback status 0 When power is restored outputs are at last state until they are updated again by the task TWD USE 10AE 73 Controller Operating Modes Dealing with a cold start C
321. ne mode PID tab ofthe PID The screen below is used to enter the internal PID parameters Function PID PID number lo General Input PID AT Output Animation Trace r Setpoint Parameters Sampling period kekoo 10 ms tes 500 Td 0 1 s sd m PID Output Ie PID controller Cancel Previous Next Help TWD USE 10AE 439 Advanced Instructions Description The table below describes the settings that you may define Field Description PID number Specify the PID number that you wish to configure here The value is between 0 and 13 14 PID maximum per application Setpoint Specify the PID setpoint value here This value can be an internal word MWO0 to MW2999 an internal constant KWO to KW255 or a direct value This value must therefore be between 0 and 10000 when conversion is inhibited Otherwise it must be between the Min value and the Max value for the conversion Kp 100 Specify the PID proportional coefficient multiplied by 100 here This value can be an internal word MW0O to MW2999 an internal constant KWO to KW255 or a direct value The valid range for the Kp parameter is 0 lt Kp lt 10000 Note If Kp is mistakenly set to 0 Kp lt 0 is invalid the default value Kp 100 is automatically assigned by the PID function TI 0 1 sec S
322. ne mode 215 Automatic addressing of an AS Interface V2 slave 0 00055 220 How to insert a slave device into an existing AS Interface V2 configuration 221 Automatic replacement of a faulty AS Interface V2 slave 222 Addressing I Os associated with slave devices connected to the AS Interface V2 DUS sles a ee cel a he tee eee au ca hagl tate th RTC Ne one cha ncaa te Anatase ee 223 Programming and diagnostics for the AS Interface V2 bus 225 AS Interface V2 bus interface module operating mode 230 Operator Display Operation 0000 eee e eee eee 231 AttaiGlances 415 2 tinte a tates ancien Samet sto atte ate aA Rtas al Maas 231 Operator Display siset ega Bie thee ia he poke dade boo ete 232 Controller Identification and State Information 20005 235 System Objects and Variables 0 00 e cece eee ee 237 Serial Port Settings 20 0 cece eens 244 Time of Day Clocks riei aie beh eile eden tae ee pee od 245 Real Time Correction Factor 000 cece eee eee eens 246 Description of Twido Languages 247 Ata GIANCess r oot ete tied hte a a a a A aad wee tones meee 247 Ladder Language 00 2c eee eee 249 Ata GIANCC e sisi td exotic eas eh arith a aa wade Mat etnt anes Aw te 249 Introduction to Ladder Diagrams 0 0c eee tees 250 Programming Principles for Ladder Diagrams 2
323. nerated automatically when you enter an instruction Blank lines and Comment lines do not have line numbers Instruction Code The instruction code is a symbol for an operator that identifies the operation to be performed using the operand s Typical operators specify Boolean and numerical operations For example in the sample program above LD is the abbreviation for the instruction code for a LOAD instruction The LOAD instruction places loads the value of the operand l0 1 into an internal register called the accumulator There are basically two types of instructions e Test instructions These setup or test for the necessary conditions to perform an action For example LOAD LD and AND e Action instructions These perform actions as a result of setup conditions For example assignment instructions such as STORE ST and RESET R 272 TWD USE 10AE Instruction List Language Operand An operand is a number address or symbol representing a value that a program can manipulate in an instruction For example in the sample program above the operand l0 1 is an address assigned the value of an input to the controller An instruction can have from zero to three operands depending on the type of instruction code Operands can represent the following e Controller inputs and outputs such as sensors push buttons and relays e Predefined system functions such as timers and counters e Arithmetic logical comparison and
324. nfigured by the user or user application Effect of warm restart S1 1 Has no effect Effect of Controller stop The FC continues to count with the parameter settings enabled at the time the controller was stopped TWD USE 10AE 395 Advanced Instructions Very Fast Counter Function Block VFC Introduction The Very Fast Counter function block VFC can be configured by TwidoSoft to perform any one of the following functions e Up down counter e Up down 2 phase counter Single Up Counter e Single Down Counter e Frequency Meter The VFC supports counting of digital input up to frequencies of 20kHz in single word or double word computational mode The TWDLCA 40DRF Compact controllers can accomodate up to two very fast counters while all other series of Compact controllers can configure one very fast counter VFC Modular controllers can configure up to two very fast counters VFC 396 TWD USE 10AE Advanced Instructions Dedicated I O Assignments The Very Fast Counter function blocks VFC use dedicated inputs and auxiliary inputs and outputs These inputs and outputs are not reserved for their exclusive use Their allocation must be considered with the use of other function blocks for these dedicated resources The following array summarizes these assignments Main inputs Auxiliary inputs Reflex outputs FCO
325. nformation can also be accessed from the configuration editor TWD USE 10AE 67 Controller Operating Modes Operating Modes Introduction Starting through Grafcet Twido Soft is used to take into account the three main operating mode groups e Checking e Running or production e Stopping These different operating modes can be obtained either starting from or using the following Grafcet methods e Grafcet initialization e Presetting of steps e Maintaining a situation e Freezing charts Preliminary processing and use of system bits ensure effective operating mode management without complicating and overburdening the user program 68 TWD USE 10AE Controller Operating Modes Grafcet System Use of bits S21 S22 and S23 is reserved for preliminary processing only Bits These bits are automatically reset by the system They must be written by Set Instruction S only The following table provides Grafcet related system bits Bit Function Description S21 GRAFCET initialization Normally set to 0 it is set to 1 by acold start S0 1 e The user in the pre processing program part only using a Set Instruction S S21 or a set coil S S21 Consequences e Deactivation of all active steps e Activation of all initial steps S22 GRAFCET RESET Normally set to 0 it can only be set to 1 by the program in pre processing Consequences e Deactivat
326. ng Inputs are updated and data values are held at their last value Outputs are not updated in this state INI Initial You can choose to change the controller to the INI or initial state only from the STP state The application is not running The controller s inputs are updated and data values are set to their initial state No outputs are updated from this state RUN Running When in the RUN or running state the application is running The controller s inputs are updated and data values are set according to the application This is the only state where the outputs are updated HLT Halted User Application Error If the controller has entered an ERR or error state the application is halted Inputs are updated and data values are held at their last value From this state outputs are not updated In this mode the error code is displayed in the lower right portion of the Operator Display as an unsigned decimal value NEX Not Executable not executable An online modification was made to user logic Consequences The application is no longer executable It will not go back into this state until all causes for the Non Executable state have been resolved Using the Operator Display you can change to the INI state from the STP state or from STP to RUN or from RUN to STP Do the following to change the state of the controller Step Action 1 Press the D key until the Operations Display is shown or press ESC The current control
327. ng Twidosoft can be connected to a Twido controller for transferring applications animating objects and executing operator mode commands It is also possible to connect a Twido controller to other devices such as another Twido controller for establishing communication with the application process All modems the user wishes to use with Twidosoft must be installed running Windows from your PC To install your modems running Windows follow the Windows documentation This installation is independent from Twidosoft The default communication connection between Twidosoft and the Twido controller is made by a serial communication port using the TSX PCX 1031 cable anda crossed adaptater see Appendix 1 p 103 If a modem is used to connect the PC this must be indicated in the Twidosoft software To select a connection using Twidosoft click file then preferences TWD USE 10AE 95 Communications Preferences Default Program Editor __List Ladder Animation _ F List Hex Ladder Decimal _ Cancel _ 7 7 Hel Ladder Information ___ Display Attributes Hap 1line f Symbols C 3 lines addresses AND symbols Addresses 3 lines addresses OR symbols Close Ladder viewer on Edit Rung Connection management V Display toolbars Connection Auto line validate l COM1 xl This screen allows you to select a connection
328. ng an ASI_CMD instruction the SW73 X3 bit must be checked to see whether an instruction is not in progress check that SW73 X3 1 To ascertain whether the instruction has then correctly executed check that the SW73 X4 bit equals 0 TWD USE 10AE 225 Installing the AS Interface bus Presentation of For each user program the ASI_CMD instruction allows the user to program his the ASI_CMD network and obtain the slave diagnostics The instruction parameters are passed by Instruction internal words memory words MWx The syntax of the instruction is as follows ASILCMDn MWx 1 Legend Symbol Description n Address of AS Interface expansion module 1 to 7 x Number of the first internal word memory word passed in parameter 0 to 254 Length of the instruction in number of words 2 Using the The following table describes the action of the ASI_CMD instruction according to the ASI_CMD value of the parameters MW x and MW x 1 when necessary For slave Instruction diagnostics requests the result is returned in MW x 1 MWx MWx 1 Action 1 0 Exits Offline mode 1 1 Switches to Offline mode 2 0 Prohibits the exchange of data between the Master and its slaves enters Data Exchange Off mode 2 1 Authorizes the exchange of data between the Master and its slaves exits Data Exchange Off mode Reserved Result Reads the list of active slave
329. ng point data for a given X value The LKUP function makes use the linear interpolation rule as defined in the following equation y v equation 1 LOG 41 X for Xi SX lt Xi41 where i 1 m 1 XX assuming X values are ranked in ascending order X S X2S X SXm 1 SXm Note If any of two consecutive Xi values are equal Xj Xj4 X equation 1 yields an invalid exception In this case to cope with this exception the following algorithm is used in place of equation 1 7 Sis 1 e equation 2 2 for Xi Xi 1 X where i 1 m 1 The following graph illustrates the linear interpolation rule described above Y4 Rule Yow Yaar Ym r Y I I I I I Y i I I I t T p 0 Xi X Xi 1 Xm 1 Xm X TWD USE 10AE 503 Advanced Instructions Syntax of the LKUP Function Definition of Op1 Definition of Op2 The LKUP function uses three operands two of which are function attributes as described in the following table Syntax Operand 1 Op1 Output variable Operand 2 Op2 User defined X value Operands 3 Op3 User defined X Y variable array Op1 LKUP Op2 0p3 MWi MFO Integer value MWi or KWi Op1 is the memory word that contains the output variable of the interpolation function Depending on the value of Op1 the user can know whether the interpolation was successful or f
330. ng the 64K Extended Memory Cartridge 59 TWD USE 10AE User Memory User Memory Structure Introduction Bit Memory Word Memory Memory Storage Types The controller memory accessible to your application is divided into two distinct sets Bit values Word values 16 bit signed values and double word values 32 bit signed values The bit memory is located in the controller s built in RAM It contains the map of 128 bit objects The word memory 16 bits supports Dynamic words runtime memory stored in RAM only Memory words MW and double words MD dynamic system data and system data Program descriptors and executable code for tasks Configuration data constant words initial values and input output configuration The following are the different types of memory storage for Twido controllers Random Access Memory Internal volatile memory Contains dynamic words memory words program and configuration data EEPROM An integrated 32KB EEPROM that provides internal program and data backup Protects program from corruption due to battery failure or a power outage lasting longer than 30 days Contains program and configuration data Holds a maximum of 512 memory words Program is not backed up here If a 64K extended memory cartridge is being used and Twido has been configured to accept the 64K extended memory cartridge Erase 32K backup cartridge An optional external cartridge
331. ngs which are sets of graphical instructions drawn between two vertical potential bars The rungs are executed sequentially by the controller The set of graphical instructions represent the following functions Inputs outputs of the controller push buttons sensors relays pilot lights etc Functions of the controller timers counters etc Math and logic operations addition division AND XOR etc Comparison operators and other numerical operations A lt B A B shift rotate etc Internal variables in the controller bits words etc These graphical instructions are arranged with vertical and horizontal connections leading eventually to one or several outputs and or actions A rung cannot support more than one group of linked instructions The following diagram is an example of a Ladder program composed of two rungs I0 1 M42 Example Rung 1 I10 3 M42 Q1 2 Example Rung 2 MW22 MW15 KW I TWD USE 10AE 251 Ladder Language Programming Principles for Ladder Diagrams Programming Each Ladder rung consists of a grid of seven rows by eleven columns that are Grid organized into two zones as shown in the following illustration Columns tooto M to to o y o Potential I ae Grid i Bars i Cells i 4 a Test Zone Action Zone Grid Zones The Ladder diagram programming grid is divided int
332. nificant byte least significant byte bit7 bit bitS bit4 bits bit2 bit bitO bit7 bit6 bitS bit4 bits bit2 bit1 bito 4 8 12 15A 14A 13A 12A 11A 10A 9A 8A 7A 6A 5A 4A 3A 2A 1A OA 5 9 13 31A 30A 29A 28A 27A 26A 25A 24A 23A 22A 21A 20A 19A 18A 17A 16A 6 10 14 15B 14B 13B 12B 11B 10B 9B 8B 7B 6B 5B 4B 3B 2B 1B OB 7 11 15 31B 30B 29B 28B 27B 26B 25B 24B 23B 22B 21B 20B 19B 18B 17B 16B Programming Examples for the ASI_CMD Instruction To read whether slave 20B is active the ASI_CMD instruction must be executed with the MWx internal word having a value of 7 The result is returned in the MWx 1 internal word the status of slave 20B is given by the value of bit 4 of the least significant byte If bit 4 is equal to 1 then slave 20B is active To force the AS Interface Master positioned at 1 on the expansion bus to switch to Offline mode LD 1 MWO 16 0001 MW1 16 0001 LD SW73 X3 ASI_CMD1 MW0 2 To read the table of slaves active for addresses OA to 15A LD 1 MWO 16 0004 MW1 16 0000 f no ASI_CMD instruction is in progress then continue Ito force the switch to Offline mode optional LD SW73 X3_ If no ASI_CMD instruction is in progress then continue ASI_CMD1 MW0 2 to read the LAS table for address
333. nitial steps are activated It is reset to 0 by the system after GRAFCET initialization U gt S S22 GRAFCET reset Normally set to 0 it can only be set to 1 by the program in pre processing At state 1 it causes the active steps of the entire GRAFCET to be deactivated It is reset to 0 by the system at the start of the execution of the sequential processing U gt S S23 Preset and freeze GRAFCET Normally set to 0 it can only be set to 1 by the program in the pre processing program module Set to 1 it validates the pre positioning of GRAFCET Maintaining this bit at 1 freezes the GRAFCET freezes the chart It is reset to 0 by the system at the start of the execution of the sequential processing to ensure that the GRAFCET chart moves on from the frozen situation U gt S S24 Operations Display Normally at 0 this bit can be set to 1 by the user e Atstate 0 the Operator Display is operating normally e Atstate 1 the Operator Display is frozen stays on current display blinking disabled and input key processing stopped U gt S 512 TWD USE 10AE System Bits and Words System Bit Function Description Init Control state S31 Event mask Normally at 1 Setto 0 events cannot be executed and are queued Setto 1 events can be executed This bit can be set to 0 by the user and the system on cold re start 1 U gt S
334. normal range QWO0 1 0 4095 QWO0 2 0 MWO0 LD 1 QW0 1 0 4095 LD 1 QW0 2 0 MWO0 e Example of output values for QW1 0 4095 normal case The following table shows the output voltage value according to the maximum value assigned to QW1 0 numerical value analog value volt Minimum 0 0 Maximum 4095 10 Value 1 100 0 244 Value 2 2460 6 e Example of output values for a customized range minimum 0 maximum 1000 The following table shows the output voltage value according to the maximum value assigned to QW1 0 numerical value analog value volt Minimum 0 0 Maximum 1000 10 Value 1 100 1 Value 2 600 6 194 TWD USE 10AE Installing the AS Interface V2 bus 9 At a Glance Subject of this Chapter What s in this Chapter Master module TWDNOI10M3 and its slaves This chapter provides information on the software installation of the AS Interface This chapter contains the following topics Topic Page Presentation of the AS Interface V2 bus 196 General functional description 197 Software set up principles 200 Description of the configuration screen for the AS Interface bus 202 Configuration of the AS Interface bus 204 Description of the debug screen 210 Modification of Slave Address 213 Updating the AS Interface bus config
335. ns TWDLCeA10 16 24DRF 1 Base controller equipped with a 3 wire EIA RS 485 port TWDLCA 40DRF with a miniDIN connector TWDLMDA20 40DUK TWDLMDA20 40DTK TWDLMDA20DRT TWDNOZ485D 2 Communication module equipped with a 3 wire EIA RS 485 port with a miniDIN connector Note This module is only available for the Modular controllers When the module is attached the controller cannot have an Operator Display expansion module TWDNOZ485T 2 Communication module equipped with a 3 wire EIA RS 485 port with a terminal Note This module is only available for the Modular controllers When the module is attached the controller cannot have an Operator Display expansion module TWDNAC485D 2 Communication adapter equipped with a 3 wire EIA RS 485 port with a miniDIN connector Note This adapter is only available for the Compact 16 24 and 40 I O controllers and the Operator Display expansion module TWDNAC485T 2 Communication adapter equipped with a 3 wire EIA RS 485 port with a terminal Note This adapter is only available for the Compact 16 24 and 40 I O controllers and the Operator Display expansion module TWDXCPODM 2 Operator Display expansion module equipped with a 3 wire EIA RS 485 port with a miniDIN connector or a 3 wire EIA RS 485 port with a terminal Note This module is only available for the Modular controllers When the module is attached the controller cannot have a Communication expansion module 106 TWD USE 10
336. nt values Their content can only be written or modified by using TwidoSoft Syntax F 32 bit object Number i The maximum number value depends on the number of objects configured Examples of floating object addresses e MF15 internal floating object number 15 e KF26 constant floating object number 26 38 TWD USE 10AE Twido Language Objects Addressing double word objects Introduction Addressing double word objects except for input output addressing see Addressing Inputs Outputs p 40 and function blocks see Function Block Objects p 43 follows the format described below Syntax Use the following format to address internal and constant double words MorK D i Symbol Type of object Syntax Number Description The following table describes the elements in the addressing format Group Item Description Symbol The percent symbol always precedes an internal address Type of object M Internal double words are used to store intermediary values while a program is running K Constant double words store constant values or alphanumeric messages Their content can only be written or modified by using TwidoSoft Syntax D 32 bit double word Number i The maximum number value depends on the number of objects configured Examples of double word object addressing e MD15 internal double word number 15 e KD26 constant double word number 26 TWD USE 10AE 39 Twido
337. o 0 the address cannot be changed The value of SW101 and SW102 matches the current port address e Set to 1 the address can be changed by changing the values of SW101 port 1 and SW102 port 2 Having modified the values of the system words S101 must be set back to 0 S103 S104 Using the ASCII protocol Enables the use of the ASCII protocol on Comm 1 S103 or Comm 2 S104 The ASCII protocol is configured using system words SW103 and SW105 for Comm 1 and SW104 and SW106 for Comm 2 e Set to 0 the protocol used is the one configured in Twido Soft e Set to 1 the ASCII protocol is used on Comm 1 S103 or Comm 2 S104 In this case the system words SW103 and SW105 must be previously configured for Comm 1 and SW104 and SW106 for Comm 2 S110 Remote link exchanges This bit is reset to 0 by the program or by the terminal Setto 1 for a master all remote link exchanges remote I O only are completed e Setto 1 for a slave exchange with master is completed 0 S gt U S111 Single remote link exchange e Setto 0 for a master a single remote link exchange is completed e Setto 1 for a master a single remote link exchange is active S112 Remote link connection e Set to 0 for a master the remote link is activated e Setto 1 fora master the remote link is deactivated TWD USE 10AE 515 System Bits and Words
338. o the dropdown list of connections in the File gt Preferences dialog box and in the PLC gt Select a connection 154 TWD USE 10AE Communications Connecting your Controller to the Network Overview Determining the Appropriate IP Address Set Ethernet Network Connection The following information describes how to install your TDWLCAE40DRF compact controller on your Ethernet network Consult your network administrator to determine if you must configure a new set of device IP gateway and subnet mask addresses If the administrator assigns new IP address parameters you will need to enter this information manually in the TwidoSoft application Follow the directions in the TCP IP Setup p 162 section hereafter Note Although direct cable connection using a Ethernet crossover cable is supported between the Twido TWDLCAE40DRF and the PC running the TwidoSoft programming software we do not recommend it Therefore you should always favor a connection via a network Ethernet hub switch The following figure shows a Twido network connection via an Ethernet hub switch Twido TWDLCAE40DRF RJ 45 Ethernet Port PC Ethernet Network Port Ea Ethernet Fa Hub Switch SFTP Cat5 RJ45 Ethernet mC A RJ 45 RJ 45 male RJ 45 male connector connector The Twido TWDLCAE40DRF features a RJ 45 connector to conne
339. o two zones e Test Zone Contains the conditions that are tested in order to perform actions Consists of columns 1 10 and contains contacts function blocks and comparison blocks e Action Zone Contains the output or operation that will be performed according to the results of the tests of the conditions in the Test Zone Consists of columns 8 11 and contains coils and operation blocks 252 TWD USE 10AE Ladder Language Entering Instructions in the Grid Rung Headers A Ladder rung provides a seven by eleven programming grid that starts in the first cell in the upper left hand corner of the grid Programming consists of entering instructions into the cells of the grid Test instructions comparisons and functions are entered in cells in the test zone and are left justified The test logic provides continuity to the action zone where coils numerical operations and program flow control instructions are entered and are right justified The rung is solved or executed tests made and outputs assigned within the grid from top to bottom and from left to right In addition to the rung a rung header appears directly above the rung Use the rung header to document the logical purpose of the rung The rung header can contain the following information e Rung number e Labels Li e Subroutine declarations SRi Rung title e Rung comments For more details about using the rung header to document your programs see
340. oating point and double integer word objects A floating point is a mathematical argument which has a decimal in its expression examples 3 4E 38 2 3 or 1 0 A double integer word consists of 4 bytes stored in data memory and containing a value between 2147483648 and 2147483647 The floating format used is the standard IEEE STD 734 1985 equivalent IEC 559 The length of the words is 32 bits which corresponds to the single decimal point floating numbers Table showing the format of a floating point value Bit 31 Bits 30 23 Bits 22 0 S Exponent Fractional part The value as expressed in the above format is determined by the following equation 32 bit Floating Value 1 2 Pes t 27 4 Fractional part Floating values can be represented with or without an exponent but they must always have a decimal point floating point Floating values range from 3 402824e 38 and 1 175494e 38 to 1 175494e 38 and 3 402824e 38 grayed out values on the diagram They also have the value 0 written 0 0 1 INF 1 4DN 1 DN 1 INF H 3 402824e 38 1 175494e 38 0 1 175494e 38 3 402824e 38 When a calculation result is e Less than 3 402824e 38 the symbol 1 INF for infinite is displayed e Greater than 3 402824e 38 the symbol 1 INF for infinite is displayed e Between 1 175494e 38 and 1 175494e 38 it is rounded off to 0 0 A value within these limits cannot be entered
341. ocation on the expansion bus In this example a TWDLMDA40DUK has a built in analog adjusted 10 bit potentiometer a 9 bit built in analog channel On the expansion bus are the following a TWDAMMSHT analog module a TWDDMM8DRT input output digital relay module and a second TWDAMMSHT analog module are configured DCIN ANALOG IN OUT ANALOG IN OUT Relay OUT Twido Linn L_onr Linol Loanrzt P Linr Loni linol Loanvzt N N Lnn Lnn C aca v a a v J dle o N v o 8 z 3 z a o l N w f 3 5 ONT Se SN a ae A CN1 asg Iug Base Module 1 Module 2 Module 3 The table below details the addressing for each output C aav a a v alu Description Base Module 1 Module 2 Module 3 Potentiometer 1 WO0 0 0 Built in analog channel WO 0 1 Analog in channel 1 IW0 1 0 IW0 3 0 Analog in channel 2 IW0 1 1 IW0 3 1 Analog output channel 1 QWO0 1 0 QW0 3 0 Digital in channels 10 2 0 l0 2 3 Digital out channels Q0 2 0 Q0 2 3 TWD USE 10AE 189 Managing Analog Modules Configuring Analog Inputs and Outputs Introduction Configuring Analog I O This section provides information on configuring analog module s inputs and outputs The Configure Module dialog box is used to manage the parameters of the ana
342. ocessing 290 sequential processing 291 Grafcet methods 68 Graphic elements Ladder diagrams 257 542 TWD USE 10AE Index 1 0 Addressing 40 Idle checking 168 Increment 349 Index overflow 49 Initialization of objects 76 Input tab PID 437 Instructions AND 308 Arithmetic 349 Comparison 347 Conversion 356 JMP 363 Load 304 logic 352 NOT 314 RET 364 SR 364 XOR 312 instructions END 360 NOP 362 INT_TO_REAL 488 Integral action 473 IP address 156 Default IP address 158 J JMP 363 Jump Instructions 363 L Labeling Indexed 48 Ladder diagrams blocks 254 graphic elements 257 introduction 250 OPEN and SHORT 260 programming principles 252 Ladder List Rung 267 Ladder program reversing to List 265 Ladder rungs 251 LAN ACT 176 LAN ST 176 LD 304 LDF 301 304 LDN 304 LDR 300 304 LIFO introduction 374 operation 376 Link elements graphic elements 257 List instructions 275 List Language overview 272 List Line Comments 268 LKUP 503 LN 481 LOG 481 logic instructions 352 M MAC address 158 Marked IP 166 MAX_ARR 498 MEAN 507 Memory 32K cartridge 56 64K cartridge 59 Structure 52 without cartridge 54 Memory bits 27 Memory words 29 MIN_ARR 498 TWD USE 10AE 543 Index Modbus Communication 87 Communications 129 Configuring the port 131 Hardware configuration 129 master 87 Slave 87 Software configu
343. of programming and configuring a drum controller The first six outputs Q0 0 to Q0 5 are activated in succession each time input l0 1 is set to 1 Input 10 0 resets the outputs to 0 The following illustration is a drum controller function block with examples of reversible and non reversible programming I10 0 Q0 8 DR1 I10 1 U STEPS 6 Ladder diagram BLK DRI LD 00 R LD 01 U OUT_BLK LD F ST Q0 8 END BLK TWD USE 10AE 391 Advanced Instructions Configuration The following information is defined during configuration e Number of steps 6 e The output states control bits for each drum controller step 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Step 1 O JO 0 0 0 0 0 0 0 0 0 0 0 0 0 Step 2 1 JO 0 0 0 0 0 0 0 0 0 0 0 0 0 Step 3 O 1 0 0 0 0 0 0 0 0 0 0 0 0 0 Step 4 O JO 1 0 0 0 0 0 0 0 0 0 0 0 0 Step 5 O JO 0 1 0 0 0 0 0 0 0 0 0 0 0 Step 6 O JO 0 1 0 0 0 0 0 0 0 0 0 0 e Assignment of the control bits 1 Q0 0 4 Q0 1 Q0 2 Q0 3 Q0 4 6 Q0 5 a 392 TWD USE 10AE Advanced Instructions Fast Counter Function Block FC Introduction Illustration The Fast Counter function block FC serves as either an up counter or a down counter It can count the rising edge of digital inputs up to frequencies of 5k
344. oller is switched off The time of day clock has a 24 hour format and takes leap years into account RTC Correction The RTC Correction value is necessary for the correct operation of the RTC Each Value RTC unit has its own correction value written on the unit This value is configurable in TwidoSoft by using the Configure RTC option from the Controller Operations dialog box 414 TWD USE 10AE Advanced Instructions Schedule Blocks Introduction Schedule Blocks are used to control actions at a predefined month day and time A maximum of 16 schedule blocks can be used and do not require any program entry Note Check system bit S51 and system word SW1 18 to confirm that the Real Time Clock RTC option is installed see System Bits S p 510 The RTC option is required for using schedule blocks Parameters The following table lists parameters for a schedule block Parameter Format Function Range Schedule block n n 0to 15 number Configured Check box Check this box to configure the selected schedule block number Output bit QXx y Z Output assignment is activated by schedule block Mi or Qj k This output is set to 1 when the current date and time are between the setting of the start of the active period and the setting of the end of the active period Start month January to The month to start the schedule block December End month January to The month to end the sched
345. on Timer function blocks TMi are programmed in the same way regardless of how they are to be used The timer function TON TOF or TP is selected during configuration The following illustration is a timer function block with examples of reversible and non reversible programming No o TMi Q0 3 TYPE TON TB Imin ADJ Y TMi P 9999 Reversible programming BLK TMI LD 0 IN OUT_BLK LD Q ST Q0 3 END BLK Non Reversible programming LD IN LD ST 10 1 TM1 TM1 Q Q0 3 The following parameters must be entered during configuration Timer type TON TOF or TP Preset value TMi P 0 to 9999 Adjust Checked or Not Checked Timebase 1 min 1 s 100 ms 10 ms or 1 ms 326 TWD USE 10AE Basic Instructions Special Cases The following table contains a list of special cases for programming the Timer function block Special case Description Effect of a cold restart S0 1 Forces the current value to 0 Sets output TMi Q to 0 The preset value is reset to the value defined during configuration Effect of a warm restart S1 1 Has no effect on the current and preset values of the timer The current value does not change during a power outage Effect of a controller stop Stopping the controller does not freeze the current value Effect of a program jump Jumping over the timer blo
346. on Port 2 optional cartridge or communication module it is good practice Step 3 Connect the Communications Cable between the PC and Controllers Master Peer PC Serial Port controller Remote I O controller TSX PCX 1031 EIA RS 232 7 _ 1 A 3 0 I TSX PCX 3030 USB Port The TSXPCX1031 or TSX PCX 3030 multi function programming cable is used to communicate with each of the three base controllers Be sure that the cable is on switch position 2 In order to program each of the controllers a point to point communication with each controller will need to be to established To establish this communication connect to Port 1 of the first controller transfer the configuration and application data and set the controller to the run state Repeat this procedure for each controller Note The cable needs to be moved after each controller configuration and application transfer Step 4 Configure the Software Each of the three controllers uses TwidoSoft to create a configuration and if appropriate the application program For the master controller edit the controller communication setup to set the protocol to Remote Link and the Address to 0 Master Controller comm settings Type Remote link Address 0 Master 116 TWD USE 10AE Communications Configure the remote controller on the master by adding a Re
347. on in the table Transmission When using either mode Modbus ASCII or Modbus RTU the Transmission table reception tables is filled with the request prior to executing the EXCHx instruction At execution time the controller determines what the Data Link Layer is and performs all conversions necessary to process the transmission and response Start end and check characters are not stored in the Transmission Reception tables Once all bytes are transmitted the controller switches to reception mode and waits to receive any bytes Reception is completed in one of several ways e time out on a character or frame has been detected e end of frame character received in ASCII mode e the Reception table is full The Transmitted byte X entries contain Modbus protocol RTU encoding data that is to be transmitted If the communications port is configured for Modbus ASCII the correct framing characters are appended to the transmission The first byte contains the device address specific or broadcast the second byte contains the function code and the rest contain the information associated with that function code Note This is a typical application but does not define all the possibilities No validation of the data being transmitted will be performed The Received Bytes X contain Modbus protocol RTU encoding data that is to be received If the communications port is configured for Modbus ASCIl the correct framing characters ar
348. on of errors e The profile specified by the user by the configuration of a given address does not correspond to the actual profile detected for this address on the bus diagnostics Profile error e Anewslave not specified at configuration is detected on the bus a red indicator lamp is then displayed for this address and the slave name displayed is Unknown diagnostics Slave not projected e Peripheral fault if the slave detected supports it diagnostics Peripheral fault e Aconfigured profile is specified but no slave is detected for this address on the bus diagnostics Slave not detected 212 TWD USE 10AE Installing the AS Interface bus Modification of Slave Address At a Glance From the debug screen the user can modify the address of a slave in online mode Modification of Slave Address The following table shows the procedure for modifying a slave address Step Description 1 Access the Debug screen 2 Select a slave in the AS interface V2 Configuration zone 3 Drag and drop the slave to the cell corresponding to the desired address Illustration Dragging and dropping slave 3B to address 15B Configuration Debugging _AS interface V2 configuration Std A Slaves IB Slaves a 00 02 03 ASI2OMT41E 04 05 ff inouT2412 06 WXA36 go T41E 11 i Unknown
349. onal communication adapters or modules configured to the base 2 Right click on the port and click Edit Controller Comm Setup and change serial port type to Modbus 3 Set the associated communication parameters TWD USE 10AE 131 Communications Modbus Master Control table Modbus master mode allows the controller to send a Modbus query to a slave and to wait for the response The Modbus Master mode is only supported via the EXCHx instruction Both Modbus ASCII and RTU are supported in Modbus Master mode The maximum size of the transmitted and or received frames is 250 bytes Moreover the word table associated with the EXCHx instruction is composed of the control transmission and reception tables Most significant byte Least significant byte Control table Command Length Transmission Reception Reception offset Transmission offset Transmission table Transmitted Byte 1 Transmitted Byte 2 Transmitted Byte n Transmitted Byte n 1 Reception table Received Byte 1 Received Byte 2 Received Byte p Received Byte p 1 Note In addition to queries to invidual slaves the Modbus master controller can initiate a broadcast query to all slaves The command byte in case of a boradcast query must be set to 00 while the slave address must be set to 0 The Length byte contains the length of the transmission table maximum 250 bytes which is ove
350. one is 1 Jump or Subroutine JMP Connect to a labeled instruction call gt gt Li SR upstream or downstream gt gt SRi Transition condition Grafcet language Used when the coil programming of the transition i conditions associated with the transitions causes a changeover to the next step Return from a RET Placed at the end of subroutines to subroutine lt RET gt return to the main program Stop program END Defines the end of the program lt END gt 258 TWD USE 10AE Ladder Language Function blocks Operate and Comparison Blocks The graphic elements of function blocks are programmed in the test zone and require four rows by two columns of cells except for very fast counters which require five rows by two columns Name Graphic element Function Timers counters registers and so on Each of the function blocks uses inputs and outputs that enable links to the other graphic elements Note Outputs of function blocks can not be connected to each other vertical shorts Comparison blocks are programmed in the test zone and operate blocks are programmed in the action zone Name Graphic element Function Comparison block Compares two operands the output changes to 1 when the result is checked Size one row by two columns Operation block Performs arithmetic and logic operations Siz
351. ontroller is configured to use EIA RS 485 on Port 1 and an optional EIA RS 485 Port 2 On a Modular controller the optional Port 2 can be either a TWDNOZ485D or a TWDNOZ485T or if you use TVDXCPODM it can be either a TVWDNAC485D or a TWDNAC485T On a Compact controller the optional Port 2 can be either a TWDNAC485D or a TWDNAC485T To configure each controller connect the TSXPCX1031 cable to Port 1 of the controller Note The TSXPCX1031 can only be connected to one controller at a time on RS 485 EIA port 1 only Next connect the cable to the COM 1 port of the PC Be sure that the cable is in switch position 2 Download and monitor the application Repeat procedure for second controller TWD USE 10AE 137 Communications Step 2 Connect the Modbus Communications Cable Mini DIN connection Twido Twido Modbus Master Modbus Slave A B OV A _ B GND T 2 Se Terminal block connection Twido Twido Modbus Master Modbus Slave A B Y OV A T OV A B SG The wiring in this example demonstrates a simple point to point connection The three signals A B and OV are wired according to the diagram If using Port 1 of the Twido controller the DPT signal pin 5 must be tied to OV pin 7 This conditioning of DPT determines if TwidoSoft is connected When tied to the ground the controller will use the port configur
352. or Animation Tables Editor Set to N means that there is no access to the preset Pulse IN At state 1 the pulse generation is produced at the dedicated generation output channel At state 0 the output channel is set to 0 input Reset input R At state 1 outputs PLSi Q and PLSi D are set to 0 The number of pulses generated in period T is set to 0 Current PLSi Q At state 1 indicates that the pulse signal is generated at the pulse dedicated output channel configured output generation Pulse PLSi D At state 1 signal generation is complete The number of desired generation pulses has been reached done output Note Note Means a double word variable TWD USE 10AE 385 Advanced Instructions Range of Periods The preset value and the time base can be modified during configuration They are used to fix the signal period T PLSi P TB The range of periods available e 0 142 ms to 36 5 ms in steps of 0 142 ms 27 4Hz to 7kHz 0 57 ms to 146 ms in steps of 0 57 ms 6 84 Hz to 1 75 kHz 20 ms to 5 45 mins in steps of 10 ms 2 sec to 9 1 hours in steps of 1 sec Operation The following is an illustration of the PLS function block Input IN LI _ L Number of pulses Dedicated Output M M E E EE EE PLSI Q M U PLSi D ee es e Special Cases Special case Description Effect of cold restart S0 1 Sets the PLSi P to that defined during configuration
353. or Syntax gt gt lt lt lt gt LD Op1 Operator Op2 AND Op1 Operator Op2 OR Op1 Operator Op2 Operands Type Operand 1 Op1 Operand 2 Op2 Words PMWi KWi YINWi Immediate value MWi IW IWAI QNWi KWi INWi IW QWi QWAI IWAI SQANWi QW VQNWi SWi PQWAI SWi BLK x BLK x MWi MWi KWi gt MWi Double MDi KDi Immediate value MDi words KDi MDi gt MWi KD MWi Floating MFi KFi Immediate floating point word value MFi KFi MFi YMWi KFi gt MWi Note Comparison instructions can be used within parentheses An example of using Comparison instruction within parentheses LD MO AND MF20 gt 10 0 OR I10 0 ST QO0 1 348 TWD USE 10AE Basic Instructions Arithmetic Instructions on Integers Introduction Arithmetic instructions are used to perform arithmetic operations between two integer operands or on one integer operand The following table lists the types of Arithmetic instructions Instruction Function Add two operands Subtract two operands Multiply two operands Divide two operands REM Remainder of division of the two operands SQRT Square root of an operand INC Increment an operand DEC Decrement an operand ABS Absolute value of an operand Structure Arithmeti
354. or manage connections creation modification etc To use an existing connection select it from those displayed in the drop down menu If you have to add modify or delete a connection click once on Manage connections a window opens displaying the list of connections and their properties Connection management Name Connection type Phone IP Timeout Break timeout COM1 Serial COM1 20 COM4 Serial COM4 My Modem 1 MODEM TOSHIBA Internal V 90 Mod 0231858445 5000 20 Add Modify Delete OK In this case 2 serial ports are displayed Com1 and Com4 as well as a modem connection showing a TOSHIBA V 90 model configured to compose the number 0231858445 national call You can change the name of each connection for application maintenance purposes COM1 or COM4 cannot be changed This is how you define and select the connection you wish to use for connecting your PC to a modem However this is just part of the process for making an overall connection between the computer and the Twido controller The next step involves the Twido controller The remote Twido must be connected to a modem 96 TWD USE 10AE Communications Configuring the Modem All modems need to be initialized to establish a connection The Twido controller containing at least version V2 0 firmware is capable on power up of sending an adapted string to the modem if the modem is configured in the application
355. ords System Function Description Control Words SWIE Command and or Bit 0 Indicates that the MW memory words must be saved to S and U diagnostics for EEPROM save restore e Setto 1 if a backup is required function of e Set to 0 if the backup in progress is not complete application e Bit 1 This bit is set by the firmware to indicate when the save is program and complete MW e Set to 1 if the backup is complete e Set to 0 if a new backup request is asked for e Bit 2 Backup error refer to bits 8 9 10 and 14 for further information e Set to 1 if an error appeared e Set to 0 if a new backup request is asked for e Bit 6 Set to 1 if the controller contains an empty application e Bit 8 Indicates that the number of MWs specified in SW97 is greater than the number of MWs configured in the application e Set to 1 if an error is detected e Bit 9 Indicates that the number of MWs specified in SW97 is greater than the maximum number of MWs that can be defined by any application in TwidoSoft e Set to 1 if an error is detected e Bit 10 Difference between internal RAM and internal EEPROM 1 yes e Set to 1 if there is a difference e Bit 14 Indicates if an EEPROM write fault has occurred e Set to 1 if an error is detected SW97 Command or When saving memory words this value represents the physical number S and U diagnostics for MW to be saved to
356. ork The following procedure describes how to check the current IP settings of your PC Also this procedure is valid for all versions of the Windows operating system Step Action 1 Select Run from the Windows Start menu 2 Type command in the Open textbox of the Run dialog box Result The C WINDOWS system32 command com prompt appears Type ipconfig at the command prompt The Windows IP Configuration appears and displays the following parameters IP Address Subnet Mask 5 Default Gateway Note The above IP settings cannot be changed directly at the command prompt They are available for consultation only If you plan to change the IP configuration of your PC please refer to the following section 150 TWD USE 10AE Communications Configuring the The following information will help configure the TCP IP settings of your PC running TCP IP Settings the TwidoSoft application for programming and control of the Twido controller over of your PC the network The procedure outlined below is workable on a PC equipped with a Windows XP operating system and is intended as an example only Otherwise for other operating systems please refer to TCP IP setup instructions outlined in the user s guide of the particular operating system installed on your PC Step Action Note If your PC is already installed and the Ethernet card is configured over the existing
357. ort 1 or 2 of the controller respectively e x 3 signifies the Ethernet network port of the controller on TWDLCAE40DRF controllers only For more information about the MSG3 function please refer to TCP Modbus Messaging p 177 The MSGx function block manages data exchanges and has three functions e Communications error checking Error checking verifies that the block length word table programmed with the EXCH instruction is large enough to contain the length of the message to be sent compare with length programmed in the least significant byte of the first word of the word table e Coordination of multiple messages To ensure coordination when sending multiple messages the MSGx function block provides the information required to determine when a previous message is complete e Transmission of priority messages The MSGx function block allows the current message transmission to be stopped in order to allow the immediate sending of an urgent message The programming of the MSGx function block is optional Illustration The following is an example of the MSGx function block MSGI1 E TWD USE 10AE 409 Advanced Instructions Parameters The following table lists parameters for the MSGx function block Parameter Label Value Reset input or R At state 1 reinitializes communication MSGx E 0 and instruction MSGx D 1 Comm done MSGx D State 1 comm done if
358. pe timer 1 1 3 2 6 TMi P 4 TMi V Operation The following table describes the operation of the TOF type timer Phase Description 1 The current value TMi V is set to 0 on a rising edge at input IN even if the timer is running The TMi Q output bit is set to 1 when a rising edge is detected at input N The timer starts on the falling edge of input IN The current value TMi V increases to TMi P in increments of one unit for each pulse of the time base TB 5 The TMi Q output bit is reset to O when the current value reaches TMi P TWD USE 10AE 323 Basic Instructions TON Type of Timer Introduction The TON Timer On Delay type of timer is used to control on delay actions This delay is programmable using the TwidoSoft Timing Diagram The following timing diagram illustrates the operation of the TON type timer 1 3 5 erga he 7 TMiV 4 _ Operation The following table describes the operation of the TON type timer Phase Description 1 The timer starts on the rising edge of the IN input 2 The current value TMi V increases from 0 to TMi P in increments of one unit for each pulse of the time base TB The TMi Q output bit is set to 1 when the current value has reached TMi P The TMi
359. pecify the integral action coefficient here for a timebase of 0 1 seconds This value can be an internal word MW0 to MW2999 an internal constant KWO to KW255 or a direct value It must be between 0 and 20000 Note To disable the integral action of the PID set this coefficient to 0 Td 0 1 sec Specify the derivative action coefficient here for a timebase of 0 1 seconds This value can be an internal word MW0 to MW2999 an internal constant KWO to KW255 or a direct value It must be between 0 and 10000 Note To disable the derivative action of the PID set this coefficient to 0 Sampling period Specify the PID sampling period here for a timebase of 10 seconds 10 ms This value can be an internal word MW0 to MW2999 an internal constant KWO to KW255 or a direct value It must be between 1 0 01 s and 10000 100 s Diagram The diagram allows you to view the different possibilities available for configuring your PID 440 TWD USE 10AE Advanced Instructions Note When AT is enabled Kp Ti and Td parameters are no longer set by the user for they are automatically and programmatically set by the AT algorithm In this case you must enter in these fields an internal word only YMW0O to MW2999 Caution Do not enter an internal constant or a direct value when AT is enable for this will trigger an error when running your PID application TWD U
360. perands or on one word operand The following table lists the types of Logic instructions The Logic instructions are used to perform a logical operation between two word Instruction Function AND AND bit wise between two operands OR Logic OR bit wise between two operands XOR Exclusive OR bit wise between two operands NOT Logic complement bit wise of an operand Structure Logic operations are performed as follows MW0 MW 10 AND 16 FF00 YMW0 KW5 OR MW10 MW 102 NOT MW 100 LD MO YMW0 MW 10 AND 16 FF00 LD 1 YMW0 KW5 OR MW 10 LD I10 3 MW102 NOT MW 100 352 TWD USE 10AE Basic Instructions Syntax Example The syntax depends on the operators used Operator Syntax Operand 1 Op1 Operands 2 and 3 Op2 amp 3 AND OR XOR Op1 Op2 Operator Op3 MWi QWi Immediate value 1 NOT Op1 NOT Op2 RPQWAI SWi Wi KWi IW RIWAI PQW RQWAI SWi BLK x Note 1 With NOT Op2 cannot be an immediate value The following is an example of a logical AND instruction SMW15 SMW32 AND MW12 TWD USE 10AE 353 Basic Instructions Shift Instructions Introduction Shift instructions move bits of an operand a certain number of positions to the right or to the left The following table
361. processing phases for power cuts Phase Description 1 In the event of a power cut the system stores the application context and the time of the cut All outputs are set to fallback status 0 When power is restored the context saved is compared with the one in progress which defines the type of start to run e Ifthe application context has changed loss of system context or new application the controller initializes the application Cold restart systematic for compact e Ifthe application context is the same the controller restarts without initializing data warm restart TWD USE 10AE 71 Controller Operating Modes Dealing with a warm restart Cause of a Warm Restart A warm restart can occur e When power is restored without loss of application context e When bit S1 is set to state 1 by the program e From the Operator Display when the controller is in STOP mode Illustration The drawing below describes a warm restart operation in RUN mode RUN WAIT Koo yV Acquisition of inputs K M Stop the processor Save application Execution of program context TOP if bit S1 1 possible process with Restoration of power warm restart Partial configuration auto tests Detection o y es power cut gt Set bit S1 to 1 gMicro power for only o
362. properties then Properties of the Modem Modem ________ Hayes initialization command ATE0Q1 Cancel You can select a previously defined modem or create a new one by clicking Add Modify a Modem Modem Bourgu bus Hayes initialization command ATEOQ1 XXXXXXXXXX Cancel Then give the new profile a name and complete the Hayes initialization commands as described in the modem documentation In the image xxxxxx represents the initialization sequence you must enter to prepare the modem for suitable communication i e the baud rate parity stop bit and receive mode To complete the sequence please refer to your modem documentation The maximum string length is 127 characters When your application is complete or at least when communication port 1 is fully described transfer the application using a point to point connection The Twido controller is now ready to be connected to a PC executing Twidosoft via modems 98 TWD USE 10AE Communications Connection Once Twidosoft and the Twido controller are prepared establish connection as Sequence follows Step Action 1 Power up the Twido controller and modem 2 Start your computer and run Twidosoft 3 Select the PLC menu then Select a connection and select My modem or the name you have given to your modem connection se
363. r depending on whether it is querying or answering requests respectively Ethernet messaging is handled by the EXCH3 instruction and the MSG3 function block Routing to an Ethernet host or via a gateway is supported by EXCH3 as well e EXCH3 instruction to transmit receive messages e MSG3 Function Block to control the message exchanges The EXCH3 instruction allows the Twido controller to send and or receive information to from Ethernet network nodes The user defines a table of words MWi L containing control information and the data to be sent and or received up to 128 bytes in transmission and or reception The format for the word table is described in the following section A message exchange is performed using the EXCH3 instruction Syntax EXCH3 MWi L where L number of words in the control words transmission and reception tables The Twido controller must finish the exchange from the first EXCH3 instruction before a second can be launched The MSG3 function block must be used when sending several messages The processing of the EXCH list instruction occurs immediately with any transmissions started under interrupt control reception of data is also under interrupt control which is considered background processing Note Usage of the EXCH3 instruction is the same as EXCHx where x 1 or 2 used with legacy Modbus Instruction syntaxes are also identical However there is one major difference in the informat
364. r function block has the following parameters Parameter Label Value Timer number oTMi 0 to 63 TWDLCAA10DRF and TWDLCAA16DRF 0 to 127 for all other controllers Type TON e Timer On Delay default TOF e Timer Off Delay TP e pulse monostable Time base TB 1 min default 1 s 100 ms 10 ms 1 ms Current Value TMi V Word which increments from 0 to TMi P when the timer is running May be read and tested but not written by the program TMi V can be modified using the Animation Tables Editor Preset value TMi P 0 9999 Word which may be read tested and written by the program Default value is 9999 The period or delay generated is TMi P x TB Animation Tables Y N Y Yes the preset TMi P value can be modified using the Editor Animation Tables Editor N No the preset TMi P value cannot be modified Enable or IN Starts the timer on rising edge TON or TP types or falling instruction input edge TOF type Timer output Q Associated bit TMi Q is set to 1 depending on the function performed TON TOF or TP Note The larger the preset value the greater the timer accuracy 322 TWD USE 10AE Basic Instructions TOF Type of Timer Introduction Use the TOF Timer Off Delay type of timer to control off delay actions This delay is programmable using TwidoSoft Timing Diagram The following timing diagram illustrates the operation of the TOF ty
365. r the selected PWMi P must be The range of periods available e 0 142 ms to 36 5 ms in steps of 0 142 ms 27 4Hz to 7kHz 0 57 ms to 146 ms in steps of 0 57 ms 6 84 Hz to 1 75 kHz 10 ms to 5 45 mins in steps of 10 ms 1 sec to 9 1 hours in steps of 1 sec Operation The frequency of the output signal is set during configuration by selecting the time base TB and the preset PWMi P Modifying the PWMi R duty cycle in the program modulates the width of the signal Below is an illustration of a pulse diagram for the PWM function block with varying duty cycles Input IN 8 6hlm6e6eee 80 50 Ratio 20 Dedicated Output I JL LLL 382 TWD USE 10AE Advanced Instructions Programming and Configuration Special Cases In this example the signal width is modified by the program according to the state of controller inputs l0 0 0 and l0 0 1 If 10 0 1 and 10 0 2 are set to 0 the PWMO R ratio is set at 20 the duration of the signal at state 1 is then 20 x 500 ms 100 ms If 10 0 0 is set to 0 and l0 0 1 is set to 1 the PWMO R ratio is set at 50 duration 250 ms If 10 0 0 and l0 0 1 are set to 1 the PWMO R ratio is set at 80 duration 400 ms Programming Example 10 0 I0 1 LDN I0 0 PWMO R 20 ANDN IO 1 PWMO0O R 20 10 0 I0 1 LD 10 0 PWMO R 50 ANDN I0 1 Y PWMO0O R 50 10 0
366. rafcet list instructions but not graphical Grafcet You can use a personal computer PC to create and edit Twido control programs using these programming languages A List Ladder reversibility feature allows you to conveniently reverse a program from Ladder to List and from List to Ladder A program written in Instruction List language consists of a series of instructions executed sequentially by the controller The following is an example of a List program 0 BLK C8 1 LDF i0 1 2 R 3 LD 02 4 AND M0 5 CU 6 OUT BLK 7 ID D 8 AND MI 9 ST Q04 10 END BLK TWD USE 10AE 21 Twido Software Languages Ladder Diagrams Ladder diagrams are similar to relay logic diagrams that represent relay control circuits Graphic elements such as coils contacts and blocks represent instructions The following is an example of a Ladder diagram 01 Tay i t 1 T t t t N R H a g Mt a04 SADJY Dm gt f f k ns 9 es as ate ade ahs 35 as P 10 2 M0 C8 P 777 f f f i t t t 1 CU FE 4 He 4 4 4 CD F 4 4 4 z y j 4 4 4 j 4 4 22 TWDUSE 10AE Twido Software Languages Grafcet The Grafcet analytical method divides any sequential control system into a series of Language steps with which actions transitions
367. rame This also allows a good correspondence of words values in the transmission table 148 TWD USE 10AE Communications Ethernet TCP IP Communications Overview Ethernet Features Frame Format TCP Connections IP Address Modbus TCP Client Server The following information describes the Ethernet capable features of the Twido TWDLCAE4ODRF base controller The TWDLCAE40DPRF base controller is an Ethernet capable device that implements the Modbus Application Protocol MBAP over TCP IP Modbus TCP IP provides peer to peer communications over the network in a client server topology The Twido TWDLCAE40DRF compact controller supports the Ethernet II frame format only It does not accommodate IEEE802 3 framing Note that other PLCs available from Schneider Electric such as the Premium and Quantum series support both Ethernet Il and IEEE802 3 frame formats and are frame format selectable Therefore if you are planning to team up your Twido controller with Premium or Quantum PLCs you should configure them as using Ethernet II frame format to allow for optimum compatibility The TWDLCAE4ODRF compact controller is a 4 simultaneous channel device capable of communicating over a 100Base TX Ethernet network It implements 100Base TX auto negotiation and can work on a 10Base T network as well Moreover it allows one marked IP connection as configured in the TwidoSoft application program see Marked IP
368. ramme TWD USE 10AE 287 Grafcet Simultaneous sequences 8 ae _ 8g MAIO aa 9 LD 07 9 i 10 9 10 ie 9 _9 10 8 10 9 LD 10 8 10 8 11 11 11 12 a i MO 10 LD I10 9 iL 12 10 9 12 a 11 13 LD M0 J AND X12 M0 XI2 12 es i Teo 8 m H A 13 aari a 12 LD M0 AND X11 12 D 11 M0 X11 11 13 m 9 13 Not supported Twido Ladder Twido Instruction Language programme List programme Note For a Grafcet Chart to be operational at least one active step must be declared using the i instruction initial step or the chart should be pre positioned during preprocessing using system bit S23 and the instruction S Xi 288 TWD USE 10AE Grafcet Description of Grafcet Program Structure Introduction A TwidoSoft Grafcet program has three parts e Preprocessing e Sequential processing e Post Processing TWD USE 10AE 289 Grafcet Preprocessing Preprocessing consists of the following e Power returns e Faults e Changes of operating mode e Pre positioning Grafcet steps e Input logic The rising edge of input l0 6 sets bit S21 to 1 This disables the active steps and enables the inacti
369. ration 131 Standard requests 143 TCP Client Server 149 TCP Modbus messaging 177 Modbus Link Example 1 137 Example 2 140 Modbus TCP IP Remote devices 170 MPP 280 MPS 280 MRD 280 Multiply 349 N Network Addressing 42 Non reversible programming 372 NOP 362 NOP Instruction 362 NOT instruction 314 Numerical instructions Assignment 342 shift 354 Numerical processing Overview 341 O Object tables 45 Object validation 26 Objects Bit objects 27 Double word 32 Floating point 32 Function blocks 43 Structured 45 words 29 OCCUR_ARR 499 OPEN 260 Open loop adjustment 470 Operands 274 Operate blocks 256 graphic element 259 Operating modes 68 Operator Display Controller ID and states 235 Overview 232 Real Time correction 246 Serial port settings 244 System objects and variables 237 Time of day clock 245 OR Instruction 310 OUT_BLK 266 Output tab PID 447 Overflow Index 49 overflow 350 Overview PID 425 P Parameters 322 Parentheses modifiers 279 nesting 279 using in programs 278 PID Animation tab 452 AT tab 442 Configuration 432 Debugging 450 General tab 434 Input tab 437 Output tab 447 Overview 425 PID tab 439 Trace tab 454 PID characteristics 429 PID tab PID 439 544 TWD USE 10AE Index Pin outs Communications cable female connector 91 Communications cable male connector 91 Potentiometer 184 Power cut 70 Power r
370. rd mode PLSO TON IN Q lt gt z ERE EE SINGLE ADJ _ Variable period PLSi P T IR DL e TON T 2 for the 0 142ms and 0 57ms time bases PLSi P TB 2 e TON whole part PLSi P 2 TB for the 10ms to 1s time bases 384 TWD USE 10AE Advanced Instructions Specifications The table below contains the characteristics of the PLS function block Function Object Description Timebase TB 0 142 ms 0 57 ms 10 ms 1 sec Preset PLSi P Pulses on output PLS1 are not stopped when PLS1 N or period PLS1 ND is reached for time bases 0 142 ms and 0 57 ms e 1 lt PLSi P lt 32767 for time base 10 ms or 1 s e 0 lt PLSi P lt 255 for time base 0 57 ms or 0 142 ms e 0 Function not in use To obtain a good level of precision from the duty cycle with time bases of 10ms and 1s you are recommended to have a PLSi gt 100 if P is odd Number of PLSi N The number of pulses to be generated in period T can be limited pulses PLSi ND to the range 0 lt PLSi N lt 32767 in standard mode or i 0 lt PLSi ND lt 4294967295 in double word mode The default value is set to 0 To produce an unlimited number of pulses set PLSi N or PLSi ND to zero The number of pulses can always be changed irrespective of the Adjustable setting Adjustable Y N If set to Y itis possible to modify the preset value PLSi P via the HMI
371. reater than 1 it produces an indeterminate or infinite result and changes bit S18 to 1 the word SW17 See System Words SW p 517 indicates the cause of the error e the functions SIN COS TAN allow as a parameter an angle between_4096r and 49967 but their precision decreases progressively for the angles outside the period _ and 47 because of the imprecision brought by the modulo 2x carried out on the parameter before any operation TWD USE 10AE 485 Advanced Instructions Conversion instructions General These instructions are used to carry out conversion operations DEG_TO_RAD conversion of degrees into radian the result is the value of the angle between 0 and 27 RAD_TO_DEG cosine of an angle expressed in radian the result is the value of the angle between 0 and 360 degrees Structure Ladder language MO MF0 DEG_TO_RAD MF10 M2 MF2 RAD_TO_DEG MF20 Instruction List Language LD MO MFO DEG TO RAD MF10 LD M2 MF2 RAD TO DEG MF20 Structured Text language IF SMO THEN MF0 DEG TO RAD MF10 END IF IF M2 THEN MF2 RAD TO DEG MF20 END IF Syntax Operators operands and syntax of conversion instructions Operators Syntax Operand 1 Op1 Operand 2 Op2 DEG_TO_RAD Op1 Operator Op2 MFi MFi KFi RAD_TO_DEG 486 TWD USE 10AE Advanced Instructions Ru
372. refine the process regulation provided by the PID parameters Kp Ti Td obtained from auto tuning you also have the ability to adjust those parameter values manually directly from the PID tab of the PID configuration screen or via the corresponding memory words MW The auto tuning is best suited for processes whose time constant t and delay time 6 meet the following requirement t 0 lt 2700 s i e 45 min The PID control is best suited for the regulation of processes that satisfy the following condition 2 lt 1 0 lt 20 where t is the time constant of the process and 8 is the delay time Note Depending on the ratio 7 6 e 1 0 lt 2 The PID regulation has reached its limitations more advanced regulation techniques are needed in this case e 1 8 gt 20 In this case a simple on off or two step controller can be used in place of the PID controller TWD USE 10AE 467 Advanced Instructions Troubleshooting Errors of the Auto tuning Function The following table records the auto tuning error messages and describes possible causes as well as troubleshooting actions Error Message Possible Cause Explanation Possible Solution Autotuning error the process variable PV limit has been reached The process variable is reaching the maximum value allowed This is a system safety As the AT is an open loop process the Process Variable PV Limit works as an
373. rences then Connection management were established with their default value with a timeout of 5000 and break timeout of 20 Crossed adaptor for cable TSX PCX 1031 and Westermo TD 33 modem SR1 MOD01 TWD USE 10AE 103 Communications Appendix 2 Modem Westermo TD 33 Schneider reference number SR1 MOD01 This modem manages four DIP switches which must all be set to OFF Factory Settings Use stored configuration speed amp format etc Disable DTR Hotcall Auto Band Appendix 3 Wavecom WMOD2B modem Schneider reference number SR1 MODO2 double band 900 1800Hz 3 aw F wvovacan me wise ja ca AERO 4 Appendix 4 Reference numbers of the products used in this document Twido product TWD LMDA 20DRT Twidosoft software TWD SPU 1002 V10M TSX PCX 1031 cable TSX PCX 1130 cable RTU modem Westermo TD 33 V90 SR1 MOD0O1 GSM modem Wavecom WMOD2B SR1 MOD0O2 104 TWD USE 10AE Communications Remote Link Communications Introduction The remote link is a high speed master slave bus designed to communicate a small amount of data between the master controller and up to seven remote slave controllers Application or I O data is transferred depending on the configuration of the remote controllers A mixture of remote controller types is possible where some can be remote I O and some can be peers Note The master controller contains information regar
374. ring by tracking references to software objects made by an application An object is considered to be referenced by the application if it is used as an operand in a list instruction or ladder rung Displays status information about the percentage of total memory used and provides a warning if memory is getting low See Memory Usage Indicator A method of programming that allows instructions to be viewed alternately as List instructions or Ladder rungs A device that connects two or more sections of a network and allows information to flow between them A router examines every packet it receives and decides whether to block the packet from the rest of the network or transmit it The router will attempt to send the packet through the network by the most efficient path See Real Time Clock Remote Terminal Unit A protocol using eight bits that is used for communicating between a controller and a PC TWD USE 10AE 535 Glossary Run Rung Rung header A command that causes the controller to run an application program A rung is located between two potential bars in a grid and is composed of a group of graphical elements joined to each other by horizontal and vertical links The maximum dimensions of a rung are seven rows and eleven columns A panel that appears directly over a Ladder rung and can be used to document the purpose of the rung Scan Scan mode Schedule blocks Server Step Stop Subnet Subnet
375. rising edge of output FCi D This allows for successive different counts without the loss of a single pulse 394 TWD USE 10AE Advanced Instructions Operation Configuration and Programming Special Cases If configured to up count when a rising edge appears at the dedicated input the current value is incremented by one When the preset value FCi P or FCi PD is reached the Done output bit FCi D is set to 1 and zero is loaded into the current value FCi V or FCi VD If configured to down count when a rising edge appears at the dedicated input the current value is decreased by one When the value is zero the Done output bit FCi D is set to 1 and the preset value is loaded into the current value FCi V or FCi VD In this example the application counts a number of items up to 5000 while l1 1 is set to 1 The input for FCO is the dedicated input 10 0 2 When the preset value is reached FCO D is set to 1 and retains the same value until FCO R is commanded by the result of AND on l1 2 and MO I1 1 Q0 0 IN FCO FCO p LD 11 IN i TYPE UP LD I1 2 11 2 M0 SINGLE AND MO R ADJY R I I FCO P 5000 OUT BLK LDD ST Q0 0 END_BLK The following table contains a list of special operating cases for the FC function block Special case Description Effect of cold restart S0 1 Resets all the FC attributes with the values co
376. rmat Analog output Specify the PID output in auto mode here This Analog output can be MW type MW0 to MW2999 or QW type QWx 0 TWD USE 10AE Advanced Instructions Field Description PWM output Check this box if you want to use the PWM function of PID enabled Specify the modulation period in Period 0 1s This period must be Period 0 1s between 1 and 500 and can be an internal word MW0 to MW2999 Output or an internal constant KWO to KW255 Specify the PWM output bit as the value in Output This can be either an internal bit MO0 to M255 or an output Qx 0 to Qx 32 Diagram The diagram allows you to view the different possibilities available for configuring your PID Note The term Reverse in the action field is used to reach a high setpoint e g for heating setpoint The term Direct in the action field is used to reach alow setpoint e g for cooling setpoint ae aes NS gt TWD USE 10AE 449 Advanced Instructions How to access PID debugging Ata Glance Procedure The following paragraphs describe how to access the PID debugging screens on TWIDO controllers The following table describes the procedure for accessing the PID debugging screens Step Action 1 Check that you are in online mode 2 Open the browser Result TwidoSoft no heading File Edit Display Tools Hardware So
377. rol table 0 01 Transmission 06 Transmission length reception 1 03 Reception Offset 00 Transmission offset Transmission table 2 Slave 1 247 03 or 04 Request code 3 Number of the first word to read 4 N Number of words to read Reception table 5 Slave 1 247 03 Response code after response 6 00 byte added by Rx 2 N number of bytes read Offset action 7 First word read Second word read if N gt 1 N 6 Word N read if N gt 2 This byte also receives the length of the string transmitted after response Note The Rx offset of three will add a byte value 0 at the third position in the reception table This ensures a good positioning of the number of bytes read and of the read words values in this table 144 TWD USE 10AE Communications Modbus Master Write Bit This table represents Request 05 Table Most significant byte Least significant byte Index Control table 0 01 Transmission 06 Transmission length reception 1 00 Reception offset 00 Transmission offset Transmission table 2 Slave 1 247 05 Request code 3 Number of the bit to write 4 Bit value to write Reception table 5 Slave 1 247 05 Response code after response 6 Number of the bit written 7 Value written This byte also receives the length of the string transmitted after response Note e This request does not need th
378. rtcut menu select e New to create a new slave A slave configuration screen is displayed the Address field shows the selected address the Profile fields are set to F by default and all other fields in the screen are blank e Open to create a new slave or to modify the configuration of the selected slave For a new slave a new screen for configuring the slave is displayed the Address field shows the selected address the Profile fields are set to F by default and all other fields in the screen are blank For a modification the slave configuration screen is displayed with fields containing the values previously defined for the selected slave Illustration of a Configuration Screen for a New Slave Configuring an AS Interface Slave EW Name BERD Address m Permanent Characteristics Profile 10 ID D1 ID2 m Permanent Parameters Bits C Decimal 0M Pamer 2 Poancers 17 Pam 3 7 Paare Inputs Outputs Inputs C Outputs CI Catalog Cancel 3 In the slave configuration screen that is then displayed enter or modify e the name of the new profile limited to 13 characters e acomment optional Or click Catalog and select a slave from the pre configured AS Interface profile family 4 Enter e the IO code corresponds to the input output configuration e the ID code identifier plus ID1 and for an extended type Note The Inputs and Outputs fields
379. rwritten by the number of characters received at the end of the reception if reception is requested This parameter is the length in bytes of the transmission table If the Tx Offset parameter is equal to 0 this parameter will be equal to the length of the transmission frame If the Tx Offset parameter is not equal to 0 one byte of the transmission table indicated by the offset value will not be transmitted and this parameter is equal to the frame length itself plus 1 The Command byte in case of Modbus RTU request except for broadcast must always equal to 1 Tx and Rx The Tx Offset byte contains the rank 1 for the first byte 2 for the second byte and so on within the Transmission Table of the byte to ignore when transmitting the bytes This is used to handle the issues associated with byte word values within the Modbus protocol For example if this byte contains 3 the third byte would be ignored making the fourth byte in the table the third byte to be transmitted 132 TWD USE 10AE Communications The Rx Offset byte contains the rank 1 for the first byte 2 for the second byte and so on within the Reception Table to add when transmitting the packet This is used to handle the issues associated with byte word values within the Modbus protocol For example if this byte contains 3 the third byte within the table would be filled with a ZERO and the third byte was actually received would be entered into the fourth locati
380. s Block Timer TMi 0 127 Word Current Value TMi V no Preset value TMi P yes Bit Timer output TMi Q no Up Down Ci 0 127 Word Current Value Ci V no Counter Preset value Ci P yes Bit Underflow Ci E no output empty Preset output Ci D no reached Overflow output Ci F no full 318 TWD USE 10AE Basic Instructions Standard function blocks programming principles Introduction Reversible Programming Example with Output Wiring Use one of the following methods to program standard function blocks e Function block instructions for example BLK TM2 This reversible method of programming ladder language enables operations to be performed on the block in a single place in the program e Specific instructions for example CU Ci This non reversible method enables operations to be performed on the block s inputs in several places in the program for example Line 100 CU C1 line 174 CD C1 line 209 LD C1 D Use instructions BLK OUT_BLK and END_BLK for reversible programming e BLK Indicates the beginning of the block e OUT_BLK Is used to directly wire the block outputs e END _ BLK Indicates the end of the block The following example shows reversible programming of a counter function block with wired outputs I1 1 NH R C8 ER BLK C8 LDF lIl l IS M1 Q0 4 R Input I1 2 MO ADJ Y D H I LD I1 2 Processing H cu Ci P 9999
381. s LAS table with addresses from OA to 15A 1 bit per slave 5 Result Reads the list of active slaves LAS table with addresses from 16A to 31A 1 bit per slave 6 Result Reads the list of active slaves LAS table with addresses from OB to 15B 1 bit per slave 7 Result Reads the list of active slaves LAS table with addresses from 16B to 31B 1 bit per slave 8 Result Reads the list of detected slaves LDS table with addresses from OA to 15A 1 bit per slave 9 Result Reads the list of detected slaves LDS table with addresses from 16A to 31A 1 bit per slave 10 Result Reads the list of detected slaves LDS table with addresses from OB to 15B 1 bit per slave 226 TWDUSE 10AE Installing the AS Interface bus MWx MWx 1 Action 11 Result Reads the list of detected slaves LDS table with addresses from 16B to 31B 1 bit per slave 12 Result Reads the list of peripheral faults on slaves LPF table with addresses OA to 15A 1 bit per slave 13 Result Reads the list of peripheral faults on slaves LPF table with addresses 16A to 31A 1 bit per slave 14 Result Reads the list of peripheral faults on slaves LPF table with addresses OB to 15B 1 bit per slave 15 Result Reads the list of peripheral faults on slaves LPF table with addresses 16B to 31B 1 bit per slave 16 Result Reads bus status See the results details in the next paragraph Note Bus status is updated
382. s Configure Marked IP Idle Checking Remote Devices f Default IP Address f Configured IP Address 192 168 1 101 Subnetwork mask 255 255 255 0 Gateway 192 168 1 101 Cancel Help The following information describes how to configure the various fields in the IP Address Configure tab Field Configuring Default IP Check this radio button if you do not wish to set the IP address of the Twido Address controller manually the IP Address Subnetwork mask and Gateway textboxes are grayed out The Twido controller will then use the default Ethernet interface IP address derived from its MAC address Note To find out more information about the MAC address please refer to Assigning IP Addresses p 158 Configured Check this radio button to configure the IP subnetwork and gateway addresses manually Note Consult with your network or system administrator to obtain valid IP parameters for your network 164 TWD USE 10AE Communications Field Configuring IP Address Enter the static IP address of your Twido in dotted decimal notation Caution For good device communication the IP addresses of the PC running the TwidoSoft application and the Twido controller must share the same network ID Note To allow good communication over the network each connected device must have a unique IP address When connected to the network the Twido
383. s the following assumption e The control process can be adequately described as a first order with time delay model by the following transfer function S k Op e U 1 Tp For more details see Appendix 2 First Order With Time Delay Model TWD USE 10AE 461 Advanced Instructions Using the Process Response Curve Method To determine the sampling period Ts using the process response curve method follow these steps Step Action 1 It is assumed that you have already configured the various settings in the General Input PID AT and Output tabs of the PID Select the PID gt Output tab from the Application Browser Select Authorize or Address bit from the Manual mode dropdown list to allow manual output and set the Output field to a high level in the 5000 10000 range Select PLC gt Transfer PC gt PLC from menu bar to download the application program to the Twido PLC Within the PID configuration window switch to Trace mode Run the PID and check the response curve rise When the response curve has reached a steady state stop the PID measurement Note Keep the PID Trace window active Use the following graphical method to determine time constant t of the control process 1 Compute the process variable output at 63 rise Sjg3e by using the following formula St63 S initian Sending S initian x63 2 Find out graphically the time absc
384. s used to enter the PID output parameters Note It is accessible in offline mode Ouput Tab of the The screen below is used to enter the internal PID parameters PID Function PID WEG PID number lo Input PID AT Output Animation Trace General Output PWM Action Limits Manual Mode Output Address bi Authorize analog Authorize Period Bit a OM ey co ES E output Output PID controller Setpoin AT Cancel Previous Next Help 447 TWD USE 10AE Advanced Instructions The table below describes the settings that you may define Field Description PID number Specify the PID number that you wish to configure here The value is between 0 and 13 14 PID maximum per application Action Specify the type of PID action on the process here Three options are available Reverse Direct or bit address If you have selected bit address you can modify this type via the program by modifying the associated bit which is either an internal bit MO to M255 or an input Ix 0 to lx 32 Action is direct if the bit is set to 1 and reverse if it is not Note When AT is enabled the Auto Tuning algorithm automatically determines the correct type of action direct or reverse for the control process In this case only one option is available from the Action drop
385. sed as internal bits 256 All other controllers System System bits S0 to S127 Si 128 According monitor the correct operation of to i the controller and the correct running of the application program TWD USE 10AE 27 Twido Language Objects Type Description Address or Maximum Write value number access 1 Function The function block bits TMi Q Note 4 No 3 blocks correspond to the outputs of the Ci P and function blocks so on These outputs may be either directly connected or used as an object Reversible Function blocks programmed E D F Q Note 4 No function using reversible programming THO TH1 blocks instructions BLK OUT_BLK and END_BLK Word One of the 16 bits in some words Variable Variable Variable extracts can be extracted as operand bits Grafcet Bits X1 to Xi are associated X21 62 Yes steps with Grafcet steps Step bit Xi is TWDLCeA10 set to 1 when the corresponding DRF step is active and set to 0 when TWDLCeA16 the step is deactivated DRF 96 TWDLCeA24 DRF TWDLCA 40 DRF and Modular controllers Legends 1 Written by the program or by using the Animation Tables Editor 2 See I O Addressing 3 Except for SBRi j and SCi j these bits can be read and written 4 Number is determined by controller model 5 Where x address of the expansion module 0 7 y AS Interface address 0A 31B z channel number 0 3
386. sembly and installation instructions are provided in the Twido Hardware Reference Manual TWD USE 10AE c 2002 2004 Schneider Electric All Rights Reserved Additional Safety Those responsible for the application implementation or use of this product must Information ensure that the necessary design considerations have been incorporated into each application completely adhering to applicable laws performance and safety requirements regulations codes and standards 12 TWD USE 10AE Safety Information General Warnings and Cautions WARNING EXPLOSION HAZARD e Substitution of components may impair suitability for Class Div 2 compliance e Do not disconnect equipment unless power has been switched off or the area is known to be non hazardous Failure to follow this precaution can result in death serious injury or equipment damage WARNING UNINTENDED EQUIPMENT OPERATION e Turn power off before installing removing wiring or maintaining e This product is not intended for use in safety critical machine functions Where personnel and or equipment hazards exist use appropriate hard wired safety interlocks e Do not disassemble repair or modify the modules e This controller is designed for use within an enclosure e Install the modules in the operating environment conditions described e Use the sensor power supply only for supplying power to sensors connected to the module
387. sists of a display area and four push button input keys Display area T M 123 V 1234 MOD Esc ENTER J DA Input keys Display area The Operator Display provides an LCD display capable of displaying two lines of characters e The first line of the display has three 13 segment characters and four 7 segment characters e The second line has one 13 segment character one 3 segment character for a plus minus sign and five 7 segment characters Input keys The functions of the four input push buttons depend on the Operator Display mode Key In Display Mode In Edit Mode ESC Discard changes and return to previous display a Go to the next value of an object being edited gt Advance to next display Go to the next object type to edit MOD Go to edit mode Accept changes and return to previous ENTER display TWD USE 10AE 233 Operator Display Operation Selecting and Navigating the Displays The initial display or screen of the Operator Display shows the controller identifi cation and state information Press the I push button to sequence through each of the displays The screens for the Time of Day Clock or the Real Time Correction Factor are not displayed if the optional RTC cartridge TWDXCPRTC is not detected on the controller As ashortcut press the ESC key to return to the initial display screen For most screens pressing the ESC key will r
388. ssociated bit is set to 1 Only one step of a step counter can be active at a time Illustration The following is an example of a Step Counter function block SCi R CU CD Parameters The step function block has the following parameters Parameter Label Value Step counter number SCi 0 7 Step Counter bit SCi j Step counter bits 0 to 255 j 0 to 255 can be tested by a Load logical operation and written by an Assignment instruction Reset input or R When function parameter R is 1 this resets the instruction step counter Increment input or CU On arising edge increments the step counter by instruction one step Decrement input or CD On a rising edge decrements the step counter instruction by one step 336 TWD USE 10AE Basic Instructions Timing Diagram The following timing diagram illustrates the operation of the step function block CU input i 4 4 CD input 4 4 Active step number TWD USE 10AE 337 Basic Instructions Programming The following is an example of a Step Counter function block e Step Counter 0 is incremented by input l0 2 e Step Counter 0 is reset to 0 by input l0 3 or when it arrives at step 3 e Step 0 controls output Q0 1 step 1 controls output Q0 2 and step 2 controls output Q0 3 The
389. st enter a subnet mask that is identical to that specified for the PC Note If subnetting is not used on your Class C network we suggest you to specify a Class C network default subnet mask such as 255 255 255 0 Enter a valid Gateway address in dotted decimal notation Note If there is no gateway device on your stand alone network enter the Twido controller s own IP Address that you have just configured in step 6 in this field Click on OK to save the Ethernet configuration settings of your Twido controller TWD USE 10AE 153 Communications Setting Upa New You will now set up anew TCP IP connection in the TwidoSoft application The new TCP IP dedicated TCP IP connection will allow the PC running TwidoSoft and the Twido Connection in controller to communicate over the Ethernet network Twi ft doSo Step Action 1 Select File gt Preferences gt Connections Management from the TwidoSoft menu bar to call up the Connections Management dialogbox as shown below Connections management Name Connection type Configuration Timeout Break timeol 4 COM6 Serial COM6 5000 20 COM7 S rial COM7 5000 20 TCPIPO1 TCP IP 192 168 1 101 5000 5000 TCPIPO2 TCP IP 192 168 1 50 5000 5000 TCPIPO3 TCP IP 192 168 1 30 5 5000 5000 E I n gt Add Modify Delete 2 Click the Add button in the Connections Management dialogbox Result A new conne
390. stand alone network you will not need to change the IP address settings skip steps 1 6 and continue to the following section Follow steps 1 6 of this procedure only if you intend to change the PC s TCP IP settings 1 Select Control Panel gt Network Connections from the Windows Start menu 2 Right click on the Local Area Connection the stand alone network on which you are planning to install the Twido controller and select Properties 3 Select TCP IP from the list of network components installed and click Properties Note If TCP IP protocol is not among the list of installed components please refer to the user s manual of your operating system to find out how to install the TCP IP network component 4 The TCP IP Properties dialog box appears and displays the current TCP IP settings of your PC including IP Address and Subnet Mask Note On a stand alone network do not use the Obtain an IP address automatically option The Specify an IP address radio button must be selected and the IP Address and Subnet Mask fields must contain valid IP settings 5 Enter a valid static IP Address in dotted decimal notation Over a stand alone network we suggest you to specify a Class C network IP address see IP Addressing p 156 For example 192 168 1 198 is a Class C IP address Note The IP address you specify must be compatible with the network ID of the existing network For example if the existing network supports 192
391. t Instruction Function Normally open contact 4H LD Passing contact when the controlling bit object is at state 1 Normally closed LDN Passing contact when the contact controlling bit object is at state 0 Contact for detecting a LDR Rising edge detecting the change rising edge P from 0 to 1 of the controlling bit object Contact for detecting a LDF Falling edge detecting the change falling edge N from 1 to 0 of the controlling bit object The graphic link elements are used to connect the test and action graphic elements Name Graphic element Function Horizontal connection Links in series the test and action graphic elements between the two potential bars Vertical connection Links the test and action graphic elements in parallel TWD USE 10AE 257 Ladder Language Coils The coil graphic elements are programmed in the action zone and take up one cell one row high and one column wide Name Graphic Instruction Function element Direct coil ST The associated bit object takes the gt value of the test zone result Inverse coil A STN The associated bit object takes the negated value of the test zone result Set coil S S The associated bit object is set to 1 when the result of the test zone is 1 Reset coil R The associated bit object is set to 0 R when the result of the test z
392. t Bit string gt word or double word Floating point indexed or not gt floating point indexed or not Word or double word gt bit string Immediate floating point value gt floating point indexed or not TWD USE 10AE 343 Basic Instructions Examples Examples of word assignments LD 1 SW 112 MW 100 SW112 MW100 Ex 1 LD I10 2 MWO MW 10 K W0 MW20 gt MWO MW10 Ex 2 KWO MW20 MW10 100 LDR l10 3 Ex 3 MW10 100 Syntax Syntax for word assignments Operator Syntax Op1 Op2 Operand 1 Op1 assumes the value of operand 2 Op2 The following table gives details operands Type Operand 1 Op1 Operand 2 Op2 word BLK x MWi Immediate value MWi double QWi QWAI SWi KWi IW IWAi word bit MWi MWi MDi QWi SQWAI SWi string MDi MWij MWi MWi Mi L QiI L Si L KWi MWi MDi Xi L MDi MWj KDi KDI MWJ INW Mi L Qi L YQNW Si L Xi L li L Floating MFi MFi MWj Immediate floating point point value MFi MFi MWj KFi KFi MWj Note The abbreviation BLK x for example R3 1 is used to describe any function block word For bit strings Mi L Si L and Xi L the base address of the first of the bit string must be a multiple of 8 0 8 16 96 344 TWD USE 10AE Basic Instructions
393. t number to the EXCH or MSG function EXCH1 EXCH2 MSG1 MSG2 In addition TWDLCAE40DRPRF series controllers implement Modbus TCP messaging over the Ethernet network by using the EXCH3 intruction and MSG3 function EXCH The EXCH instruction allows a Twido controller to send and or receive information Instruction to from ASCII devices The user defines a table of words MWi L containing the data to be sent and or received up to 250 data bytes in transmission and or reception The format for the word table is described in the paragraphs about each protocol A message exchange is performed using the EXCH instruction Syntax The following is the format for the EXCH instruction EXCHx MWi L Where x serial port number 1 or 2 x Ethernet port 3 L total number of words of the word table maximum 121 Values of the internal word table MWi L are such as i L lt 255 The Twido controller must finish the exchange from the first EXCHx instruction before a second exchange instruction can be started The MSG function block must be used when sending several messages Note To find out more information about the Modbus TCP messaging instruction EXCH3 please refer to TCP Modbus Messaging p 177 408 TWD USE 10AE Advanced Instructions Exchange Control Function Block MSGx Introduction Note The x in MSGx signifies the controller port x 1 or 2 e x 1 or 2 signifies the serial p
394. t and from List back to Ladder Use TwidoSoft to set the default display of programs either List or Ladder format by setting user preferences TwidoSoft can also be used to toggle List and Ladder views A key to understanding the program reversibility feature is examining the relationship of a Ladder rung and the associated instruction List sequence e Ladder rung A collection of Ladder instructions that constitute a logical expression e List sequence A collection of List programming instructions that correspond to the Ladder instructions and represents the same logical expression The following illustration displays a common Ladder rung and its equivalent program logic expressed as a sequence of List instructions I10 5 Q0 4 LD I10 5 OR I10 4 10 4 ST QO0 4 An application program is stored internally as List instructions regardless if the program is written in Ladder language or List language TwidoSoft takes advantage of the program structure similarities between the two languages and uses this internal List image of the program to display it in the List and Ladder viewers and editors as either a List program its basic form or graphically as a Ladder diagram depending upon the selected user preference Programs created in Ladder can always be reversed to List However some List logic may not reverse to Ladder To ensure reversibility from List to Ladder it is important to fol
395. ta are recorded in C e The Twido PLC drives a heating lamp via the PWM discrete output of the PID The experiment is carried out as follows Step Action 1 The PID Output tab is selected from the PID configuration screen Manual mode is selected from the Output tab The manual mode Output is set to 10000 The PID run is launched from the PID Trace tab a AJ OJN The PID run is stopped when the oven s temperature has reached a steady state TWD USE 10AE 463 Advanced Instructions Step Action 6 The following information is obtained directly from the graphical analysis of the response curve as shown in the figure below PID 21x PID number lol General Input PID AT Output Animation Trace Lo 60min M S ej 660 MK Si63 512 Initialize Detach Setpoint Measure cK coe erevous Net He where Sj initial value of process variable 260 Sie ending value of process variable 660 Si63 process variable at 63 rise S Sjj Spey x 63 260 660 260 x63 512 e z time constant time elapsed from the start of the rise till Sjgge is reached 9 min 30 s 570 s 7 The sampling period Ts is determined using the following relationship Ts 1 75 570 75 7 6 s 7600 ms 464 TWD USE 10AE Advanced Instructions Step Action In the Program gt Scan mode edit
396. tart acquisition of inputs and the end update of outputs of a scan cycle e To allow proper detection when a pulse signal is provided on input the pulse period Tpuise Of that signal must be longer than twice the maximum scan time recorded in system word SW31 as specified by the following condition Tpulse 2 2 X SW31 SW32 Min scan time Shows execution time of shortest controller scan cycle since the last cold start in ms Note This time corresponds to the time elapsed between the start acquisition of inputs and the end update of outputs of a scan cycle gt SW48 Number of events Shows how many events have been executed since the last cold start Note Set to 0 after application loading and cold start increments on each event execution TWD USE 10AE 519 System Bits and Words System Function Description Control Words SW4Y Real Time Clock RTC Functions words containing current date and time values in S and U SW50 RTC BCD SW51 SW49 xN Day of the week N 1 for SW52 Monday SW53 SW50 00SS Seconds SW51 HHMM Hour and minute SW52 MMDD Month and day SW53 CCYY Century and year These words are controlled by the system when bit S50 is at 0 These words can be written by the user program or by the terminal when bit S50 is set to 1 On a falling edge of S50 the controller
397. tended program you must install the 64K extended Software and memory cartridge into your controller The following four steps show you how Install Extended Step Agiion Memory 1 Under the Hardware option menu on you Twido software window enter TWDXCPMFK64 Power down the controller Plug in the 64K extended memory cartridge Powerup the controller Save your Once your 64K extended memory cartridge has been installed and your program program written e From the Twido software window bring down the menu under Controller scroll down to Backup and click on it Data MWs Here are the steps for backing up data memory words into the EEPROM Backup Step Action 1 For this to work the following must be true A valid program is present Memory words are configured in the program 2 Set SW97 to the length of the memory words to be saved Note Length cannot exceed the configured memory word length and it must be greater than 0 but not greater than 512 3 Set SW96 X0 to 1 Data MWs Restore MWs manually by setting system bit S95 to 1 Restore For this to work the following must be true e A valid program is present e The backup memory words are valid 60 TWD USE 10AE Controller Operating Modes At a Glance Subject of this This chapter describes controller operating modes and cyclic and periodic program Chapter execution Included are details about power outages and restoration
398. teps 1 1 1 0 0 6 steps 0 1 1 0 1 7 steps 1 1 1 1 0 In the above example step 5 is the current step control bits Q0 1 Q0 3 and Q1 5 are set to state 1 control bits Q0 6 Q0 5 and Q1 0 are set to state 0 The current step number is incremented on each rising edge at input U or on activation of instruction U The current step can be modified by the program The following diagram illustrates the operation of the drum controller Input U i l4 l4 4 Input R l Step No DRIS O 71 2 3 L 1 0 1 2 1 Output DRi F TWD USE 10AE 389 Advanced Instructions Special Cases The following table contains a list of special cases for drum controller operation Special case Description Effects of a cold restart Resets the drum controller to step 0 update of control bits S0 1 Effect of a warm restart Updates the control bits after the current step S1 1 Effect of a program jump The fact that the drum controller is no longer scanned means the control bits are not reset Updating the control bits Only occurs when there is a change of step or in the case of a warm or cold restart 390 TWD USE 10AE Advanced Instructions Programming and Configuring Drum Controllers Introduction Programming Example The following is an example
399. the COM2 port and to ensure that there is no flow control Use TwidoSoft to configure the controller s port First the hardware option is configured In this example the TWDNOZ232D is added to the Modular base controller Second the Controller Communication Setup is initialized with all of the same parameter settings as the Terminal Emulator on the PC In this example capital letter A is chosen for the End of Frame character in order to terminate character reception A 10 second time out for the Response Timeout parameter is chosen Only one of these two parameters will be invoked depending on whichever one happens first Step 4 Write the application LD 1 MW10 16 0104 MW11 16 0000 MW 12 16 4F4B MW13 16 0A0D LD 1 AND MSG2 D EXCH2 MW10 8 LD MSG2 E ST Q0 0 END Use TwidoSoft to create an application program with three primary parts First initialize the Control and Transmission tables to use for the EXCH instruction In this example a command is set up to both send and receive data The amount of data to send is set to 4 bytes and is initialized to the characters O K CR LF TWD USE 10AE 127 Communications Next check the status bit associated with MSG2 and issue the EXCH2 instruction only if the port is ready For the EXCH2 instruction a value of 8 words is specified There are 2 Control words MW10 and MW11 2 words to be used for transmit informat
400. the Internet or a company s Intranet MAC Address Each Twido TWDLCAE40DRF controller has its own factory set MAC address that is a worldwide unique 48 bit address assigned to each Ethernet device Controller Default IP Address The default Ethernet interface IP address of the Twido controller is derived from its unique MAC address The default IP address expressed in dotted decimal notation is defined as follows 085 016 xxx yyy where e 085 016 s a set header shared by all IP addresses derived from MAC address xxx and yyy are last two numbers of the device MAC address For example the IP address derived from MAC address 00 80 F4 81 01 11 is 085 016 001 11 158 TWD USE 10AE Communications Checking the MAC Address and Current IP Address of the Controller To check out the MAC address and the current IP address of your Twido controller along with IP configuration settings subnetwork mask and gateway addresses and Ethernet connection status follows these instructions Step Action 1 In TwidoSoft application program select PLC from the menu bar 2 Select Check PLC from the menu items list Result The Controller Operations dialogbox appears displaying the Twido LEDs on a soft front panel as shown in the figure below Sta Scan Time W O Forced a Potentiometer 702 Longest 2 RAM Executable z Potentiometer 0 Current 17 Run RAM Protected T
401. the addressing format Group Item Description Symbol The percent symbol always precedes an internal address Type of object M Internal words store intermediary values while a program is running K Constant words store constant values or alphanumeric messages Their content can only be written or modified by using TwidoSoft S System words provide status and control information for the controller Syntax W 16 bit word Number i The maximum number value depends on the number of objects configured Examples of word object addressing e MW15 internal word number 15 e KW26 constant word number 26 e SW30 system word number 30 TWD USE 10AE 37 Twido Language Objects Addressing floating objects Introduction Addressing floating objects except for input output addressing see Addressing Inputs Outputs p 40 and function blocks see Function Block Objects p 43 follows the format described below Syntax Use the following format to address internal and constant floating objects MorK F i Symbol Type of object Syntax Number Description The following table describes the elements in the addressing format Group Item Description Symbol The percent symbol always precedes an internal address Type of object M Internal floating objects store intermediary values while a program is running K Floating constants are used to store consta
402. the configuration at state 1 Oori CM or FM Read and S e Up Down or Down Counting initializes the current Write value with the preset value e Single Up Counting resets the current value to zero In addition this also initializes the operation of the threshold outputs and takes into account any user modifications to the threshold values set by the Operator Display or user program Overflow 0 to 65535 or from 65535 to 0 in standard mode Oor1 CM Read output 0 to 4294967295 or from 4294967295 to 0 in double F word mode TWD USE 10AE 399 Advanced Instructions Function Description Values YN FC Run time Use Access Threshold Set to 1 when the current value is greater than or equal 0 or 1 CM Read Bit 0 to the threshold value VFCi SO It is advisable to test VFCi THO this bit only once in the program because it is updated in real time The user application is responsible for the validity of the value at its time of use Threshold Set to 1 when the current value is greater than or equal 0 or 1 CM Read Bit 1 to the threshold value VFCi S1 It is advisable to test VFCI TH1 this bit only once in the program because it is updated in real time The user application is responsible for the validity of the value at its time of use Means a 32 bit double word variable The double word option is available on all controllers with the exception of the Twido TWDLCeA10DRF controllers 1 Writ
403. them individually Responses are not returned to broadcast queries from the master Hardware A Modbus link can be established on either the EIA RS 232 or EIA RS 485 port and Configuration can run on as many as two communications ports at a time Each of these ports can be assigned its own Modbus address using system bit S101 and system words SW101 and SW102 See System Bits S p 510 See also System Words SW p 517 The table below lists the devices that can be used Remote Port Specifications TWDLCeA10 16 24DRF 1 Base controller supporting a 3 wire EIA RS 485 port with TWDLCA 40DRF a miniDIN connector TWDLMDA20 40DTK TWDLMDA20DRT TWDNOZ232D 2 Communication module equipped with a 3 wire EIA RS 232 port with a miniDIN connector Note This module is only available for the Modular controllers When the module is attached the controller cannot have an Operator Display expansion module TWDNOZ485D 2 Communication module equipped with a 3 wire EIA RS 485 port with a miniDIN connector Note This module is only available for the Modular controllers When the module is attached the controller cannot have an Operator Display expansion module TWDNOZ485T 2 Communication module equipped with a 3 wire EIA RS 485 port with a terminal Note This module is only available for the Modular controllers When the module is attached the controller cannot have an Operator Display expansion module TW
404. tion blocks contend to use these same dedicated outputs so you must choose between the two functions Illustration PWM block and timing diagram PWMO IN T T m programmable width Tp TB l PWMi P A i configurable ma gt i fixed period T TWD USE 10AE 381 Advanced Instructions Parameters The following table lists parameters for the PWM function block Parameter Label Description Timebase TB 0 142 ms 0 57 ms 10 ms 1 s default value Preselection of PWMi P 0 lt PWMi P lt 32767 with time base 10 ms or 1s the period 0 lt PWMi P lt 255 with time base 0 57 ms or 0 142 s 0 Function not in use Duty cycle PWMi R This value gives the percentage of the signal in state 1 in a period The width Tp is thus equal to Tp T PWMi R 100 The user application writes the value for PWMi R It is this word which controls the duty cycle of the period For T definition see range of periods below The default value is 0 and values greater than 100 are considered to be equal to 100 Pulse IN At state 1 the pulse width modulation signal is generated generation input at the output channel At state 0 the output channel is set to 0 Range of Periods The preset value and the time base can be modified during configuration They are used to fix the signal period T PWMi P TB The lower the ratios to be obtained the greate
405. tions Status Information In addition to the system bits explained earlier the master maintains the presence and configuration status of remote controllers This action is performed in system words SW111 and SW113 Either the remote or the master can acquire the value of the last error that occurred while communicating on the remote link in system word SW112 System Use Words SW111 Remote link status two bits for each remote controller master only x0 6 0 Remote controller 1 7 not present 1 Remote controller 1 7 present x8 14 0 Remote I O detected at Remote controller 1 7 1 Peer controller detected at Remote controller 1 7 SW112 Remote Link configuration operation error code 0 operations are successful 1 timeout detected slave 2 checksum error detected slave 3 configuration mismatch slave SW113 Remote link configuration two bits for each remote controller master only x0 6 0 Remote controller 1 7 not configured 1 Remote controller 1 7 configured x8 14 0 Remote I O configured as remote controller 1 7 1 Peer controller configured as remote controller 1 7 114 TWD USE 10AE Communications Remote Link Example To configure a Remote Link you must 1 Configure the hardware 2 Wire the controllers 3 Connect the communications cable between the PC to the controllers 4 Configure the software 5 Write an application The
406. to an event e an event queue which can be used to store a list of events until they are executed e a priority level which specifies the order of event execution 78 TWD USE 10AE Event task management Description of different event sources Overview of Different Event Sources Physical Input Events of a Controller Base Output Event ofa NFC Function Block An event source needs to be managed by the software to make the sure the main program is properly interrupted by the event and to call the programming section linked to the event The application scan time has no effect on the execution of the events The following 9 event sources are allowed e 4 conditions linked to the VFC function block thresholds 2 events per VFC instance e 4 conditions linked to the physical inputs of a controller base e 1 periodic condition An event source can only be attached to a single event and must be immediately detected by TwidoSoft Once it is detected the software executes the programming section attached to the event each event is attached to a subroutine labeled SRi defined on configuration of the event sources Inputs l0 2 10 3 10 4 and l0 5 can be used as event sources provided they are not locked and that the events are allowed during configuration Event processing can be activated by inputs 2 to 5 of a controller base position 0 on a rising or falling edge For further details on config
407. too great gt 250 2 transmission table too small 3 word table too small 4 receive table overflowed 5 time out elapsed 6 transmission error 7 bad command within table 8 selected port not configured available 9 reception error 10 cannot use KW if receiving 11 transmission offset larger than transmission table 12 reception offset larger than reception table 13 controller stopped EXCH processing SW64 EXCH2 error code See SW63 If a controller restarts one of the following events happens e A cold start 80 1 forces a re initialization of the communications e Awarm start S1 1 forces a re initialization of the communications e In Stop the controller stops all ASCII communications TWD USE 10AE 125 Communications ASCII Link Example To configure an ASCII Link you must 1 Configure the hardware 2 Connect the ASCII communications cable 3 Configure the port 4 Write an application 5 Initialize the Animation Table Editor The diagram below illustrates the use of the ASCII communications with a Terminal Emulator on a PC Step 1 Configure the Hardware RS 232 EIA Port 2 Serial COM 2 Twido controller The hardware configuration is two serial connections from the PC to a Twido controller with an optional EIA RS 232 Port 2 On a Modular controller the optional Port 2 is a TWDNOZ232D or
408. troller Unit ID Enter an integer between 0 and 255 e Ifthe target Twido controller is located past a gateway or bridge on a Modbus serial link the Unit ID is the device serial e f the target Twido controller is located on the same Ethernet network layer as your PC you may leave this field blank The default Unit ID 255 will be assigned automatically 6 In the Timeout field enter a timeout value in milliseconds ms for establishing a connection with the Twido controller After timeout has elapsed and the PC has failed to connect to the controller the TwidoSoft application will give up trying to establish a connection To resume a new attempt for connection select PLC gt Select a connection from the TwidoSoft menu bar Note The maximum timeout value is 65535 ms 65 5 s 7 The Break timeout is the maximum elapsed time allowed between a Modbus TCP IP query and the reception of the response frame If Break timeout is exceeded without receiving the requested response frame the TwidoSoft application breaks the connection between the PC and the controller Note The maximum timeout value is 65535 ms 65 5 s The default value is 5000 ms Note that zero is not a valid entry you must set a non zero value in this field Note The maximum timeout value is 65535 ms 65 5 s 8 Click the OK button to save the new connection settings and close the Connections management dialog box Result The names of all the newly added conne
409. ts to count down The controller scan must end before the timer has finished and relaunches a new scan Operation The following drawing shows the running phases of the periodic scan time Processing the Processing the program program l Q 1 P Waiting l Q I P Waiting period period Scan n time Scan n 1 time al eg Period lt gt Description of The table below describes the operating phases Operating Address Phase Description Phases LLP Internal The system implicitly monitors the controller managing system processing bits and words updating current timer values updating status lights detecting RUN STOP switches etc and processes requests from TwidoSoft modifications and animation l YIW Acquisition of Writing to the memory the status of discrete and application input specific module inputs Program Running the application program written by the user processing Q Updating of Writing output bits or words associated with discrete and QW output application specific modules 64 TWD USE 10AE Controller Operating Modes Operating mode Controller in RUN the processor carries out e Internal processing e Acquisition of input e Processing the application program e Updating of output If the period has not finished the processor completes its operating cycle until the end of th
410. ture 289 Actions Associated with Grafcet Steps 293 TWD USE 10AE 283 Grafcet Description of Grafcet Instructions Introduction Grafcet instructions in TwidoSoft offer a simple method of translating a control sequence Grafcet chart The maximum number of Grafcet steps depend on the type of Twido controller The number of steps active at any one time is limited only by the total number of steps For the TWDLCAA10DRF and the TWDLCAA16DRF steps 1 through 62 are available Steps 0 and 63 are reserved for pre and post processing For all other controllers steps 1 through 95 are available 284 TWD USE 10AE Grafcet Grafcet Instructions The following table lists all instructions and objects required to program a Grafcet chart Graphic Transcription in Function representation 1 TwidoSoft language Illustration Initial step j Start the initial step 2 S i Activate step i after deactivating the Transition current step j Start step i and validate the associated Step pe transition 2 Deactivate the current step without activating any other steps Di Deactivate step i and the current step POST Start post processing and end sequential processing Xi Bit associated with step i can be tested and written maximum number of steps depends on controller LD Xi LDN Xi Test the activity of step i Xi AND Xi
411. ule block December Start date 1 31 The day in the month to start the schedule block End date 1 31 The day in the month to end the schedule block Start time hh mm The time of day hours 0 to 23 and minutes 0 to 59 to start the schedule block Stop time hh mm The time of day hours 0 to 23 and minutes 0 to 59 to end the schedule block Day of week Monday Check boxes that identify the day of the week for Sunday activation of the schedule block TWD USE 10AE 415 Advanced Instructions Enabling Schedule Blocks Output of Schedule Blocks Example The bits of system word SW114 enable bit set to 1 or disable bit set to 0 the operation of each of the 16 schedule blocks Assignment of schedule blocks in SW114 SW114 Schedule Schedule block 15 block 0 By default or after a cold restart all bits of this system word are set to 1 Use of these bits by the program is optional If the same output Mi or Qj k is assigned by several blocks it is the OR of the results of each of the blocks which is finally assigned to this object it is possible to have several operating ranges for the same output The following table shows the parameters for a summer month spray program example Parameter Value Description Schedule block 6 Schedule block number 6 Output bit Q0 2 Activate
412. umps with caution to avoid long loops that can increase scan time Avoid jumps to instructions that are located upstream An upstream instruction line appears before a jump in a program A downstream instruction line appears after a jump in a program Output bits like internal bits should only be modified once in the program In the case of output bits only the last value scanned is taken into account when the outputs are updated Sensors used directly for emergency stops must not be processed by the controller They must be connected directly to the corresponding outputs Make power returns conditional on a manual operation An automatic restart of the installation could cause unexpected operation of equipment use system bits SO S1 and S9 The state of system bit S51 which indicates any RTC faults should be checked When a program is entered TwidoSoft checks the syntax of the instructions the operands and their association Assignment operations should not be placed within parentheses LD I10 0 10 0 l10 1 Q0 1 AND I0 1 ry ORC I0 2 LJ 0 10 2 10 3 ST Q0 1 Q0 0 gt lt C TWD USE 10AE 261 Ladder Language In order to perform the same function the following equations must be programmed LD 00 MPS 10 0 I10 1 00 1 i oe AND I0 1 D OR I0 2 0 I0 2 10 3 DA 10 3
413. un on a controller TwidoSoft is a 32 bit Windows based program for a personal computer PC running Microsoft Windows 98 Second Edition Microsoft Windows 2000 Professional or Microsoft Windows XP operating systems The main software features of TwidoSoft e Standard Windows user interface e Program and configure Twido controllers e Controller communication and control Note The Controller PC link uses the TCP IP protocol It is essential for this protocol to be installed on the PC The minimum configuration for using TwidoSoft is e Pentium 300MHz e 128 Mb of RAM e 40 Mb of available space on the hard disk 20 TWD USE 10AE Twido Software Languages Introduction to Twido Languages Introduction Twido Languages Instruction List Language A programmable controller reads inputs writes to outputs and solves logic based on acontrol program Creating a control program for a Twido controller consists of writing a series of instructions in one of the Twido programming languages The following languages can be used to create Twido control programs e Instruction List Language An Instruction List program is a series of logical expressions written as a sequence of Boolean instructions e Ladder Diagrams A Ladder diagram is a graphical means of displaying a logical expression e Grafcet Language Grafcet language is made up of a series of steps and transitions Twido supports the use of G
414. unters 0 0 0 0 eee eee eee 332 Shift Bit Register Function Block SBRi 000 0c cece eee eee 334 Step Counter Function Block SCi 0 0 eee eee 336 Numerical Processing 0 0c eee ett 340 Ata Glance n i cach eta paced pee ne Sted tbat bd amp gerbe ages Ate 340 Introduction to Numerical Instructions 0 00 e eee eee 341 Assignment Instructions 0 0 cee ttt 342 Comparison Instructions 0 0 c cette 347 Arithmetic Instructions on Integers 0 0 0 cee ees 349 Logic INStructions 04 0 vis danke eee camo ati ee ME O 352 Shift INStructionss cco away Guts hea cs eed oe E ke eee ta Sees cokers 354 Conversion Instructions 20 0 0 0 cette 356 Single double word conversion instructions 020 eee ee eee 358 Program Instructions 0 0 eee eee 359 Ata GlanCe ss iene sete A ai phe re Sa Ai eee i ahs oe 359 END Instructions cst cided bee harder ba alle ll Ae gh te ated 360 NOP Instructions costes x ancanave te cunnen ak E a Rosas Pa ae pee See 362 Jump Instructions sod ea Pek eee ee osteo eet 363 Subroutine Instructions 0 0 cette 364 Advanced Instructions 2 00 c eee eee 367 Ata GINCO adie aa ecb phat Bnei eile big RA eat yee we eck ey Sada ge 367 Advanced Function Blocks 0 0c eee tte es 369 Ata GIANCG ts krda Site dat toed ne toate ied Sache En erage Gp tte 369 Bit and Word Objects Associated with Advanced Functio
415. upper limit Autotuning error due to either oversampling or output setpoint too low Any of two possible causes e Sampling period is too small e AT Output is set too low Increase either the sampling period or the AT Output Setpoint value Autotuning error the time constant is negative The sampling period may be too large For more details please check out PID Tuning With Auto Tuning AT p 460 Autotuning error error calculating Kp The AT algorithm has failed no convergence Check the PID and AT parameters and make adjustments that can improve convergence Check also that there is no disturbance that could affect the process variable constant over delay ratio lt 2 Autotuning error time 7 0 gt 20 PID regulation is no longer guaranteed constant over delay ratio gt For more details please check out PID Tuning With 20 Auto Tuning AT p 460 Autotuning error time t 0 lt 2 PID regulation is no longer guaranteed For more details please check out PID Tuning With Auto Tuning AT p 460 Autotuning error the limit for Kp has been exceeded Computed value of static gain Kp is greater than 10000 Measurement sensitivity of some application variables may be too low The application s measurement range must be rescaled within the 0 10000 interval Autotuning error the limit for Ti has been exceeded Computed value of integral time constant Ti is greater tha
416. ur Program Example of List Line Comments Reversing List Comments to Ladder You can document your program by entering comments using the List and Ladder editors The TwidoSoft programming software uses these comments for reversibility When reversing a program from List to Ladder TwidoSoft uses some of the List comments to construct a rung header For this the comments inserted between List sequences Use the List E ditor to document your program with List Line Comments These comments may appear on the same line as programming instructions or they may appear on lines of their own Use the Ladder Editor to document your program using rung headers These are found directly above the rung are used for rung headers The following is an example of a List program with List Line Comments THIS IS TH THIS IS TH THIS IS TH 0 LD 10 1 OR IO THIS IS TH E TITLE OF THE HEADER FOR RUNG 0 E FIRST HEADER COMMENT FOR RUNG 0 E SECOND HEADER COMMENT FOR RUNG 0 0 THIS IS A LINE COMMENT A LINE COMMENT IS IGNORED WHEN REVERSING TO LADDER E HEADER FOR RUNG 1 THIS RUNG CONTAINS A LABEL THIS IS TH THIS IS TH THIS IS TH 4 LS E SECOND HEADER COMMENT FOR RUNG 1 E THIRD HEADER COMMENT FOR RUNG 1 E FOURTH HEADER COMMENT FOR RUNG 1 5 LD M101 6 MW20 KW2 16 THIS RUN
417. uration in online mode 215 Automatic addressing of an AS Interface V2 slave 220 How to insert a slave device into an existing AS Interface V2 configuration 221 Automatic replacement of a faulty AS Interface V2 slave 222 Addressing I Os associated with slave devices connected to the AS Interface 223 V2 bus Programming and diagnostics for the AS Interface V2 bus 225 AS Interface V2 bus interface module operating mode 230 TWD USE 10AE 195 Installing the AS Interface bus Presentation of the AS Interface V2 bus Introduction The AS Interface Bus Actuator Sensor Interface allows the interconnection on a single cable of sensor devices actuators at the lowest level of automation These sensors actuators will be defined in the documentation as slave devices To implement the AS Interface application you need to define the physical context of the application into which it will integrated expansion bus supply processor modules AS Interface slave devices connected to the bus then ensure its software implementation This second aspect will be carried out from the different TwidoSoft editors e either in local mode e or in online mode AS Interface V2 The AS interface Master module TWDNOI10M3 includes the following Bus functionalities e M3 profile This profile includes all the functionalities defined by the AS Interface V2 standard but does not support the S7 4 analog profiles One AS Interface channel per module A
418. ure presents a sample screen of the Idle Checking tab showing the 10 min default value of the idle timer Ethernet Configuration IP Address Configure Marked IP Idle Checking Remote Devices Please set the Maximum idle time of TCP connection minis Default Note PCL will detect active passive TCP connection and close idle one if expire given time here If the maximum idle time is set as 0 minute PCL will not do the detection Cancel Help 168 TWD USE 10AE Communications Configuring the To set the Idle timer enter directly the elapsed time in minutes in the min s textbox Idle Checking tab as shown in the previous figure Note 1 The default elapsed time is 10 minutes After you entering a value to reset the configured elapsed time to 10 minutes click on the Default button 2 To disable the Idle Checking function set the elapsed time to 0 The Twido controller no longer performs idle checks As a result the TCP connections stay up indefinitely 3 The maximum idle time allowed to set is 255 minutes TWD USE 10AE 169 Communications Remote Devices Tab Overview What You Should Know at First Remote Devices Table Remote Devices tab The following information describes how to configure the Remote Devices tab of the Ethernet Configuration dialogbox when you intend to use use the EXCHS3 instruction for the Twido controller to act as
419. uring this event refer to the section entitled Hardware Configuration gt Input Configuration in the TwidoSoft Operation Guide on line help Outputs THO and TH1 of the VFC function block are event sources Outputs THO and TH1 are respectively set e to 1 when the value is greater than threshold SO and threshold S1 e to 0 when the value is less than threshold SO and threshold S1 A rising or falling edge of these outputs can activate an event process For further details on configuring this event refer to the section entitled Software Configuration gt Very Fast Counters in the TwidoSoft Operation Guide on line help TWD USE 10AE 79 Event task management Periodic event This event periodically executes a single programming section This task has higher priority than the main task master However this event source has lower priority than the other event sources The period of this task is set on configuration from 5 to 255 ms Only one periodic event can be used For further details on configuring this event refer to the section entitled Configuring Program Parameters gt Scan Mode in the TwidoSoft Operation Guide on line help 80 TWD USE 10AE Event task management Event management Events queue and priority Event Queue Management Event check Events have 2 possible priorities High and Low But only one type of event thus only one event source can have High pr
420. utomatic addressing for the slave with the address 0 Management of profiles and parameters Protection from polarity reversion on the bus inputs The AS Interface bus then allows e Up to 31 standard address and 62 extended address slaves e Up to 248 inputs and 186 outputs e Up to 7 analog slaves Max of four 1 0 per slave e Acycle time of 10 ms maximum A maximum of 2 AS Interface Master modules can be connected to a Twido modular controller a TWDLC A24DRF or a TWDLCA 40DRFcompact controller 196 TWD USE 10AE Installing the AS Interface bus General functional description General Introduction For the AS Interface configuration TwidoSoft software allows the user to e Manually configure the bus declaration of slaves and assignment of addresses on the bus e Adapt the configuration according to what is present on the bus e Acknowledge the slave parameters e Control bus status For this reason all data coming from or going to the AS Interface Master are stored in specific objects words and bits TWD USE 10AE 197 Installing the AS Interface bus AS Interface The AS Interface module includes data fields that allow you to manage the lists of Master Structure slaves and the images of input output data This information is stored in volatile memory The figure below shows TWDNOI10M3 module architecture 1 I O data 2 Parameters current AS Interface bus 3 Configuration
421. ve steps 10 6 S22 000 LDN 0 6 s ool s S22 002 ST M0 M0 003 LDR 0 6 004 S S21 I10 6 S21 p fa P S Preprocessing begins with the first line of the program and ends with the first occurrence of a or instruction Three system bits are dedicated to Grafcet control S21 S22 and S23 Each of these system bits are set to 1 if needed by the application normally in preprocessing The associated function is performed by the system at the end of preprocessing and the system bit is then reset to 0 by the system System Bit Name Description S21 Grafcet All active steps are deactivated and the initial steps are initialization activated S22 Grafcet re All steps are deactivated initialization S23 Grafcet pre This bit must be set to 1 if Xi objects are explicitly positioning written by the application in preprocessing If this bit is maintained to 1 by the preprocessing without any explicit change of the Xi objects Grafcet is frozen no updates are taken into account 290 TWD USE 10AE Grafcet Sequential Sequential processing takes place in the chart instructions representing the chart Processing e Steps e Actions associated with steps e Transitions e Transition conditions Example 005 1 I0 2 10 3 2 006 LD 10 2 007 ANDN I0 3 008 2 10 3 I0 2 3 009
422. ween TwidoSoft and a Modem 95 Remote Link Communications 105 ASCII Communications 119 Modbus Communications 129 Standard Modbus Requests 143 Ethernet TCP IP Communications Overview 149 Quick TCP IP Setup Guide for PC to Controller Ethernet Communication 150 Connecting your Controller to the Network 155 IP Addressing 156 Assigning IP Addresses 158 TCP IP Setup 162 IP Address Configure Tab 164 Marked IP Tab 166 Idle Checking Tab 168 Remote Devices Tab 170 Viewing the Ethernet Configuration 172 Ethernet Connections Management 173 Ethernet LED Indicators 175 TCP Modbus Messaging 177 86 TWDUSE 10AE Communications Presentation of the different types of communication At a Glance Twido provides one or two serial communications ports used for communications to remote I O controllers peer controllers or general devices Either port if available can be used for any of the services with the exception of communicating with Twido Soft which can only be performed using the first port Three different base protocols are supported on each Twido controller Remote Link ASCII or Modbus modbus master or modbus slave Moreover the TWDLCAE40DRF compact controller provides one RJ 45 Ethernet communications port It supports the Modbus TCP IP client server protocol for peer to peer communications between controllers over the Ethernet network Remote Link The remote link is a high speed master slave bus designed to communicate a small
423. which is found or at 1 if the search is unsuccessful Structure Ladder language 13 2 MW5 FIND_EQR MD20 7 KD0 l1 2 MW0 FIND_GTR MD20 7 KD0 MW1 FIND_LTR MF40 5 KF5 Instruction List Language LD 13 2 MW5 FIND_EQR MD20 7 KDO0 LD 11 2 SMWO FIND GTR MD20 7 KDO MW1 FIND LTR MF40 5 KF5 496 TWD USE 10AE Advanced Instructions Syntax Example Syntax of table search instructions Function Syntax FIND_EQR Res Function Tab Val FIND_GTR FIND_LTR Parameters of floating word and double word table search instructions Type Result Res Table Tab Value val Floating word tables MWi MFi L KFi L MFi KFi Double word tables MWi MDi L KDi L MDi KDi SMW5 FIND EQR MD30 4 KDO Search for the position of the first double word KDO 30 in the table Rank Word Table Result 0 MD30 10 1 MD31 20 2 MD32 30 Value val rank 3 MD33 40 TWD USE 10AE 497 Advanced Instructions Table search functions for maxi and mini values General There are 2 search functions e MAX_ARR search for the maximum value in a double word and floating word table e MIN_ARR search for the minimum value in a double word and floating word table The result of these instructions is equal to the maximum v
424. will suppress the high byte in the sixth word the value 00 hexadecimal in MWS5 This works to align the data values in the transmission table of the word table so that they fall correctly on word boundaries TWD USE 10AE 141 Communications Before executing the EXCH2 instruction the application checks the communication bit associated with MSGz2 Finally the error status of the MSG2 is sensed and stored on the first output bit on the local base controller I O Additional error checking using SW64 could also be added to make this more accurate Step 5 Initialize the Animation Table Editor Create the following animation table on the master Address Current Retained Format 1 MWO 010C 0000 Hexadecimal 2 MW1 0007 0000 Hexadecimal 3 MW2 0210 0000 Hexadecimal 4 MW3 0010 0000 Hexadecimal 5 MW4 0002 0000 Hexadecimal 6 MW5 0004 0000 Hexadecimal 7 MW6 6566 0000 Hexadecimal 8 MW7 6768 0000 Hexadecimal 9 MW8 0210 0000 Hexadecimal 10 MW9 0010 0000 Hexadecimal 11 MW10 0004 0000 Hexadecimal Create the following animation table on the slave Address Current Retained Format 1 MW16 6566 0000 Hexadecimal 2 MW17 6768 0000 Hexadecimal After downloading and setting each controller to run open an animation table on the slave controller The two values in MW16 and MW17 are written to the slave In the master the animation table can be used to examine the reception table portion of the exchange data
425. wing table Schedule Description AS interface V2 Image of the physical bus configuration Includes slave status e Green indicator lamp the slave with this address is active e Red indicator lamp an error has occurred on the slave at this address and the message informs you of the error type in the Error on the network window Slave xxA B Image of the configuration of the selected slave e Characteristics image of the profile detected grayed out non modifiable e Parameters image of the parameters detected The user can select only the parameter display format e Inputs Outputs the input output values detected are displayed non modifiable Error on the network Informs you of the error type if an error has occurred on the selected slave AS Interface Bus Information resulting from an implicit Read Status command e Shows bus status for example Configuration OK OFF indicates that the configuration specified by the user does not correspond to the physical configuration of the bus e Shows the authorized functionalities for the AS Interface Master module for example Automatic addressing active ON indicates that the automatic addressing Master mode is authorized When the indicator lamp associated with an address is red there is an error on the slave associated with this address The Error on the network window then provides the diagnostics of the selected slave Descripti
426. with a 4 position rotary switch to select different modes of operation The switch designates the four positions as 0 3 and the appropriate setting for TwidoSoft to Twido controller is location 2 This connection is illustrated in the diagram below Port 1 PC Serial Port RS485 TSX PCX 1031 EIA RS 232 o gt n wo TSX PCX 3030 Port USB PC Note For this cable the DPT signal on pin 5 is not tied to OV This indicates to the controller that the current connection is a TwidoSoft connection The signal is pulled up internally informing the firmware executive that this is a TwidoSoft connection 90 TWD USE 10AE Communications Pin outs of Male and Female Connectors Mini DIN TWD NAC232D TWD NAC485D TWD NOZ485D TWD NOZ232D The following figure shows the pin outs of a male 8 pin miniDIN connector and of a terminal Terminal TWD NAC485T TWD NOZ485T OW Pin outs Base RS485 RS485 option RS232 C Pin outs RS485 1 A A RTS A A 2 B B DTR B B 3 NC NC TXD SG OV 4 DE NC RXD 5 DPT NC DSR 6 NC NC GND 7 OV OV GND 8 5V 5V 5V Note Maximum total consumption for 5V mode pin 8 180mA The following figure shows the pin outs of a SubD female 9 pin connector for the TSX PCX 1031 Pin outs RS232
427. write of the correction constant to the RTC 0 U gt S TWD USE 10AE 513 System Bits and Words System Function Description Init Control Bit state S52 RTC error This bit managed by the system indicates that the RTC 0 S correction has not been entered and the date and time are false Setto 0 the date and time are consistent e At state 1 the date and time must be initialized S59 Updating the date and Normally on 0 this bit can be set to 1 or 0 by the 0 U time using word SW59 program or the Operator Display Set to 0 the system word SW59 is not managed e Set to 1 the date and time are incremented or decremented according to the rising edges on the control bits set in SW59 SEE BAT LED display This system bit can be set by the user It allows the 0 S or U gt S enable disable user to turn on off the BAT LED only on controllers that Setto0 BAT LED is enabled it is reset to 0 by the support an external system at power up battery e Set to 1 BAT LED is disabled LED remains off TWDLCA 40DRF even if there is a low external battery power or controllers there is no external battery in the compartment S69 User STAT LED display Set to 0 STAT LED is off 0 U Set to 1 STAT LED is on S75 External battery status This system bit is set by the system It indicates the O S only on controllers that external battery status and is readble b
428. x y Z Value Read Analog output QWXx y Z Value Read Write Fast Counter FCx V Current Value Read FCx VD Current Value Read FCx P Preset value Read Write FCx PD Preset value Read Write FCx D Done Read TWD USE 10AE 237 Operator Display Operation Object Variable Attribute Description Access Very Fast Counter NFCX V Current Value Read VFCx VD Current Value Read VFCx P Preset value Read Write VFCx PD Preset value Read Write VFCx U Count Direction Read VFCx C Catch Value Read VFCx CD Catch Value Read VFCx S0 Threshold 0 Value Read Write VFCx S0D Threshold 0 Value Read Write VFCx S1 Threshold Value1 Read Write VFCx S1D Threshold Value1 Read Write VFCx F Overflow Read NFCX T Timebase Read Write VFCx R Reflex Output Enable Read Write VFCx S Reflex Input Enable Read Write Input Network Word INWx z Value Read Output Network Word QNWx z Value Read Write Grafcet XX Step Bit Read Pulse Generator PLS N Number of Pulses Read Write PLS ND Number of Pulses Read Write PLS P Preset value Read Write PLS D Done Read PLS Q Current Output Read Pulse Width PWM R Ratio Read Write Modulator PWM P Preset value Read Write Drum Controller DRx S Current Step Number Read DRx F Full Read Step counter SCx n Step Counter bit Read Write Register Rx I Input Read Write Rx O Output Read Write RX E Empty Read RX F Full Read Shift bit
429. xternal RAM 32KB 32KB 64KB Mem 2 Internal EEPROM 32KB 32KB 32KB External EEPROM 32KB 32KB 64KB Maximum program size 32KB 32KB 64KB Maximum external backup 32KB 32KB 64KB Mem 1 and Mem 2 in memory usage in this case the 64KB cartridge must be installed on the Twido and declared in the configuration if it has not already been declared reserved for backup of the first 512 MW words or the first 256 MD double words TWD USE 10AE 53 User Memory Backup and Restore without Backup Cartridge or Extended Memory Introduction The following information details backup and restore memory functions in modular and compact controllers without a backup cartridge or extended memory plugged in At a Glance Twido programs memory words and configuration data can be backed up using the controllers internal EEPROM Because saving a program to the internal EEPROM clears any previously backed up memory words the program must be backed up first then the configured memory words Dynamic data can be stored in memory words then backed up to the EEPROM If there is no program saved to the internal EEPROM you cannot save memory words to it Memory Here is a diagram of a controllers memory structure The arrows show what can be Structure backed up to the EEPROM from RAM RAM EEPROM Dynamic words MWs C Program l qe Bie SS Configuration data I MWs lt
430. y on the combined output of the integral and derivative actions e U the PID controller output later fed as input into the controlled process 476 TWD USE 10AE Advanced Instructions The PID Control The PID controller is comprised of the mixed combination serial parallel of the Law controller gain Kp and the integral Ti and derivative Td time constants Thus the PID control law that is used by the Twido controller is of the following form Eq 1 i u i Kp Og DOS leet j where e Kp the controller proportional gain Ti the integral time constant Td the derivative time constant Ts the sampling period e i the deviation e i setpoint process variable Note Two different computational algorithms are used depending on the value of the integral time constant Ti e Ti 0 In this case an incremental algortihm is used e Ti 0 This is the case for non integrating processes In this case a positional algotrithm is used along with a 5000 offset that is applied to the PID output variable For a detailed description of Kp Ti and Td please refer to PID tab of PID function p 439 As can be inferred from equ 1 and equ 1 the key parameter for the PID regulation is the sampling period Ts The sampling period depends closely on the time constant t a parameter intrinsic to the process the PID aims to control See Appendix 2 First Order With Time Delay Model p 478
431. y the user support an external e Setto 0 external battery is operating normally battery e Setto 1 external battery power is low or external TWDLCA 40DRF battery is absent from compartment controllers S95 Restore memory words This bit can be set when memory words were 0 U previously saved to the internal EEPROM Upon completion the system sets this bit back to 0 and the number of memory words restored is set in SW97 SIE Backup program OK This bit can be read at any time either by the program 0 S or while adjusting in particular after a cold start or a warm restart Setto 0 the backup program is invalid e Setto 1 the backup program is valid S97 Save MW OK This bit can be read at any time either by the program 0 S or while adjusting in particular after a cold start or a warm restart e Setto 0 save MW is not OK e Setto 1 save MW is OK 514 TWDUSE 10AE System Bits and Words System Bit Function Description Init Control state S100 TwidoSoft communications cable connection Shows whether the TwidoSoft communication cable is connected Setto 1 TwidoSoft communications cable is either not attached or TwidoSoft is connected Set to 0 TwidoSoft Remote Link cable is connected S S101 Changing a port address Modbus protocol Used to change a port address using system words SW101 port 1 and SW102 port 2 To do this S101 must be set to 1 e Set t
Download Pdf Manuals
Related Search
Related Contents
Leisure VUN1160 ändern der parameter Deutschsprachige Anleitung als PDF - Uni e-Suitability User Manual - Avail eSuitability T'nB DCHANDLE2 FAQs regarding the RESU 6.4EX Storage Unit Manual de instruções VEGACAP 69 U4 DBT Copyright © All rights reserved.
Failed to retrieve file