Home
User`s Manual Template
Contents
1. host link command 2 TLServer send the host link command to remote TLServer or FServer and retum the response to the PLC Description This service enables a Super PLC to communicate with other PLCs via TCP IP protocol using the TLServer and FServer or any combination of these It allows your PLC to login to another remote TLServer or FServer via the LAN orthe Intemet and your PLC can then use the NETCMD command to exchange data with the PLC s that are connected to that remote server You execute this command by first sending the string lt CONNECT XXX XXX XXX XXX 9080 gt to the TLServer where XXX XXX XXX XXX iS the IP address of the remote TLServer or FServer Then followed by the usemame and password needed to login to the remote server Once the connection is established the TLServer will retum the response sting lt CONNECTED gt to the PLC When the PLC receive the ff ARINEOC TERNS chinn it ean iea tha TRACIC METCO MANE RK AmmandA ta Tri na de INTERNATIONAL Chapter 4 Using TLServer read or write data to the remote PLC as if the remote PLC ison the same local network Multiple NETCMD commands can be executed but there should not be more than 2 seconds delay between each command This is because If the FServer does not receive any senal string from the PLC for more than 2 seconds it will terminate the lt CONNECT gt session automatically Once the command exchange has been completed
2. 12 50 1lto 127 1 to 127 ep BR In TRIANGLE RESEARCH INTERNATIONAL Chapter 12 12 64 9 Calibrate RTC Add or subtract data seconds per day from the RIC to Calibrate it foraccuracy E g if the clock is 3 seconds too Slow everyday then un SETSYSTEM 11 3 once during 1st Scan and the CPU will increase the RIC by 3 seconds every time when it past midnight data 127 to 127 to adjust the RIC foraccuracy after midnight data 0 default no adjustment data gt 0 RTC crossover from 23 59 59 to 0 0 data directly and bypasses 0 0 0 Eg data 5 clockisadjusted faster by 5 seconds data lt 0 RTC stop at 23 59 59 and wait until data seconds later then crossover to 0 0 0 E g if data 5 the RIC is slowed by 5seconds Applicable only to PLC with fimware r78 and above 12 64 10 Number of I O to Support Total number of 8 bit digital O channel supported data d d x8 inputsand d x 8 outputs E G data 16 default 16 x 8 128 Inputs and 128 outputs f you don t use expansion board and if you run SETSYSTEM 16 3 then only inputs 1 24 and outputs 1 24 will be accessed during I O scan This can reduce the I O scan time Otherwise the default is to scan all 128 inputs and 128 outputs which consumes Oms on an F series PLC 12 64 11 Enable IR Remote data 0 disable IR Remote default 12 51 Chapter 12 1 data 1 enable IR Remote Note Only applicable to F series PLCs
3. Calibrate Analog Inputs Help Analog Outputs DAC Calibration Ch2 ch3 E SETDAC 0 4095 E a el SS Measured DAC 0 to 4095 SETDAC amp Read DM 1 to DM 4 Calibrate Analog Outputs Close Available since version 6 43 this new Analog calibration tool allows OEMs to perom quick calibration of the PLC sanalog inputs and outputs This new tool is nomally located under the Controller Menu Altematively this tool may also be opened from the Ethemet amp ADC Configuration Tool gt Advanced Config by clicking on the button labelled Auto Calibrate Analog The Auto Calibrate Analog I O screen is split into two parts The upper portion is meant for calibration of the Analog inputs The lower portion is for calibration of the PLC s analog outputs We will explain each part separately in the next few sections as you may only need to calibrate what you need to use However for those not too familiar with how to communicate with the PLC via i TRILOGI go to section 4 Communicating with the PLC below that describes the connection procedure 1 Analog Inputs ADC Calibration TR RESEARCH 8 36 INTERNATIONAL Chapter8 In order to calibrate the analog inputs you need to have one or more stable and quiet reference voltage source s and a precision voltmeter First connect the voltage source to all the PLC s analog inputs that you wish to calibrate For best precision select a vo
4. 2 TRIANGLE ji URA RESEARCH Page vii INTERNATIONAL USER MANUAL 10 6 2 Using LCD Display for Debugging ececeeeeeeeeeeeeteeeeeeceeeeaeceeetaeteeeaaeeetaaeeeetaeeaes 10 22 10 7 Debugging With PAUSE amp Breakpoints sssssssssnsnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 10 22 10 7 1 Using the TBASIC PAUSE State Me nt AAA 10 22 10 7 2 USING Dreakooimts AA 10 23 10 7 3 Debugging Using Breakpoint ON Simuletor eee eee eeeteeeeeteeeeeeteeetaeeeeeeaeeaes 10 24 10 7 4 Debugging Using Breakpoints ON BC 10 25 10 8 Enor Handling Perr ere error re rere rer em rer mererer nnmnnn ern cr rere 10 26 10 8 1 Yita X te IEN 10 26 10 8 2 RUN TIME te EE 10 28 11 TBASIC STATEMENTS FUNCTIONS OPERATORS AND VARIABLES 11 1 111 What are BASIC Statementand Functions sssssssnssennnnnunnnnunnnnnnnnnnnnnnn 11 1 11 1 1 STA TEMEN Mor airain i cdewsczicusehsesteladasadaaddcenwiucavetsiudeateaicesigddeedecusgudeuat ddasaaned vians 11 1 11 1 2 FUNCTION NEE 11 1 11 1 3 DELMER ciiisean aeeie eaaa a anaie aeaa iA AE RAEES 11 1 11 2 TBASIC Integer Constants Variables amp OperatoiS sssssssssunsenunnennnnennnnen 11 2 11 2 1 ue Teen EC 11 2 11 2 2 Integer Va ria DIOS eee eeceecceseseceeecneteeeeaeeacesaeeaceseseecaesaansaseeaesaseaceaeseesaseeeneateeeenaseeees 11 3 11 2 3 Sytem vana les iz vzecsipsseekitiasts deere eects AAAA ana ETE ai tink eee esas testes 11 4 11 2 4 ue leie Ch CN 11 6 11 2 5 Hierarchy of leE CL 11 7 11 2 6 Integer Vari
5. Insert Row Paste Row 4 6 B jo Import Define Table np 1 pey 10 3 1 Find If you select the Find menu you will see the following window popup and you will be able to type text in the field that will be searched for within the Define table Text to Find 10 3 2 Insert Row A new blank row will be inserted above the row where the cell is highlighted when the mouse was right clicked The highlighted row and all other rows below will be shifted down by 1 row and their row number will increase by 1 10 3 3 Delete Row The row that was highlighted when the mouse was right clicked will be deleted All other rows below the highlighted row will be shifted up by 1 row and their row number will decrease by 1 Ti ees 10 11 INTERNATIONAL Chapter 10 10 3 4 Copy Row The row that was highlighted when the mouse was right clicked will be copied 10 3 5 Paste Row The row that was previously copied will be pasted to the row highlighted when the mouse was right clicked 10 3 6 Import Define Table You will first be asked if you want to clear the content of the Define Table and you will want to say Yes to proceed with the import say No and do an export first if you want to save the curent table A B Define Name Value 1 Name1 DM 1 2 Name2 DM 2 3 Name3 DM 3 4 Name4 A 5 Name5 B 6 Name6 C 7 Number 1 An example define table exported to 8 StringName1
6. 11 3 1 String Constants A string constant may contain from O to 70 characters enclosed in double quotation marks e g TBASIC made PLC numeric processing a piece of cake 102 345 00 11 3 2 String Variables TBASIC supports a maximum of 26 string vanables A B Z Each string variable may contain from 0 null string up to a maximum of 70 characters Note For all NANO 10 FMD Seres and F Series PLCs as well as legacy M series PLCs with firmware version r44 and above you can access the 26 string vanables using an index 1 to 26 Le A is the same as 1 Z is the same as 26 Note that 1 to 26 are not additional string vanables it just give you a way to index the string variables not possible on previous fimware version Also only i TRILOGI version 6 and above propery support these vanable names Caution Do not try to transfer a program using n variable to a PLC with firmware earierthan r45 asit can cause the PLC operating system to crash CO TRIANGLE 11 10 URA RESEARCH L SC INTERNATIONAL Chapter11 With i TRILOGI version 6 2 and above you can now attach comments to any variable name of any length to make program easierto read See section 10 3 4 String Variable Comments below for more details 11 3 3 String Operators a Assignment Operator A string variable A to Z DM and system vanables etc may be assigned a string expression using the assignment statement
7. Although most of the time you will probably be navigating the ladder circuit diagram using the scroll barorcursor keys to find the circuit that you are looking for there exist several short cuts to enable you to quickly jump to specific circuits in the program E g If you select Goto from the Edit menu you will be prompted by a Goto Circuit window to enter the circuit number to jump to immediately You can also call up the Goto Circuit window by pressing lt Ctr G gt key anytime If you have a large ladder program with multiple rungs of circuits then you will find the Bookmark feature very useful for quickly jumping from one circuit to another The bookmarks appear as blue button along the top of the i TRILOGI editor windows oaa You can define up to five bookmarks by clicking on Define Bookmark each bookmark comesponds to a specific circuit By default all 5 bookmark points to circuit 1 Once you have defined the circuit for a bookmark then when you click on the bookmark button the editor instantly jumps to the pre defined circuit number GC TRIANGLE 7 URA RESEARCH e LAS INTERNATIONAL Chapter 7 When you click on Define Bookmark the following window will appear res Bookmarks Definition and Selection Bookmark Circuit Description vlo Change You can select the bookmark No either from the choice box or by clicking on the blue bookmarks and then enter or edit the circuit to
8. Server s IP Address port 192 168 1 5 9080 Detect ID 1 PLC Only ID Hex Server s IP Address port vi 192 168 1 5 9080 Detect ID 1 PLC Only 1D Hex localhost 127 0 0 1 9080 _ localhost 127 0 0 1 9080 Username samples Username samples Password Password Memorize Username amp Password Memorize Username amp Password Cancel OK OK Default Settings Defa ult Settings ServerIP localhost 127 0 0 1 9080 ServerIP 192 168 1 5 9080 Usemame samples Usemame none ignored Password none blank field Password none ignored The above left screenshot is the default configuration which is set to login to TLServer using the localhost 127 0 0 1 9080 option The default Usemame is samples with no password required Use this configuration if you are connected via seral port and if TRILOGI is running on the same PC as TLServer The above nght screenshot isan example of a configuration used to connect to FServer using a specified IP address and port number In this example the default PLC IP address 192 168 1 5 and port number 9080 is specified but these should be replaced by the actual IP address and port number configured in your PLC There is no usemame and password set for Ethemet communication by default so these fields can contain anything since they will be ignored 3 After configuring the login settings you w
9. gt For full synchronization use the lt READ RIC gt tag which retums the values of the Date 1 Date 2 Date 3 Date 4 Time 1 Time 2 Time 3 in 7 CR terminated ASCII strings where n 1 2 3 4 lt READ Time m gt lt q gt Upon receiving this command the TlServer will immediately send the relevant clock calendar data asCR terminated ASCII string s to the PLC Your PLC program can easily use the INPUT 1 command to read in the data and convert them into integers using the VAL command Note that unlike the READ file service the TLServer does not send lt OK gt string after performing the READ RIC service where m 1 2 3 6 Get IP Address This command allows the PLC to query the TLServers IP address Upon receiving this command the TLServer will send the following response string If successful XXX XXX XXX XXX NNNN IP addressiport of TLServer Tri na 4 23 INTERNATIONAL Chapter 4 Using TLServer f emoroccured ERR description of eror Thiscommand doesnot require a lt gt to close the tag 7 Connect to Remote TLServer or FServer using NETCMD Format lt CONNECT IP address port of TLServer or FServer gt usema me sting password sting TLServer replies with lt CONNECTED gt if successful or ERR if emorencountered host link command 1 TLServer sends the host link command to a remote TLserver or FServerand retum the response to the PLC
10. manner LSHIFT Relay 4 Relay 3 Relay 2 Bits are shifted from the lower channel towards the upper channel Bit 15 of Relay 2 will be shifted into Bit 0 of Relay 3 and so on Bit 15 of the highest channel Rela y 4 will be lost RSHIFT 12 32 MID x n m Purpose x n m Examples Comments eD TRIANGLE URA RESEARCH U SC INTERNATIONAL This function retums a sub string of m characters from x beginning with the nth character any string expression variable orconstant any numeric expression producing a result of between 1 to 255 any numeric expression producing a result of between O to 255 A MID Welcome to TBASIC 4 7 A should contain the string come to 12 20 Chapter 12 12 33 NETCMD ch x Purpose ch x Note Examples Comments Special gp ZE URA TRIANGLE RESEARCH INTERNATIONAL This function sends a multi point host link command string specified in the x via seral port ch to another Nano 10 FMD seres F series or H series E10 PLCs or the legacy M series PLCs It will then wait fora specified amount of time for a response string from the other PLC and this response string is then retumed This refer to the communication port Please refer to the target PLC for details contains a valid host link command in multi point format excluding the Frame Check Sequence FCS and the terminator characters and CR NETCM
11. ABS n ADC n CHR n HEX n STR n For detailed explanation of these functions please refer to the next chapter Programming Language Reference 11 2 5 Hierarchy of Operators The hierarchy of operators represent the prionty of computation Eg X 3 40 5 2 The compiler will generate codes to compute 5 2 first because the parentheses has the higher hierarchy the result is then multiplied by 40 because multiplication has a higher prnonty then addition Finally 3 will be added to the result If two operators are of the same hierarchy then compiler will evaluate from left to right e g X 5 4 3 54 is first computed and then 3 will be subtracted The following table list the hierarchy of various operator used Hierarchy Symbol Descriptions Highest Parentheses Multiplic atio n Division Add Subtract Negate Logical AND OR XOR NOT Relational operators Ten RESEARCH 11 7 INTERNATIONAL Chapter ll 11 2 6 Integer Variable Comments With i TRILOGI version 6 2 and above you can now attach comments to any vanable register name of any length to make program easier to read The compiler will ignore any alphanumeric characters A to z Oto 9and _ thatare attached behind the vanable name following an underscore character _ It is important to understand that by appending these comments to vanables no new vanablesare being created For Example X_Some_Integer corresponds to X
12. An integer vanable such as DM 1 can have different comments each time it is referenced in the same program because the compiler ignores the comments anyways Although in most cases it may be best to limit a variable to one comment to avoid potentially overwriting data since no new vanables are actually create asmentioned above For Example If an integer vanable DM 1 was named DM 1 one_integer in One part of a program and named DM 1 two_integer in another part of the program then they will still both refer to DM 1 If each variation has different integer data then the data that was stored in the last vanation that was updated will be the data in DM 1 Then if the previous vanation is accessed it wont contain the data that was orginally stored in it 11 2 7 Variable Define Table NEW With TRILOGI version 6 42 and higher it is possible to create a table of vanable constant expression definitions Please see section 8 Define in the Introduction to TBASC amp Custom Functions for more information on how to interface to the Define Table Here isan example of a possible Define Table bei Wegen 11 8 INTERNATIONAL Chapter11 GE E H EE Define Variable Names Ea Label Name Variable 1 Name1 DM 1 a 2 Name2 DM 2 3 Name3 DM 3 4 Name4 5 Name5 B 6 Hamen C D Number1 1 8 StringName1 AS 9 StringName2 Constant String
13. F MaRST Master Reset 1 2 3 4 5 6 7 8 9 A B c D Select either item to create a CusFn D CusFn Custom created Function or E dCusF Diff Up Custom Functn You will be required to enterthe selected custom function number from 1 to 256 Note that a CusFn created using E Diff Up Custom Functn dC usF isa Differentiated Up instruction This means that the function will be executed only once every time when its execution condition goes from OFF to ON Nothing will happen when its execution condition goes from ON to OFF On the other hand using D Custom created Function CusFn will mean that the CusFn will be executed every scan as long as its execution condition is ON TR RESEARCH 10 14 INTERNATIONAL Chapter 10 This is often not desirable and the coil created using this menu item will be highlighted in RED color to serve asan alam to programmer You will probably find that you will use the differentiated version dC usF far more frequently 10 4 2 Periodic Execution of a Custom Function There are many situations when you need the PLC to penodically monitor an event or perform an operation For example to monitor the temperature reading from a probe or check the real time clock for the scheduled time and to continuously display changing vanables on the LCD display It is not efficient to use the continuous CusFn function for such purposes It is far better to use the built i
14. If an F series PLC is to be accessible only on the local area network then the direct connections offered by MODBUS TCP provide simplicity without time consuming login sequences However if the MODBUS TCP port is to be exposed to the public Intemet then you ought to consider the secunity issues associated with MODBUS TCP connections Since a MODBUS TCP connection does not require a usemame password login sequence unlike the FServer login the only way to protect against unauthonzed access is through the Trusted IP addresses defined using the F Series Ethemet Configuration software The first thing you should do isto click on the Retrieve Parameters from F PLC so that you can capture a copy of the curent configuration in the PLC and you can then modify selectively You can define a list of up to 6 Trusted IP addresses in this panel To enable the Modbus TCP Trusted IP click on the Yes button next to the Modbus TCP Use Trusted IP Note The FServer can also be enabled to only allow connections from devices that match one of the Trusted IP defined in this panel This ison top of the usemame password login sequence that can be enabled disabled from the Basic Configuration screen In other words you can choose either security method to access the FServer or implement both security methods at the same time After you have defined the list of trusted IP addresses and checked the Use Trusted IP radio button
15. If you are linking the PLC to the intemest via i TRILOGI you will notice that the TLServer already provides usemame password authentication However the password here works independent of the access provided via TLServer hence this command can still be used to provide an additional layer of security against unauthonzed access to the PLC 12 62 SETPROTOCOL ch mode Purpose Parameters ch mode gp A URA TRIANGLE RESEARCH INTERNATIONAL A Nano 10 FMD seres and F series PLC aswell asthe legacy TLOOM seres automatically senses the type of communication protocols sent to it and responds accordingly You may however fix the protocol type so that it does need to check the protocol type before responding This command also allows the PLC to be defined as No Protocol so that it will not automatically respond to data that it receives which appears like one of the supported protocols This may be important in some applications in which the PLC serial port is used purely to receive incoming data via INCOMM and INPUT and you do not want it to respond to some data that appears to it as a valid communication protocols This is also useful for implementing users own communication protocol without wonying about conflict with the existing protocols 1 2 0r3 COMM port number 0 Auto sensing default mode 12 43 Chapter 12 1 Fixed at RTU mode 2 Fixed at EMITmode 3 Fixed at MODBUS ASCII mode
16. In Extemal RS232C Super PLC P Internal or Extemal There are a some technical issues that need to be handled carefully in order to suc cessfully implement the modem linked host communications as described in the following sections A4 1 Modem Connection Modem 1 The host PC may use any intemal or extemal modem that can communicate at 2400 bpsorfaster Connect the modem to the PC as instructed in the modem s manual and connect the phone line to the phone jack on the back of the modem marked WALL or Line r Tri ees Aa INTERNATIONAL Appendix A DB9 Male DB25 Male Female DB25 socket COMM With DB25 Female socket Modem 2 The modem to be attached to the PLC modem2 must be an extemal modem with an RS232 connection port Since modem are DCE type device they most likely come with a female type DB25 or DBY socket meant for plugging into the PC s RS232 port Since the PLC s host link port is also a female DB9 we need to construct a DB9 male to DB25 male cable or DB9 male to DB9 male cable to link the PLC to the modem as follow DBS Male DB9 Male Female DB9 socket To PLC MODEM COMM 1 with DBS Female socket A4 2 Communication Speed When communicating via modems there are two different definitions of communication speedsthat you should be aware of e The DTE Speed or line rate is the serial communication speed between the modem and the device connected to its RS232 p
17. READMO DBUS and READMB2 uses default function 03 data d Any othervalues of data d will set READMO DBUS and WRITEMO DBUS back to default 03 for READ 16 for WRITE pes gp Aa In 12 64 7 Change ID Allow the PLC to change its own ID from within TBASIC temporarily to the lower 8 bit value provided in the data parameter for individual COMM port The new ID is volatile It does not overwnte the default PLC ID which can only be changed from a host program using the Wxx command SETSYSTEM 8 n COMM1 d amp HO0001 to amp HOOFF TRIANGLE z RESEARCH 12 49 INTERNATIONAL gp ZE URA TRIANGLE RESEARCH INTERNATIONAL Chapter 12 COMM2 d amp H0101 to amp HOLFF COMM3 d amp H0201 to amp H02FF COMM4 Ethemet d amp H0301 to amp H03FF ID for the respective COMM por will be st to 01 to FF after running the above command only applicable to PLC with fimmware r76 and above 12 64 8 Fast Refresh data 1 to enable Fast I O REFRESH ONLY data O default REFRESH alli os On FMD PLCs the fast I Osare input 3 to 6 and output 5 to 8 On F series PLCs the fast I Os are inputs 1 to 12 and outputs 5 to 16 All Nano 10 I Os are fast I Os so this command has no effect By running SETSYSTEM 9 1 only the fast I Os are refreshed when TBASIC REFRESH command is run This has the advantage of reducing the REFRESH latency especially when executed within a interrupt srvice custom function
18. RESEARCH 12 38 INTERNATIONAL Purpose Comments Parameters ch value Note Exa mple Chapter 12 To set channel channel of the F series PLC s Light Dimmer Control outputs to fire a trigger pulse to opto isolated TRIAC or Solid State Relay The trigger pulse is fired after a time delay specified by the value parameter each unit is equal to about 53 microseconds and it is measured with respect to the zero crossing that occurat every half cycle of AC voltage Channel Range 1 to 12 which mapsto FPLC outputs 5 to 16 Trigger Pulse Time Delay For 50Hz AC signal range 1 to 188 For 60Hz AC signal range 1 to 156 when value 1 the output is fully ON When value is near is maximum value the output is fully OFF Do not set value to largerthan the maximum foreach particularAC frequency SETDIMMER 1 78 The PLC light dimmer output channel 1 which coresponds to digital output 5 of F series PLC will send a short trigger pulse to the SSR to tum it on at 78 x intemal timer tick of 53 microsecond per unit 0 00413second from the last zero crossing For a 60Hz AC this will occur at about 90 degree phase angle since the time duration of half a 60Hz wave 1 60 2 0 00833 seconds 12 56 SetTimerSV n value Purpose Parameters N gp a URA TRIANGLE RESEARCH INTERNATIONAL Change the Set Value S V of the Timer n to value This statement to allow the user to modify the SV of the
19. Then click OK and you are now connected to the PLC forany calibration work 8 4 Simulate Menu i TRILOGI allows you to perform almost 100 simulation of your PLC s program off line on your PC This is a great tool for testing a program quickly before a machine has been manufactured It is also a wonderful tool for all new PLC programmers to practice their ladder logic programming skill without the need to purchase a PLC test station i TRILOGI automatically compiles a ladder program before activating the simulator If an emor is found during compilation the eror will be highlighted where it occurs and the type of enor is clearly reported so that you can make a quick correction 8 4 1 Run All I O Reset lt Ctrl F9 gt This should be the option to use when you first begin to test your i TRILOGI program When executed all I O bits including inputs are cleared to OFF state all integer data are set to O and all string data are set to empty string Then the Programmable Logic Simulator window will open for you to conduct the simulation test of your i TRILOGI ladder program 8 4 2 Run reset Except i p lt Ctrl F8 gt Very often you may wish to keep the input settings as is when you reset the simulator This situation is quite realistic in the sense that when a PLC is powered on some of its inputs may already be in the ON state e g sensors may detect the end postions of a cylinder rod etc This command allows you to prese
20. This is Message C HR amp H35 C should contain This is Message 5 since CHR amp H35 retums the character 5 In TL6 you can also use Escape sequence to represent non printable ASCII character E g OD to represent CR character ASC 12 6 CLRBIT vn Purpose To clear the Bit n of the integer variable v to 0 n is an integer constant or variable of value between 0 and 15 v may be any integer variable or a system vanable such as relay n output n etc If v isa 32 bit integer CLRBIT will only operate on the lower16 bits 12 2 GC v TRIANGLE URA RESEARCH LAS INTERNATIONAL Chapter 12 Following digital electronics convention bit O refers to the least significant bit night most bit and bit 15 the most significant bit left most bit of the 16 bit integer variable Examples CLRBIT output 2 11 Comments Physical output 28 will be tumed OFF Output channel 2 bit 11 Output 17 11 28 See Also SETBIT TESTBIT SETIO CLRIO TOGGLEIO amp TESTO 12 7 CLRIO labelname SETIO labelname TOGGLEIO labelname TESTIO labelname Purpose Manipulate the logic states of any input output relay timer orcounter contact bit within a CusFn The labelname refers to the label names defined in the input output relay timer or countertables SETO set a bit to ON CLRIO clear the bit to OFF and TOGGLEIO flip the current logic state of that I O bit TESTO function retumsa 1if the bi
21. 0 if there is any enor orif the save device is not present PLC COMM port number Range 1 8 for MODBUS ASCII 12 68 Chapter 12 Range 11 18 for MODBUS RTU 11 is com1 12 iscom2 etc DevicelD Device ID of the MODBUS device Range 1 to 255 Address Zero offset address of the holding register in the MODBUS device data the 16 bit data to be written to the MODBUS device Example WRITEM O DBUS 3 8 1000 1234 The data 1234 will be written to the MODBUS ASCII device with ID 08 at the holding register offset address 1000 in MO DBUS convention this referto holding register 41001 WRITEM O DBUS 13 8 1000 5678 The data 5678 will be written to the MODBUS RTU device with ID 08 at the holding register offset address See Also READMODBUS STATUS 2 NETIC MD 12 84 WRITEMB2 ch ID addr var count Note Applicable to all Nano 10 FMD Series and F sres but only to the legacy TLOOMD MX PLC with firmware r44 or higher Purpose Automatically write the multiple words of 16 bit data to a MODBUS device using the MODBUS RTU ASCII protocol It is essentially the WRITEMODBUS command except multiple wordscan be sent Comments The command automatically checks the response string received from the slave device for the correct LRC and the Slave address The status of the operation can be checked by the user program by testing the STATUS 2 function which will retum a 1 for successful command and a
22. 0 z z SETLCH 1 1 Cycle Count STR X Find Find All 1 EventCount _ lt L gt JL Rename CusFn View Other CusFn v Gel CD v Purpose 1 To display the string expression x on Line 72 on builtin alphanumeric Liquid Crystal Display LCD or compatible Vacuum Fluorescent Display WFD x may be formed by concatenation of various strings using the O 0 operator e g Temp STRS A 3 CHR 223 C Integers must be converted to string using the STR or HEX function to be accepted by this function Special case ifn 0 the string x will be sentto 10 2 2 New Help Features i TRILO GI Version 6 43 added the following useful features to its Help Pane a Selectan I O Label If the selected text isan I O labelname the lower pane will display its I O type and the I O number as well as the custom function where the same label name have been used This can be very useful to find out where a certain vanable may be changed in other custom functions TR RESEARCH 10 3 INTERNATIONAL Chapter 10 KE Custom Function 13 xFMDProg 0 unction transfer the test program for FMD PLCS 8 ATT F series use the same program E Find Find All make sure baud rate is 38 400 13 a we SETLCD 0 0 CHR 1 clear screen SETLCD 1 1 Load FMD Test Prog o Bescht Use RS232 port to send the following command first call sendIw01 make sure the PLC is set to ID 01 Sau Saat a 3 V
23. 1 clear whatever data in serial buffer first ENDVWHILE PRINT 1 D Dial the number DM 3990 1 RETURN ENDIF A INPUTS 1 IF LEN A O DM 3990 DM 3990 1 also use it to track the time out IF DM 3990 28 28 seconds has lapsed PRINT 1 ATH ENDIF IF DM 3990 gt 30 DM 3990 0 ENDIF RETURN ENDIF SETLCD 4 1 A IF SIRC MP MID A 2 7 CONNECT 0 isconnected DM 3990 0 for next round of connection DM 3991 0 reset timer for hang up modem use SETIO Connected setan I O bitto indicate connection ENDIF All you need to do is to copy and paste this custom function to your own Ladder BASIC program then create an I O with label name DialModem this Ten RESEARCH WG INTERNATIONAL Appendix A may be an input output relay timer or counter contact The moment this I O bit DialModem is tumed on the PLC will begin to execute the sequence of dialing the remote modem waiting for a successful connection and then tuming on an I O bit with the label name Connected If the dialing cannot be completed within 30 seconds this custom function will hang up and then re dial The process will be repeated indefinitely until either a successful connection is made orif the DialModem i o hasbeen tumed OFF To disconnect from the modem hang up your PLC program just have to tum off the DialModem VO bit and the abovementioned custom function will automatically perform the action of hanging up the modem Note S
24. 2 9 A2 2 5 Activate Events at Scheduled Date and me 2 10 A2 2 6 HVAC Heating Ventilation and Air Conditioning Contml 2 11 A2 2 7 Closed Loop PID Control of Heating ProCeSS A 2 13 A 3 TROUBLESHOOTING SERIAL COMMUNICATION 3 1 A 4 PLC TO MODEM COMMUNICATION SETUP 4 1 AAL Modem COnnectoOn sssssssenssennnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnmnnn nnan nnmnnn nnana 4 1 A4 2 Communication Speed sssssssssunssennnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnmnnn nnmnnn na 4 2 A4 3 Software and Programming sssssssssnssnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn annann 4 3 A TRIANGLE UR RESEARCH Page xi INTERNATIONAL Chapter1 I TRILOGI Setup Guide Chapterl SetUprTRLOGI m e aD TRIANGLE URA RESEARCH UN INTERNATIONAL 1 1 1 1 2 1 3 Chapter1 l TRiLOGI Setup Guide l TRILOGI 6 SETUP GUIDE Introduction to the i TRILOGI Program i TRILOGI is a trademark name used by Triangle Research Intemational to describe its family of Ladder and Ladde BASIC program editor compiler simulatorand program up loader software The Intemet TRILOGI 6 x client server suite is written to run under all currently available 32 bit Microsoft Windows operating systems as Windows 98 Me NT 2000 XP and Vista By installing the 32 bit Java Runtime environment JRE 1 4 2 19 that is shipped with the l TRiLOGI CD ROM or download website I TRILOGI has also been tested to run propery under 64 bit Windows 7 8 opera
25. 4 Fixed at OMRON C20H protocol mode 5 Fixed at NATIVE host link command mode 10 No protocol Forcreating userown custom protocol IMPORTANT gp ZE URA i Please note that if you set the protocol to other than the Native mode or Auto mode 0 that seral port will no longer respond to commands from i TRILOGI and you will encounter Communication Erors when you try to perform any communication using i TRILOGI with that seral port You can still use the other unaffected seral port e g COMM3 RS485 that support host link commands li For all Nano 10 FMD seres and F series PLC as well as the legacy TLOOM series PLCs with finmmware revision r42 or above setting the protocol mode to NATIVE mode disables support for point to point communication Also the wildcard FCS i e 00 is not allowed in multi point format in this mode This is to ensure the maximum data integrity by accepting only commands that are fully formatted with corect FCS eror check Note that this means i TRILOGI s Detect ID function will not work since the PLC with protocol mode will not respond to point to point protocol IR You will have to manually enter the ID into i TRILOGI login dialog box to communicate with the PLC li To regain communication with the seral port that has been changed by SETPROTOCOL command you will have to execute another SETPROTOCOL function that set it to mode 0 or 5 assuming it has been written into the pr
26. A an Excel file automatically exported 9 StringName2 Constant String in Tab Delimited format is shown 10 Expression1 D A B C above 11 Expression2 BS A Extension 12 Expression3 If DM 1 DM 2 DM 3 1111 ENDIF Note row 1 which must be included exactly as shown above in order for the file to propery be imported into the define table You will then need to browse your PC forthe txt Tab delimited text file that you have previously exported orcreated and are now importing Once you select it the define table will be populated with all the definitions Note If you are have manually created a Define table using Excel spreadsheet program you will need to use the correct format in your spreadsheet shown above and ensure that the file is saved in the Tab Delimited format not the standard spreadsheet format with a txt file extension TR RESEARCH 10 12 INTERNATIONAL Chapter 10 10 3 7 Export Define Table You can export all the items in the Define table of a currently opened PC6 file to the PC harddisk so that the these definitions can be imported into another PC6 program When you select Export Define Table you will just need to name and save the file with txt extension to your desired location The data are stored in TAB delimited format which can be opened directly by a Microsoft Excel program for viewing or editing 10 3 8 More Information on Define Tables Please ref
27. Click Reset when the program transfer is complete above rght screenshot IMPORTANT For Nano 10 FMD88 10 and FMD1616 10 PLCs If your program is using any timers or counters you must click Reset when the program transfer is complete so that the set values are properly stored to FLASH memory in the PLC If you click on Close timer and counter set values would not be retained and would be lost when PLC power istumed off orcycled unlessthe program Ti ees 3 12 INTERNATIONAL Chapter3 executes a RESET or SEISYSIEM_252 0 command first This is necessary whether or not any FRAM RTC module is installed The program will still run nomally other than that If you click Reboot the PLC will be hard reset CPU is power cycled This is not used for normal program transfer and is only necessary if there is a specific purpose for cycling PLC CPU power J ust as for a Reset any timer and counter set values would be permanently stored in the PLC The program transfer isnow complete and online monitoring can be performed Online Monitoring a Select On Line Monitoring from the Controller menu or press CTRL M on the keyboard ef Simulate Circuit Help 1 Program Transfer to PLC Transfer COS file to PLC Get PLC s Hardware Info Set PLC s Real Time Clock EEPROM FRAM Manager b The online monitoring window should open immediately if you are still connected to the server
28. Comments feature of i TRILOGI Open the Circuit menu and select Insert Comment A comment editor window will be opened up to allow you to add your comments to any part of the circuit When you are done with your comments just press lt ESC gt key or close the comment editor window and the comments you just entered will be inserted between the circuits Each comment occupiesa circuit position and there isno limit to the number of linesa comment circuit may have However if you wish to keep data file compatibility with the old DOS TRILOGI Version 4 x you should limit the comment to no more than 4 lines per comment and each line should contain no more than 70 characters A comment circuit may be moved around or deleted just like any other ladder circuits If you wish to edit the comment just double click on it or press GC TRIANGLE _ Da RESEARCH 6 15 INTERNATIONAL Chapter6 the lt Spacebar gt to open up the comment editor window You can use the nomal text editing keys such as left night up down cursor keys and lt Ctr Left gt lt Ctr Right gt lt Del gt and lt Backspace gt keys for editing the comment text 6 6 Ladder Logic Programming Tutorial STEP 6 The stage has been set and the show is ready Having completed the demo program it is time to test if it works as intended using the built in real time programmable controller simulation engine Open the Simulate pull down menu and activate the command
29. Default Settings PLC IP 192 168 1 5 9080 Usemame none ignored Password none ignored c Enterthe IP address and port number of your PLC if it was changed from the default 192 168 1 5 9080 d Follow steps c h in the Program Transfer section from Part 1 of this guide 5 ONLINE MONITORING Follow the steps in the ONUNE MONITORING section from Part 1 of this guide TRI RESEARCH II INTERNATIONAL a O URA Appendix 2 Appendix 2 Application Notes amp Programming Examples TRIANGLE RESEARCH INTERNATIONAL Appendix 2 A 2 Appendix 2 Application Notes amp Programming Examples A2 1 Important Notes to Programmers of TRILOGI Version 6 x A2 1 1Understanding Ladder Logic Execution Process Like all industrial PLCs the CPU of the Super PLC first checks the logic states of the physical inputs and copies them into memory During the ladder logic scan the actual logic states of the physical Inputs except for interrupt inputs are ignored by the PLC The CPU usesthe memory copy of the inputs to execute the ladder program The CPU executes its ladder logic program starting from the top rung of the program to the bottom rung When the CPU reaches a ladder rung that activates a CusFn or dCusF that custom function will be executed The CPU will only continue to scan the rest of the ladder program when the current custom function ends nomally Hence the order in which a ladder rung is placed within a lad
30. Examples IF A gt B 5 20 C OR C 20 B B 1 ELSE B B 3 ENDIF Comments A few comparison expressions may be linked with logical AND AND statement or logicalOR OR statement operatoras shown in the above examples 12 23 INCOMM ch Purpose To retum a single 8 bit binary data obtained fom Comm channel ch ch must be a numeric constant between 1 and 8 The actual target hardware determines the valid port This function retums 1_ ifthere isno data waiting at seral port Example FOR I 1 to 100 DM I INCOMM 2 IF DM I lt O RETURN ENDIF NEXT Comments Usually the PLC buffers the seral data amiving at its COMM port so that the program does not need to continuously check the COMM port for data When the program is ready to process the data it can use the FOR NEXT loop shown in the above example to read in all the data in the COMM buffer until it encounters a 1 which indicates that the buffer isempty Note INCOMM is supported on all COMM ports of the Nano 10 FMD series and F series families of PLCs as well as the legacy T1OOM D TLOOM X PLC 9 See Also OUICOMM INPUT PRINT 12 24 INPUT ch Purpose To retum a string obtained from communication port ch TRI RESEARCH 12 15 INTERNATIONAL Chapter 12 ch must be a numenic constant between 1 and 8 The actual target hardware determines the valid port This function retums an empty string if there is no valid string waiting at seral po
31. GC TRIANGLE _ URA RESEARCH 7 3 INTERNATIONAL Chapter 7 7 2 The Circuit Menu E j TRILOGI Version 6 45 D TRILOGNTL6 usr samples Demo PC6 Source L 1 1 Si ak File Edit Controller Simulate Circuit Help _cicut DEED Start Stop Insert Circuit Run i2 il 1 Move Circuit RLY Run Duration o Append Circuit ti IW Delete Circuit m Run Step Manual Segi ri jt i3 cl AVseq Clk 0 5s Manual i3 5eq1 1 Ou ol OUT _ Outs X D m Le 7 2 1 Insert Comments Comments are specific remarks used by a programmer to explain varous Charactenstics of a program segment and are ignored by the compiler i TRILOGI Version 6 allows comments to be freely inserted between circuits Execute thiscommand and the Comment Editor will be opened The comment editor allows you to enter any text you like that best describe the working of the circuit All standard text editing keys including cut and paste are applicable to the Comment Editor When you have finished editing the comments click OK to accept the changes and to close the comment window or click abort to cancel the changes and close the comment window Altematively you can pressthe lt ESC gt key to accept the changesand close the comment window Once a comment has been created it is assigned a circuit number and is treated like any other circuits You can edit it by pressing the lt spacebar gt when you are in Browse mod
32. OPEN ALE Forthe purposes of this tutorial the Demo PC6 program will be referenced This is a sample program that is included in the i TRILOGI installation This sample program as well as all the other included sample programs is accessible from the CA TRILOGI TL6 usA samples folder Below isthe Demo PC6 program File Edit Controller Simulate Circuit Help Circuit 1 DEE Gene Bookmark Start Stop il i2 ri RLY Run Duration ri ti IM Run ri jit i3 ci Avseg Cik 0 5s Manual f C II To RESEARCH Alz INTERNATIONAL Appendix 1 8 PROGRAM TRANSFER a Select Program Transfer to PLC from the Controller menu or press CTRL Ton the keyboard ex Z Fi RILOGI Edit x Simulate Circuit a D Select Controller Disconnect from Server On Line Monitoring Transfer CO5 file to PLC Open Matching Source File Get PLC s Hardware Info Set PLC s Real Time Clock EEPROM FRAM Manager Ethernet amp ADC Configuration Auto Calibrate Analog poe TLSe belt 192 168 1 5 9080 Default Settings Server IP localhost 127 0 0 1 9080 Usemame samples Password none blank field INTERNATIONAL TT v TRIANGLE ire RESEARCH Al 6 Appendix 1 c Click Detect ID and the PLC ID should be retumed in the adjacent field asshown below if communication is functioning corectly Login To LZ rete tae Se IR d Click OKt
33. Setup will close To install i TRILOG 6 45 build 05 you must accept this agreement 6 Then you must confirm that the recommended version of Java is already installed version 1 4 2 If it is installed click Next to continue Otherwise cancel the installation and see section 1 3 Install Java Run Time Enviroment RE 1 4 2 19 IMPORTANT II BEFORE you install this program please install the Java JRE 1 4 2 19 which is found to be the most stable Java runtime to be used with TRILOGI You can install the JRE by running the program from the CD ROM rel A 2 19 windows i586 p exe Or you can download from the following webpage http java sun com products archive j2se 1 4 2 19 index html When you are ready to continue with Setup click Next lt Back Cancel Th v TRIANGLE 1 4 ire RESEARCH INTERNATIONAL Chapter1 I TRILOGI Setup Guide 7 The next step is to select the installation folder It is recommended to use the default option which is C TRILOGI Sangen EL Select the folder you would like Setup to install i TRILOG 6 45 build 05 to Drivers ICPDAS Intel PerfLogs en me d The program requires at least 8 9 MB of disk space Click Next to continue or Cancel to exit Setup lt Back Cancel 8 If this installation is an upgrade then the installation folder may already exist and you will get prompted to use the same folder or choose a new o
34. TRI RESEARCH 3 13 INTERNATIONAL Chapter3 Line Monitoring IP 127 0 0 1 9080 ID 7 Tee H not then follow steps 2 4 from the Program Transfer section above to login to TLServer or FServer The above monitoring window will appear after suc cessful login Tai mass 314 INTERNATIONAL Chapter 4 Using TLServer Chapter 4 USING THE TLSERVER WEB SERVER FOR TRILOGI CA v TRIANGLE URA RESEARCH UNG INTERNATIONAL Chapter 4 Using TLServer 4 USING THE TLSERVER WEB SERVER FOR TRILOGI 4 1 Overview When you first start TLServer the following window will appear Referto chapter 1 5 Run TRILOGI and TLServer for instructions on starting TLServer iil PLC webserver fea Faditionally the TServer program is used Ee Ges as the software gateway to connect the now legacy M seres PLCs to the corporate LAN or the Intemet so that they can be controlled and programmed by an i TRILOGI client from anywhere in the IP Address1 192 168 1 115 9080 ese word M series PLCs did not have built in Geng TCP IP network capability and therefore z had to rely on the PC and Tl amp erver up Emails software to provide the network Sirti rea connectivity TLServer provides the TCP IP ie are tae interface to the network client and it then Help Version 3 17 Pass the data to from the PLCs via their RS232 or R485 serial ports only On the newer Super PLCs such as the Nano 10 FMD or F series PLCs
35. Timer table in the next step IMPORTANT 1 You can shift the Items in the I O table up or down or insert a new label between two adjacent pre defined labels Simply press the lt dins gt key or Right Click the mouse button to pop up the Shift I O menu which allows you to shift the selected I O However please note that if you shift the I O down the last entry in the I O table e g Input 256 will be lost In i Trlogi 6 2 and up shifting of Custom Function Label names will now shift the function content along with the label name In previous versions of i Trilogi shifting of the I O label would not shift the function content therefore making it untenable to use I O label shift to reorganize custom functions Wamings are provided if such an action were to result in overwnting of an existing custom function TRILOGI Version 6 2 and up allows I O label names of up to 16 characters However if you wish to keep compatibility with Version 5 x to 6 1x you should use no more than 10 characters to define the I O names eA TRIANGLE URA RESEARCH 6 3 LAY INTERNATIONAL Chapter6 6 2 Ladder Logic Programming Tutorial STEP 2 1 Timer table has an extra column Set 7 yo Labels Value located to the rnght of the Label Name column Set Value 2 After you have entered the label name Duration for Timer 1 a text entry box is opened up at the Set Value location of Timer 1 for you to
36. and the Buyer agree to the following terms and conditions of Sale and Purchase 1 The FMD1616 10 Programmable Controllers are guaranteed against defects in materials or workmanship fora period of one year from the date of registered purchase Any unit which is found to be defective will at the discretion of TRi be repaired orreplaced TRi will not be responsible for the repair or replacement of any unit damaged by user modification negligence abuse improper installation or mishandling TRi is not responsible to the Buyer for any loss or claim of special or consequential damages arising from the use of the product The product is NOT certified to be FAILSAFE and hence must NOTbe used in applications where failure of the product could lead to physical ham or loss of human life Buyer is responsible to conduct their own tests to meet the safety regulation of their respective industry Products distributed but not manufactured by TRi cany the full original manufacturers warranty Such products include but are not limited to power supplies sensors UO modules and battery backed RAM 5 TRireservesthe right to alter any feature or specification at any time Notes to Buyer If you disagree with any of the above tems or conditions you should promptly retum the unit to the manufacturer or distributor within 30 days from date of purchase fora full refund ote TRIANGLE be Dok RESEARCH Page iii INTERNATIONAL USER
37. can also call up their context senstive help by pressing lt 41 gt key after pressing the relevant button on the TLServer front panel NOTE TLServer version 3 17 has a new and improved Email Setup area To view the changes click on the Setup Emails button below as described above Ca TRIANGLE 7 URA RESEARCH 4 3 LAS INTERNATIONAL Chapter 4 Using TLServer 4 2 Serial Port Setup _ Serial Port Setup 4 2 1 Setting Up and Testing TLServer s Serial Communication Port Serial Communication Setup amp Test SEE Port Name COM5 Baud Rate 38400 D Data Bits ls D Stop Bits 4 D Parity None v Time Out mei 500 Close Port E P 7 Command String Press lt Enter gt to Send 01RVIA Response Strings amp Modem Messages COM5 opened at 38400bps FCS 4D Change PLCID Close F1 Help This dialog box allows you to configure the senal port of the host computer to match the setting on the PLC for proper communication Most of the items here are self explanatory If you have more than one PLC connected to the host computer via RS485 all the PLCs must have the same senal port settings as the TLServer The _Open Port button allows you to test whether the communication port is available to TLServer You can also click the _Close Port button to temporarily relinquish the port to other applications Note that you will need to close an opened port before you can change its parameter The Comman
38. there is already a built in Ethemet port which allows them to be connected to a router and hence directly accessible to from the Intemet TLServer is therefore not needed for nomal Ethemet communication with the PLC However TLServer is still an important tool for i TRILOGI software to connect to the PLCs under the following circumstances 1 A router connection is not readily available to the PLC 2 The IP address and or port number of the PLC s Ethemet port is unknown 3 The PLC Ethemet setup parameter table is comupted rendering the Ethemet port inaccessible With TLServer as long as there is an available serial port RS232 RS485 or USB RS232 RS485 adapter on the PC the i TRILOGI software will be able to connect to the PLC without using the PLC s Ethemet port at all This allow i TRiLOGI software to reset the PLC s Ethemet configuration in case of comuption or lost configuration data Tri nat 4 INTERNATIONAL Chapter 4 Using TLServer When a client program such asi TRILOGI wants to read from or write to a PLC it sends a command to the TLServer using the TCP IP protocol transported via the Intranet the Intemet or a local host connection The TLServer upon receiving the command will carry out the actual reading or writing to the PLC via the PC s RS232 or RS485 port The data received from the PLC is then relayed back to the Client program via TCP IP protocol TLServer is also a Web Server which serves up web pag
39. 0 if there is any enor orif the slave device is not present Parameters Tri Boss 12 69 INTERNATIONAL Chapter 12 ch PLC COMM port number Range 1 8 for MODBUS ASCII Range 11 18 for MODBUS RTU 11 is com1 12 iscom2z2 etc ID Device ID of the MODBUS slave device Range 1 to 255 addr Zero offset address of the holding register in the MODBUS Slave device starting from 0 40001 var the starting variable in the master whose data is to be sent out may be a DM orany system variable count number of variables to send max 16 in the legacy T1LOOM Series PLCs Example WRITEM B2 13 5 101 DM 10 8 The PLC will use MODBUS RTU protocol via its Comm port 3 to write 8 words of data from DM 11 to DM 17 to the save MODBUS device with ID 05 and into its register offset address 101 to 108 in MODBUS tem these refer to the 40102 to 40109 holding registers See Also READMB2 WRITEMO DBUS STATUS 2 Ca TRIANGLE 2 URA RESEARCH 12 70 LAY INTERNATIONAL Appendix 1 Appendix 1 PLC to PC Communications Setup Hardware GC TRIANGLE URA RESEARCH U N INTERNATIONAL Appendix 1 A 1 Quick Start PLC to PC Communication Guide Part 1 of this guide will show how to quickly get connected to the PLC from a PC via serial port RS232 and RS485 Part 2 of this guide will show how to quickly get connected to the PLC from a PC via Ethemet port Fora more in depth explanation see chapter 3 INTERFA
40. 1 ATSO 1 The above statement will tell the modem to answer on first ring you can also change the number 1 to other numbers E g if ATSO 3 it will answer on the 2 ring of the phone A4 3 Software and Programming The TLServer 3 0 which is part of the Intemet TRILOGI 6 x software suite already includes built in support for dialing a modem Hence if you are using the PLC in passive answer mode only all the PLC needs to do is to send a modem initialization string ATSO L using the 1st Scan pulse to put the modem in auto answer mode whenever the PLC is powered up The PLC doesnot need to issue any more commands to the modem Whenever a user wants to communicate with the PLC he she will first use the TLServer to dial and connect to the PLC s modem and when the connection is established he she will then be able to use TR TRIANGLE A4 3 RESEARCH INTERNATIONAL Appendix A the TRILOGI client or the TRi ExcelLink program to communicate with the PLC The fact that the PLC isconnected via modem and not via direct RS232 is totally transparent to the client programs To prevent unauthorized access to the PLC you may need to use the TBASIC command SETPASSWORD to set a protective password The great flexibility of these PLCs becomes even more apparent when you realize that you can easily program the PLC to automatically dial in to the TLServer to perform a number of tasks such as using the PLC s File Service to sa
41. 1 2 to 192 168 99 Usually the router itself would have the IP address 192 168 1 1 and the address 192 168 1 255 is reserved so these two addresses are not available and also between 192 168 151 to 192 168 1 254 again making sure that 192 168 1 254 is not already used by your router 2 GateWay IP Addr Gateway IP Addr 192 168 1 1 The Gateway IP address as shown above lets the F series PLC communicate with other LAN segments or connect to the Intemet The gateway address is usually the local IP address of the router where the PLC is connected For small local networks with no plan for connection to the Intemet the Gateway IP Address is not needed and can be set to 0 0 0 0 But if you plan to use the Fserver s email capability then you must fill in the comect Gateway IP Address Ask your system administrator if you have any question about this 3 SMTP Server IP Address SMTP Server IF 0 0 0 0 The SMTP Simple Mail Transport Protocol Server field as shown above lets you define the IP address of the email server that the PLC can use to send out emails from users program for F series PLC users please refer to Chapter 2 4 2 of the User Manual for more details on how to program the PLC to send emails This is the same SMTP server that your nomal email client software such as Thunderbird or MS Outlook uses to send out email You can ask your Intemet Service Provider ISP for the IP address of their SMTP server The ISP
42. 3 The Edit Menu Cut Circuit Duration Copy Circuit Paste Circuit UO Table View I O Type on Ladder F3 Edit Custom Function F7 Clear Custom Function Set TAB character Width 7 3 1 Cut Circuit You can remove a number of circuits from the current ladder program and store them temporarily in the clipboard for pasting into another part of the present ladder program orinto another file altogether In other words it lets you move a block of circuits from one part of the ladder program to another part or into another file Please note that you can t UNDO a Cut Circuit operation However if you do make a mistake you can always paste it back in its original position 7 3 2 Copy Circuit Ctrl C You can copy a block of circuits from the current ladder program and store them into the clipboard for pasting into another part of the present ladder program or into another ladder program file altogether fe TRIANGLE TRY RESEARCH 7 6 INTERNATIONAL Chapter7 7 3 3 Paste Circuit Ctrl V When you execute this command the block of ladder circuit which you Cut or Copy into the clipboard will be pasted just before the currently selected Circuit The current circuit number will be adjusted to reflect the change 7 3 4 Find Ctrl F The Find command allows you to quickly locate a ladder logic circuit that contains a particular label name The Find command can also be used to search for a keyword in a TBASIC program
43. 6 x or TLServer 3 x program starts up the program will automatically try to load the specific language file based on the locale of the users operating system and use the file content throughout the session However if the program fails to find the corresponding language text file then it will use a set of intemally defined English language text strings for its entire menu and on screen display For English locale user all i TRILOGI 6 x help files are stored in the following folder c TRILO G N TL6 public Help However if you start TRILOGI in locale xx then when you attempt to open an online help file TRILOGI will first check if there exist a folder c TRILOG N TL6 public xx_Help If it finds it then the help files will be loaded from this locale specific folder But if it cannot find the xx_Help folder it will then load the help files from the default folder c TRILO G N TL6 public Help Hence for those who wish to experiment with providing their own locale specific help files they should copy all the help files from the default folder into the new locale specific xx_Help folder and then make changes to files in the new folder When they press lt F1 gt in TRILOGI the help files will be loaded from the xx_Help folder bei Bass 1 10 INTERNATIONAL Chapter 2 Introduction To l TRiLOGI Chapter 2 Introduction to i TRiLOGI Client Server Architecture GC TRIANGLE URA RESEARCH U N IN
44. A i TRILOGI Version 6 and higher supports eight sequencers of 32 steps each Each sequencer uses one of the first eight counters Counter 1 to Counter 8 as its step counter Any one or all of the first eight counters can be used as sequencers Seql1 to Seqs To use a sequencer first define the sequencer name in the Counter table by pressing the lt F2 gt key and scroll to the Counter Table Any counterto be used as sequencer can only assume label names Seq1 to Seq8 comesponding to the counter numbers For e g if Sequencer 5 is to be used Counter 5 must be defined as Seq5 Next enter the last sep number forthe program sequence in the Value column of the table Construct a circuit that uses the special function Advance Sequencer AVSeq The first time the execution condition for the AVseq function goes from OFF to ON the designated sequencer will go from inactive to step 1 Subsequent change of the sequencers execution condition from OFF to ON will advance increment the sequencer by one step This operation is actually identical to the UPctr instruction The upper limit of the step counter is determined by the Set Value SV defined in the Counter table When the SV is reached the next advancement of sequencer will cause it to overflow to step 0 At this time the sequencers bei Bass 9 15 INTERNATIONAL Chapter9 contact will tum ON until the next increment of the sequencer This contact can b
45. A Hello Welcome To TBASIC Z MID A 3 5 b Concatenation Operators Two or more strings can be concatenated joined together simply by using the Operator e g M Hello A welcome to B If A contains ames and B contains TBASIC M will contain the string Hello James welcome to TBASIC c Comparison Operators Two strings may be compared for equality by using the function SIRC MP A B However the integer comparator such as lt gt etc cannot be used for string comparison d Functional Operators TBASIC supports a number of statement and functions which take one or more string arguments and retum either an integerora string value e g LEN x MID A x y PRINT 1 A SETLC D 1 x VAL x 11 3 4 String Variable Comments With i TRILOGI version 6 2 and above you can now attach comments to any variable name of any length to make program easier to read The compiler will ignore any alphanumeric characters A to z O to 9 and _ that are attached Tri Boss We INTERNATIONAL Chapter11 behind the variable name following an underscore character _ It isimportant to understand that by appending these comments to variables no new vanables are being created For Example A Some_String comespondsto A or 1 A string vanable such as A can have different comments each time it is referenced in the same program because the compiler ignores the com
46. DAC with the 16 bit integer result of the expression x n must range between 1 and 16 Once set the DAC channel will latch the set value until the next SETDAC statement on the same channel is executed SETDAC 5 A B 16 DAC channel 5 will be set with the value of A B 16 A run time error will result if n is less than 1 or is greater than 16 The actual number of DAC channels depends on the PLC model in use 12 40 Chapter 12 12 58 SETHIGH16 v data Purpose Examples Comments See Also 12 59 SETIO Note To assign the upper 16 bit of a 32 bit integer vanable v to data The lower 16 bit of v is unaffected This can be used to construct the value of a 32 bit integer data using two 16 bit data obtained from eitherthe EEPROM orthe DM n A DM 2 SETHIGH16 A DM 1 If you are constructing the value of a 32 bit variable from two 16 bit data then SETHIGH16 should be executed only after the lower 16 bit has been assigned to the 32 bit variable as shown in the above example If you were to execute A DM 2 after the SETHIGH16 A DM 1 statement the SETHIGH16 operation would have been lost since the assignment statement itself overwnites all previous operation including SETHIG H16 on vanable A GETHIG H16 labelname Please referto the definition of CLRIO command 12 60 SETLCD n offset x Purpose Comments 7 v TRIANGLE URA RESEARCH LAS INTERNATIONAL To display the string expression
47. E E i TRILOGI Version 6 45 C TRILOGNTL6 usr samples Demo PC6 Source Local Disk File Edit Controller Simulate Circuit Help Circuit 1 PAAA heine Bookmark a Start Stop Run il i2 ri RLY Run Duration ri ti IMi Run Step Manual Geo ri i4 i3 ci Avseg Clk 0 5s Manual 7 Geo Out ol OUT Outs 08 OUT Seq1 2 Out2 o2 OUT Out oi OUT PR B bee Et 7 The logic states of any I O can be displayed on the ladder diagram directly An Input Output Relay Timer or Counter contact that istumed ON will have its label name highlighted in the ladder diagram This feature helps greatly in debugging and understanding the logical relationship between each I O For example from the above figure we can see clearly that the Zelt latching circuit for relay Run works as intended when we first tum ON the Sta rt input Run will be energized and its contact which is parallel to Start will hold itself in the ON state even if we subsequently tum OFF the Start input by releasing the button 8 The timer coil Duration being connected in parallel to Run relay will also be energized However its contact will only be closed after 100 seconds when its present value counted to 0 To break the latched On Run relay we must energize the Stop input momentarily to break the power flow Try it now 9 Let s restart the system by tuming ON the Start input momentarily again Nex
48. EEP must not contain any of the following characters ASCIIO 00 ASCII 10 0A and ASCII 13 OD TRI DE E INTERNATIONAL Chapter8 Click on this button to write both the integer and string EEP buffer contents to the PLC s EEPROM i TRILOGI will prompt you to confirm the write action and it will also prompt you to login to a TLServerif it isnot already connected to one Get INTEGER EEP data from PLC Get STRING EEPdata from PLC You can click on one of these two buttons to read a range of data EEPROM as 16 bit integer or as an ASCII string into their respective EEP Buffer The program will attempt to login to a TLServer if it isnot already connected It will check the maximum EEPROM addresses available on the target PLC and then prompt you to enter the range of integer data you wish to read up to the maximum available Retrieve Integer EEPROM Data from PLC Get Integer Data The data read from the PLC are stored into the EEP buffer in comma delimited format as described above Integer EEPROM data can also be captured in hexadecimal format if you check the HexData check box You can edit or append to the captured data in the buffer and then write them back to the data EEPROM area orsave aSa hard disk file Load from File into Buffer Save Buffer to File You can save both the Integer and String EEP Buffers content to a single text file with the default extension csv The data a
49. F2424 and F1616 BA See users manual for more details 12 64 12 Pulse Measurement Resolution 20 O data 0 PULSEPERIOD and PULSEWIDTH 1 to 4 retums data with 0 1us resolution 1 data 1 PUSLEPERIOD and PULSEWIDTH 1 to 4 retums data with lus resolution For PLC firmware r77 and above data 2 to 255 Number of seconds of inactive incoming 2to 255 pulses before PULSEWIDTH and PULSEFREQUENCY assume that incoming pulses has stopped Default is 5 seconds 12 64 13 Dimmer Interrupt Enable 22 O data 0 Disable Dimmer interupt 1 data 1 Enable Dimmer interrupt 12 64 14 Quadrature Encoder Config data isdefined asa two byte integer for configuring the HSC channel to be simple enhanced x1 enhanced x2 or enhanced x4 count Applicable only to PLC with fimware r72 and above Upper byte UB channel number GHO1 or amp HO2 or Lower byte LB amp HOO default simple amp HO1 x1 amp H02 x2 amp HO3 x4 View the HSC chapter of your PLCs reference manual for more information af 12 64 15 Analog Output Range TRI ease es INTERNATIONAL Chapter 12 Applicable only to FMD PLCs for selecting the analog output type 0 5V or 0 10V Please refer to Chapter 5 of the PLC s User Manual 12 64 16 Close TCP Connection To force close an an incoming TCP server connection 251 Oto 5 data 0 to 5 Force close a FServer and Modbus TCP server connection l1 data 11 Force close a FIP Server connection Applicable only t
50. Move Complete Relay Bit Range 1 to 512 nts At the end of the move the relay r will be tumed ON Position can be between 231 to 231 e about 2 x 109 The absolute position is calculated with respect to the last move from the HOME position The HOME position is set when the SIEPHOME command is executed The speed and acceleration profile are determined by the STEPSPEED command asin the orginal command set This Command automatically computes the number of pulses and direction required to move the stepper motor to the new position with respect to the current location The current location can be determined at any time by the STEPC OUNTABS function Once STEPMOVEABS command is executed re execution of this command or the SIEPMOVE command will have no effect until the entire motion is completed or aborted by the STEPSTOP command TRIANGLE 2 63 RESEARCH INTERNATIONAL Chapter 12 See Also STEPCOUNT_ STEPCOUNTABS STEPSPEED STEPMOVE STEPSTOP STEPHO ME 12 72 STEPSPEED ch pps acc Purpose To set the speed pps and acceleration retardation acc parameters for the PLC s stepper motor motion controller pulse generator channel ch Parameters ch Channel Range 1 to 8 pps Speed Range 1 to 10000 Set the target no of pulses per second pps output by the pulse generator Acc Acceleration Steps Range 1 to 222 The acceleration acc determines the total number of steps taken to r
51. None N Time Out 500ms These settings match the default com settings for all Super PLC seral ports so they don t need to be changed unless they have been specifically modified by a PLC program transferred to the PLC afterpurchase The only setting that needs to be checked and possibly modified is the Port Name This isthe com port that the PC usesto connect to the PLC Select the COM port that the USB adapter is installed on or the built in RS232 port if your PC has one from the drop down menu Note that the USB adapter would need to be installed propeny before starting TLServer or it wouldn t be available from the drop down list You can test the COM setup by entering a Host Link command in the Command String field The following example isa good basic command to TRI RESEARCH 3 6 INTERNATIONAL Chapter3 test Communication Serial Communication Setup amp Test Col E zl Port Name COM3 v Baud Rate 38400 v Data Bits 8 v Stop Bits 1 v Parity None v Time Out ms 500 Close Port O O Command String Press lt Enter gt to Send IR Response Strings amp Modem Messages FCS f p Change PLCID Close F1 Help If you have only one PLC connected to your TLServer computer then you can test the communication now using the following command string Command String IR Response String IRO1 The response string tells you that the ID address of this single
52. PAUSE LED on the PLC will light up If you then go online monitoring the program will open up the custom function and highlight the breakpoint line where the breakpoint was encountered Note that the breakpoint sent to the PLC is volatile If you reboot or power on reset the PLC all the breakpoints will be disabled This ensure that production PLC will not halt at any breakpoint that you forget to clear Hs E To manually clear all the breakpoints you can un check the 5 04 Bre Fis to PLC checkbox and the i TRILOGI program will disable the breakpoints in the PLC If the checkbox was already unchecked but for some reasons the PLC breakpoints have not been cleared yet then you will need to first check the checkbox to transfer the breakpoints to the PLC and then followed with an uncheck to disable them If a PLC stops ata breakpoint that is not defined in your curent file then the i TRILOGI program will give you an alert and will not be able to display the line where the program break 10 8 Error Handling Since the CusFn text editor does not restrict the type of text that may be entered into its editor the i TRILOGI compiler will have to check the syntax of the users TBASIC program to look out for misspelling missing parameters invalid commands etc Such errors which can be tracked down during compilation process are know as Syntax Errors 10 8 1 Syntax Error i TRILOGI employs a sophisticated yet extremely user friendly synta
53. PC hasa 64 bit Windows and some users reported that the J RE 7 on their 64 bit Windows did not work propery with l TRILOGI You can install J RE 1 4 2_19 even if your PC already have other J RE versions l TRILOGI software will automatically invoke J RE 1 4 2_19 if it is installed on your PC J RE must be installed BEFORE installing the i TRILOGI software First double click on the file j2re 1_4 2 19 windowsi586 p exe to install the J RE Please follow all instructions provided by the Install Shield program and install it onto the given default path which is C Program Files Java on 32 bit Windows and C Program Files x86 J ava on 64 bit Windows 1 4 Install i TRiILOGI 6 x The following stepscan be taken to install the i TRiLO GI software 1 After you have installed J RE 1 4 2 19 then double click on the SetupTL6 exe file orthe Setup6xx exe file if you have downloaded the latest upgrade to insta Il l TRiLO GI 2 On any PC with an operating system that has user account controls the first installation step will likely be a waming about an unknown publisher as per the below screenshot If this appears click Yes to continue Program name SetupTL645b5 exe Publisher Unknown J Pie origin Downloaded from the Internet 3 Next you will be asked if you want to install the indicated version of i TRILOGI Again click Yes to continue Ti v TRIANGLE 1 R RESEARCH INTERNATIONAL Chapter1 I TR
54. PLC is 01 which is default If the ID waschanged then it will be shown in place of 01 f you get the message Weaming No Response Pom DCH then Communication is not setup propery First repeat the steps from PLC connection to TlServer setup and if there is still no response refer to the TROUBLESHOOTING SERIAL COMMUNICATION Appendix at the end of this document If you received the cormect response then setup is complete and communication is confirmed so you can proceed to the next section to get communicating from TRILOGI 3 2 2 TRILOGI Communication TRILOGI is the client program that is used asthe PLC programming environment and to perfom the two main types of communication from TRILOGI eD TRIANGLE 7 URA RESEARCH 3 7 INTERNATIONAL Chapter3 a Program Transfer b Online Monitoring Whether you are connected to the PLC via seral port or Ethemet you can now perform both of these tasks If you have connected via seral port then TRILOGI will connect to TLServer must be running on the PC connected to the PLC If you have connected via Ethemet then TRILOGI will connect to the PLCs web server which is called FServer First you will need to start TRLOGI which can be done from the Start menu See section 1 5 Run TRILOGI and TLServer for more details on starting TRILOGI The below window will open a File Edit Controller Simulate Circuit Help Circuit 1 DAAA Gene sokmak GEE Press F1 for contex
55. Run All I O reset Ctn F9 i TRILOGI will immediately compile the ladder program and if no enor is detected it will instantly proceed to open up the Programmable Logic Simulator screen as shown below 1 KEk Pause A Hi Run A Mi our ES 30 WH 5m Ba Ss LS KS 10 KS mes AER KS S lt UU UU SEEEFEER tacadcadcd OJD in e N If you have followed closely all the instructions during the creation of the demo program you should not encounter any compilation emor However if you do receive an enor message then please check your circuit against the picture shown in the assignment page make all necessary corections and then try again The simulator screen comprises 5 columns Input Timer Counter Sequencer Relay and Output With the exception of the Relay table which contains up to 512 elements and the Timer table which contains up to 128 timers all other columns contain 256 elements each Every column has its own vertical scroll bar You can use the mouse to scroll each column independently to locate the desired I O TR RESEARCH 6 16 INTERNATIONAL Chapter6 3 The label names for the inputs outputs relays timers and counters defined earlier in the I O tables automatically appear in their respective columns To the left of each label name column isan LED lamp column which indicates the ON OFF state of respective I O A red colorlamp represents the ON state of an I O whereasa dark g
56. SCHEUREN EEN 9 6 9 2 1 CIOCK OH 9 6 9 2 2 SOO NX EE 9 7 ege 2 TRIANGLE Dok RESEARCH Page vi INTERNATIONAL USER MANUAL 9 2 3 Normally ON Flag Nom ON nsssssssssssssssssrsrnsrssissnsnsinrisrssnnrnsnnnnnintnsnsnnnnnnnnnnnnntnnnnnn nnne 9 7 9 2 4 First SCAN Pulse Let can 9 7 9 2 5 Real Time Clock Eror RIC Em 9 8 9 3 Special LA 9 8 9 3 1 Reversible Counter Functions DNctr Upctr and RSctr aa 9 9 9 3 2 Sequencer Functions AVseq RSseq and epN 9 11 9 3 3 Latch Relay FUNCtION Lateh nainii aiias 9 11 9 3 4 Clear Relay Function ICearl nnt 9 12 9 3 5 Inteo CK LOCK iniii minia a a aaa iaiia ai 9 12 9 3 6 Differentiate Up and Down d DIFU and d DIPDl ee eessesseesteesteeseeneees 9 13 9 3 7 Custom Functions C usFn and du 9 14 9 3 8 Master RESE EE 9 14 9 4 Using i RiLOGI Sequencers sssssensssunnsunnnennnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnm nnmnnn annman 9 14 9 4 1 Special Geguencertunc ons 9 17 9 4 2 Other Ap DIE atO Sisenna elves dined eiti eet ieee a linerider nears 9 17 9 4 3 atelier 9 18 10 INTRODUCTION TO TBASIC CUSTOM FUNCTIONS 10 1 10 1 OAV TAT An A 10 1 10 2 Custom Function EditOr sssssssssnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnmnnn nna 10 1 10 2 1 Split Pane Ulee EE 10 2 10 2 2 New Help Feature REENEN NEEN 10 3 10 2 3 Se IC FUN ME 10 6 10 2 4 Navigating CUSOM FuncHons cece cess ceeeeeeeeeteeeeeeeaeeeeseaecaeteeseaetaeeeaeeaeeneseaees 10 7 10 2 5 View Other Custom Fun
57. Sequencer to Step SN Select a Sequencer EN Latch Latching Relay Output EE Sequencer 1 N e J oF On SR GA 8 Clear Clear Latched Relay e ILock Interlock Begin jSequencer Z A ILof Interlock End Sequencer 3 IB dDIFU Differentiate Up jSequencer 4 C dDIFD Differentiate Down Sequencer 5 D CusFn Custom Function Sequencer 6 E dCusF Diff Up Custom Funcs Sequencer 7 F MaRST Master Reset oo Sequencer 8 When prompted select Sequencer 1 This function will increment the step counter of Sequencer 1 each time its execution condition goes from OFF to ON Again remember to pressthe lt Enter gt key to complete Circuit 2 6 5 Ladder Logic Programming Tutorial STEP 5 1 Circuits 3 to 6 are similar to one another They make use of the Sequencer to tum on the Outputs 1 to 8 to create a pattem of running lights when executed The label Seq1 1 of the contact in Circuit 3 represents Step 1 of Sequencer 1 Remember that each sequencer can have up to 32 steps Step 0 to 31 with each step individually accessible as a contact A nomally open contact Seq1 1 will be closed whenever the step counter of Sequencer 1 reaches number 1 Likewise a nommally closed contact Seq5 20 willbe opened when the step counter of Sequencer 5 reaches number 20 Geo Ou OUT Outs OUT 2 To create the nomally open contact Seq1 1 left click on the icon When the I O table pop
58. Tri ee 4 18 INTERNATIONAL Chapter 4 Using TLServer The maximum number of lines in your email body is limited by the number of string variables D to Z 23 in total available in the Nano 10 FMD series and F Series PLCs For example if the PLC needs to send email to trilogi yahoo com with a 1 line greeting then the program needs to activate a custom function that contains the following statements trilogi yahoo com recipient The time is STR TIM E 1 STR TIME 2 Message body How are you doing emevent IJ 10 0 d O You must also setup the email service period say every 10 second in the Setup Emails screen for this PLC When the TLServer scans the PLC and found that its emEvent 1 is set to 1 it will extract the headers and message body from the PLC s string variables Only A to D will be extracted in this example since the message contains one line of body text only asindicated in emEvent 1 TLServer will then contact the SMTP server to send out the email In addition after processing the email request the TLServer will set the emEvent 1 variable to a value of 1 no email Hence there isno need for the i TRILOGI program to wony about clearing the email request flag after the email has been sent In addition this provides a way for the PLC program to know whether the TLServer is functioning propery and whether the email request has already been processed However do take note that eve
59. VO table Find Text in CusFn Itis now possible to search for text within a custom function and when the option Find Text in CusFn is selected the custom function editor window will open automatically to the first custom function You can either search for text within the current custom function local search or in all of the custom functions in your program global search To do a local search simply type the text in the command line below the Find and Find All buttons and then click the Find button If the text is found in the Current custom function it will be highlighted in the text editor as shown below Also the text Find only in this CusF will be displayed below the command line in the search area indicating a local search Each time the Find button is clicked the next instance of the search text will be highlighted until the text cant be found anymore At this point the message in the search area will change to Text Not Found and the next time Find is clicked the first result will be highlighted again TR RESEARCH 8 11 INTERNATIONAL Chapter8 KS Custom Function 1 EventCount DER aj Control x Bi Initial value of x 0 S SETLCD 1 1 Cycle Count 4 STR X Find Je D x Find only in this CusF To do a global search simply type the text in the same command line and click the Find All button If the text is found in any custom function within the program it will be hi
60. When this command is executed you will be further prompted to select the option of searching fora ladder logic label ora text in a Custom Function 7 3 5 Goto Ctrl G Use this command to move towards a specific circuit number The Goto command is particularly useful if your program contains many circuits and it is inconvenient to search fora particular circ uit using the mouse or the cursor keys 7 4 The Circuit Editing Mode i TRILOGI comes with a smart editor which allows you to insert or delete a single element within a circuit easily The editor interprets your circuit immediately upon entry and prevents you from creating illegal circuit connections The functions of various keys in the circuit editing mode are detailed below You know that you are in the circuit editing mode when a row of ladder logic icons appears along the upper status line next to the circuit number and a yellow color highlight bar appears and you can move it to select an element in the ladder circuit as shown below bei Bass 7 7 INTERNATIONAL Chapter 7 RS i TRILOGI Version 6 45 Untitled D BS File Edit Controller Simulate Circuit Help Circuit 1 7 4 1 Mouse Actions Left Click When you click on an element using a the left mouse button the element isselected and highlighted by the yellow color highlight bar Right Click When you click on an element using the right mouse button you are allowed to directly edit the la
61. You can use this command to query the connected PLC forthe filename of the last i TRILOGI program transferred to it and it will attempt to match it to a file stored in the log in users directory at TLServer or on the PC s hard disk If the file is found it will be opened Otherwise it will report that the file is not found Note that this command only opens the source file based on file name matching It does not verify whether the file has been modified It is the user s responsibility to ensure that the file stored in the server is the same one that has been compiled and transferred to the PLC If you have created a new file i e the file name is Untitled and then attempt to perform on line monitoring this command will be called automatically to try to open a file that matches the PLC The command is also invoked when you select a PLC with a different ID either from the Controller menu or from within the Full Screen Monitoring window Note to Unicode users If you created your file name using Unicode instead of plain ASCII the Unicode filename will not be saved into the PLC since TRi PLCs Currently do not support Unicode in its intemal memory In such case you cannot use this command to open the matching source file You would have use the File gt Open Local Drive command to manually open the file for monitoring pupos 8 3 7 Get PLC s Hardware Info bei Bass 8 16 INTERNATIONAL Chapter8 You can find out the PL
62. You will be able to see the label name of the program element above the Latch symbol in the ladderdiagram Although latch relay can be used in place of self latching Seal circuits a latch relay in an interlock section will not be cleared when the interlock occurs Onlya self latching circuit as shown in the following will be cleared in an interlock section Start Stop CR1 D s al E CR1 Tigi Bae d INTERNATIONAL Chapter9 9 3 4 Clear Relay Function Clear To de energize a program element that has been latched by the Latch function it is necessary to use Clear function On selecting Clear choose the output or relay to be de energized When the execution condition for that Circuit is ON the designated output or relay will be reset In the ladder diagram the program element label name willbe shown above the Clear symbol If the execution condition for Latch and Clear functions are both ON at the same time then the effect of the designated bit depends on the relative locations of these two functions Remember that an output or relay bit energized by Latch will remain ON until it is tumed OFF by Clear It is recommended that Clear circuit be placed just after the Latch circuit for the same output or relay controlled by these two functions This ensures that Clear function has higher priority over Latch function which is nomally so in hardware latch relay or other industrial PLCs 9 3 5 Interl
63. an extended wire GC TRIANGLE _ URA RESEARCH 6 8 INTERNATIONAL Chapter6 8 Right below the relay coilisa parallel timer coil with label name Duration To create this coil click on the icon This allows you to connect a parallel coil to the existing coil The O table will pop up for selection again Since we want to choose a timer scroll to the Timer table and pick the first timer with the label Duration to complete the circuit Press the lt Enter gt key once to complete Circuit 1 9 Congratulations You have just successfully created you very own ladder logic circuit It is that simple It may be a good time to save your program now by pressing lt CTRL S gt key or select Save from the File menu and give a file name for you new program 6 4 Ladder Logic Programming Tutorial STEP 4 We will now create Circuit 2 asshown below Run Step Manual Geo Lo AVseq Clk 0 5s Manual 1 Follow the steps listed in STEP 3 to create the following circuit fragment a si i TRILOGI Version 6 45 Untitled o lime Sen File Edit Controller Simulate Circuit Help eene ee a i gt RUN Ste Manual el ri US Kee 2 We want to enclose the two seres contacts Step and Manual with a parallel branch that contains two elements First we will create the branch forthe N C Manual contact ED TRIANGLE S URA RESEARCH 6 9 INTERNATIONAL Chapter6 3 Click on the elemen
64. and allow the client to log in 11 Access Level AccessLevel 1 Frogrammer el You can define the access level that the i TRILOGI client is permitted to operate under on the PLC Three access levels are currently defined 1 for Programmer 2 for User and 3 for Guest Please see the TLServer User Setup for the definition of the accesslevels 12 Advanced Configuration Advanced Contig The Advanced Configuration button lets you configure other more advanced beyond the basic Ethemet configuration but less often used features of the PLC This includes definition of the Trusted IP addressesas well as calibrations of the PLCs Analog I Osand Real Time Clock RIC Toi DE ge INTERNATIONAL Chapter8 8 3 10 2 ADVANCED CONFIGURATION S Factory Defaut _ TustedP 1 fs TustedP 3 O wT TustedP s i wT Mobdus TCP UseTrusted IP FServer UseTrusted IP Yes No ADC Calib Chi Ch2 o 000x 0 Jg zeen o o Zeg K o o Zero Offset lo o ln lo ADC Moving Avg of data points Retrieve Parameters from PLC Basic Config V Reboot PLC after Save 1 MAC ID A read only field that contains the 6 byte 48 bit Ethemet MAC ID 2 Trusted IP MODBUS TCP Access Security Trusted IP 1 E 2 sl Trusted IP 3 j 4 fF Trusted IP 5 6 KT H Mobdus TCP UseTrusted IP FServer UseTrusted IF Yes C No CG es KC Mo T es 8 30 INTERNATIONAL Chapter8
65. associate with the selected bookmark You can optionally enter edit a description for the bookmark to help you recall the purpose of that section of ladder circuit which the bookmark is associated with Then click the Change button to update the circuit and description at the cormesponding bookmark location In i Trlogi version 6 2 and laterthe bookmark you have created will be displayed in the comesponding ladder circuits New programs created will set all the bookmarks to a default value of 0 so that no bookmarks are displayed until they have been manually created In i Trilogi version 6 2 and later there isa feature that allows you to immediately go the last circuit that was selected This is implemented by clicking on the button that is located beside the bookmark buttons which are described above Whether you move to a new circuit by using the Goto Circuit command ora bookmark or just by clicking on a circuit with the mouse the Last button will remember your last circuit position This also allows you to easily switch back and forth between two circuits an unlimited number of times because if you don t select a new circuit after pressing the Last key you will go back to the circuit you came from Note The bookmark definitions are saved along with the program body into the PCE file which means that the bookmark that you defined fora particular program can be recalled later when you open its PC 6 file
66. ch ID addr sssssnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 12 27 12 42 READMB2 ch ID addr var COUNt ssssssnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 12 28 12 43 AEn SA sacs EEN 12 29 12 44 REM or Eu nnmnnn 12 30 12 45 FREESE EN 12 30 12 46 RESIART REBOOT eege 12 31 12 47 RETURN e E T 12 31 12 48 RSHIFTi n StAtemMent ssssssssnonnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 12 31 12 49 SAVE_EEP data addr SAVE_EEP8 data addr8 SAVE_EEP16 data addr16 SAVE EEPS2 data addr32 isasurannaninnanannndananannanannanannananaanananaunannnnannnannanannananaananannananainain 12 32 12 50 SAVE EEPS stdata addr ssssssssssssnnnonnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnaaa 12 34 M A D TRIANGLE i LURA RESEARCH Page ix INTERNATIONAL USER MANUAL 12 51 SETBAUD ch baud_nO ssssssssssennnennnnnnnnonnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnmnnn nnmnnn nnana 12 35 12 52 S LANZ a A 12 36 12 53 GLEN TE 12 37 12 54 SET IPAddr dmindeX sssssssssssssunsonnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nannan nnana 12 38 12 55 S Dimmer ch value sesssgessegssgeussgussssseegeseueeEkueEEVEEECERE VEER KEEEVEESCrEAERESKEEE CN 12 38 12 56 SetimerSV n VALUE sisvsisvsccasissnssncsseccsensscnnsccnsiscasasccesscnssiccnnasacnasccnssananecnen 12 39 12 57 SETDAC n X Gatermment eerrekEERKEKEREEERKEERKEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE 12 40 12 58 SETHAG HIG v data vvssssestistntsnsnscasnstacsnninvacnstsss
67. com with the subject PLC Email Test execute the following statements PRINT 1 lt EMAIL whoever yahoo com gt change it to yourown email PRINT 1 Sender tnuser hotmail com itcan be anything PRINT 1 Subject PLC Email Test DDINIT 1 Halla thic Ama il te eant hvu unir fainndAh s TDL ACI 4 21 Subject subject text data data data data q gt Read Data from File Format lt READ filename gt el TRIANGLE Tat RESEARCH INTERNATIONAL Chapter 4 Using TLServer PLC PRINT 1 Don t wony everyting is working out great today PRINT 1 lt gt Note e Sender field should be in email format such as xxx yyy zzz but it does not need be a valid email address Subject field is optional and may be omitted totally The TLServer will first save all the data it received into a temporary file named Email txt in the default directory After the TLServer receives the end of service tag lt gt from the PLC and it will then send out the email to the recipient email address This email service will make use of the SMTP server defined in the Setup Emails portion of the TLServer configuration so make sure that you have defined a correct SMTP server before testing the email service function When the email has been successfully sent via the SMTP server the TLServer will send an lt OK gt tag to the PLC to acknowledge that the EMAIL request has been successfully com
68. contacts a relay can have 9 1 3 Out Coils A PLC output is really just an intemal relay with a physical connection that can supply electrical power to control an extemal load Thus like a relay an output can also have unlimited number of contacts that can be used in the ladder program 9 1 4 Timer Coils A timer isa special kind of relay that when its coil is energized must wait fora fixed length of time before closing itscontact The waiting time isdependent on the Set Value SV of the timer Once the delay time is up the timers N O contacts will be closed for as long as its coil remains energized When the coil is de energized i e tumed OFF all the timers N O contacts will be opened immediately However if the coil isde energized before the delay time is up the timer will be reset and its contact will never be closed When a last aborted timer is re energized the delay timing will restart afresh using the SV of the timer and not continue from the last aborted timing operation 9 1 5 Counter Coils A counter is also a special kind of relay that hasa programmable Set Value SV When a counter coil is energized for the first time after a reset it will load the value of SV 1 into its count register From there on every time the counter coil is energized from OFF to ON the counter decrement its count register value by 1 Note that the coil must go through a complete OFF to ON cycle in order to decrement the counter If th
69. delay This may not be desirable if the rest of the process must respond to fast changing inputs For delays longer than 0 1s a much better way is to invoke the regular PLC timer and use the timer contact to trigger another custom function at the end of the delay Note that for Nano 10 FMD Seres and F series PLCs the minimum delay is lms and the resolution is lms whereas for the Legacy TLOOMD and TLOOMX the minimum delay provided by this function is 10ms and the resolution of the time delay is 10ms This means that if you execute DELAY 155 the actual delay willbe rounded to 160ms whereas for DELAY 154 the actual delay will be 150ms To exit from a WHILE ENDWHILE or FOR NEXTloop 12 5 Synta x Comments Example See Also Chapter 12 EXIT This new command is only available to PLC with finnware version r75 and above Instead of using the GOTO command to get out of the loop the EXIT command will orderly end a WHILE ENDWHILE loop or a FOR NEXT loop and jump to the next statement after the ENDWHILE or the NEXTcommand S 1 WHILE S S S 1 IF S gt 100 EXIT ENDIF DELAY 1 ENDWHILE X INPUT 1 When S has been incremented to 100 the CPU will exit the loop and continue executing the command after the ENDWHILE statement which isthe X INPUT 1 statement WHILE ENDWHILE FOR NEXT CONTINUE 12 12 FOR NEXT Purpose Synta x ED TRIANGLE URA RESEARCH L SC INTERNATIONAL To exe
70. e Set point value Feedback Value The controller may obtain feedback from ADC High Speed Counters PULSEFREQUENCY or other means The obtained result is then scaled and subtracted from the desired set point value to get Er All computations are performed in 32 bit integers and the function retums a 32 bit integer that can be assigned to any vanable Any scaling for actual output DAC or PWM willbe computed by the user within the same CusFn and sent to the output ER Controller ADE2 Sensor Example Eg Implementing Closecicop Digtal Control with PID computation functicn E 10000 ADC 2 20 A PIDcompute 5 E setPWM 4 A 8000 100 Comments The set point value is 10000 units the feedback value is read from ADC channel 2 and then multiplied by 20 to convert scale it to the same unit asthe parameter to be controlled PID computation channel 5 assume somewhere in the program a PlDdef for channel 5 has been executed before is then used to compute the desired controller output value using the enor signal set point feedback value ADC 2 x 20 The desired output stored in variable A isthen added to the offset value 8000 and then scaled down by a factor of 100 before being sent out physically via PWM Channel 4 Important In actual implementation use a clock pulse such as 0 1s 0 5s or 1s etc to penodically activate the PIDcompute function TR RESEARCH 12 23 INTERNATIONAL Chapter
71. for ID 02 Enter a non zero value in seconds to define its email servicing penod Note Both SMTP Server and email service period definitions will be saved to the hard disk when you exit TLServer program They will be reloaded when you start TLServeragain Inactive PLC TLServer attempts to communicate with every PLC that has a non zero email service penod However if the PLC is inactive e g It has not been tumed ON or has been disconnected from the server the communication will fail Since communication failure takes considerable amount of CPU waiting time and could affect the normal communication with other active PLCs inactive PLCs are intemally marked by the TLServer shown as Misuiuluisigi message in the email setup dialog and will not be checked according to their defined service perod to avoid repeated communication failure However TLServer will re Ten Resear SR INTERNATIONAL Chapter 4 Using TLServer scan these inactive PLCs every two minutes to check whether they have come on line If an inactive PLC is found to respond to command it will be unmarked and put back in service for its email request Test Email You can also manually force the re scanning of all PLCs by clicking on the Check button once Then scroll to the PLC of interest to check if there isa Susie message Check the PLC communication port winng if there is an error This email service period does not determine how often the PLC
72. formed by its parameter list x y z out of the PLC to other devices via the communication port n Parameters n must be an integer constant of between 1 and 8 Integer value in the parameter list y z will be Converted into the Te ee 12 25 INTERNATIONAL Action Examples Comments See Also Chapter 12 equivalent ASCII representation Each parameter must be separated by the semicolon The ASCII string is first formed by the PRINT statement using all the arguments in the argument list and the completed string is then sent out of the serial channel n at one go The PRINT statement automatically sends a Camage Retum CR ASCII 13 out of the specified seral port after sending out the last character in the argument list A PRINT statement that ends with a semi colon will not send the CR character If you have a long string to send than you can use to break the whole command into several lines with each line ending with a except the last lines PRINT 2 The value of A B A 4B PRINT 2 Units IFA 5 and B 100 the string The value of A B 105 Units and a CR character will be sent out via Comm port 2 In TRILOGI simulation mode the ASCII string will be displayed on a pop up window to simulate PRINT action INPUTS 12 40 PULSEFREQUENCY ch PULSEPERIOD ch PULSEWIDTH ch Purpose Retum in Hz the frequency of the last input pulse Retum in microseconds the width or period of
73. in doubt ask your ISP or System Administrator for help This server must be setup propery before the TLServercan send any email SMTP Port No This is the port that your Outgoing Mail Server will use to send emails The default port number is 25 which is the most common port however some Mail Servers will use a different port and you should check with your ISP or System Administrator if you are not sure Authentication Some ISPs will only allow mail to be sent through their Mail Server if it originates from a trusted IP address typically only the Intemet IP address that the ISP assigns to you If this is the case then you may need to authenticate your IP address if it is different from the one provided to you If you are sending mail from a location registered to another ISP using your Mail Server If your ISP uses Authentication then you will need to check the Authentication box and RESEARCH INTERNATIONAL TR TRIANGLE 4 14 Chapter 4 Using TLServer provide the cormect Auth Usemame and Auth Password If you are unsure about this then you should contact your ISP or System Administrator for help Auth Usemame If Authentication is required you will need to provide the corect Usemame This is provided by your ISP and you should contact your ISP or System Administrator if you don t know what it is or if you don t know if you need it Auth Password If Authentication is required you will need to provide the corr
74. into variable Zin CusFn 101 but used directly in CusFn 102 for changing the Set Value of Timer 1 The setlimerSV statement uses the value of itssecond argument to update Timer 1 s SV accordingly Note that changes to the set value SV will be updated in the program EEPROM memory and is non volatile However EEPROM hasa typical life soan of about 100 000 to 1 000 000 erase write cycle Exceeding this limit will wear out the EEPROM and resulting in a read enor when the PLC operates Hence you should NEVER write a program that excessively changes the set value of the timer or counter e g put it in a non differentiated form of CusFn which executes every scan of the ladder program and continuously changes the content of the EEPROM A2 2 3Using a Potentiometer As An Analog Timer RESEARCH INTERNATIONAL fei TRIANGLE A2 7 Appendix 2 A cheap potentiometer can be connected to the PLC A D input and provide a user adjustable knob asan analog Set Point input device A scale can be drawn around the potentiometer to provide visual indication of set point value Assignment 1 A potentiometer is connected to A D 5 Use it to provide a timing range of Oto 10 00 seconds 2 Pressing the test input tums ON output 1 fora duration determined by the potentiometer reading after that tums output 1 OFF Custom Function 10 HSTIMER 1 Define Timer 1 as High Speed Timer 0 01s base TimerPV 1 ADC 1 1
75. is incorrect hence enabling corrective action to be taken 9 3 Special Functions During ladder circuit editing when you click on the or icon to create a special function coil a special function menu will pop up as shown below Ca TRIANGLE 7 URA RESEARCH 9 8 LAS INTERNATIONAL Chapter9 Selects Function Li 1 DNCtr Decrement Rew Counter 2 RSCtr Reset Counter 3 UpCtr Increment Rev Counter 4 aVseq Advance Sequencer 5 RSseq Reset Sequencer 6 StepN Set Sequencer to Step EN 7 Latch Latching Relay Output 8 Clear Clear Latched Relay 9 ILock Interlock Begin 4 ILoff Interlock End B DIFU Differentiate Up C a DIFD Differentiate Down D CusFn Custom Function E dCusF Diff Up Custom Funcs F MaRST Master Reset 9 3 1 Reversible Counter Functions DNctr Upctr and RSctr The DNctr UPctr and RSctr functions work together to implement reversible counter functions on any of the 128 counters supported by i TRILOGI The ordinary down counter created by clicking on the icon essentia lly decrements the counter value by 1 from the Set Value SV and will stop when its count becomes zero Unlike the ordinary down counter a reversible counter is a circular counter which changes the counter present value PV between 0 and the SV When you try to increment the counter past the Set Value it will overflow to become 0 Likewise if you try to dec
76. mail server whether autheticated or not Your PLCs on the same LAN can then send their email via this TLServer instead of directly to the extemal SMTP server This could be advantages in terms of ease of programming and also should the company decide to change its ISP or SMTP server provider only the TLServer needs to be re configured and the PLCs on the network need not be configured individually to address the change 4 4 2 Configure And Test SMTP EMail Server NEW TLServer version 3 17 offersa whole new look to the Email Setup which has all the same features as before plus a couple of additions including Port No specification optional Authentication and a Test Email function to test the settings you have entered See below fordescriptions of the additions To setup the server to handle email requests click on the Setup Emails button on the TLServer to open the following dialog box Ten Resear 4 13 INTERNATIONAL Chapter 4 Using TLServer E 4 PLCs Email Config em SMTP Mail Server SMTP Port No nail automationmart co 587 Iw Authentication Auth Username Auth Password info automationmart c EEN Port to Relay PLC Email 9025 Email Test l Debug Legacy email feature From TLServer 1 0 Check Every seconds Check Iooooo0c0c cc 0c 0 0000 SMTP Mail Server This will be the same Outgoing Mail Server that you use in your email program such asthe Eudora or Outlook Express If
77. new ID Otherwise the previous ID isretumed Ethemet Connection Status A byte isretumed and each of the first 7 bits representa connection state foran incoming oroutgoing Ethemet connection Bit7 MSB isnot used and can be ignored 6 5 4 3 2 1 State 0 Connection Type Default FSERVER FSERVER FSERVER Note Bit 6 will always represent the PLCs1 client connection outgoing bits 4 and 5 will always represent Modbus TCP incoming and bit 0 will always represent an FSERVER connection incoming Bits 1 2 and 3 can be set to either type view chapter 2 of the PLC user manual for more details By default there are 3 incoming connections foreach type If any bit isset to 1 that meansthe corresponding connection type is being used and isnot available Any bits set to 0 are free to be used available connections Example STA TUS 14 retums 11 gt bits 0 1 and 3are on 12 58 Leg d In 000000 to 235959 TRIANGLE RESEARCH INTERNATIONAL Chapter 12 Comment 2 of 3 incoming FSERVER connections are used 1 of 3 incoming MDBTCP connections are used Note only for PLC with finmmware r78 and above Retum IR Code Specific only to F series PLC with Infra Red decoder Retums the decoded IR remote code See chapter 17 of the user manual formore details Note the SETSYSTEM 17 1 command must be executed first to enable the IR decoder Re
78. points CH St in CH CD CH es a CH gt Co re ka a gL CR We d s ED ER ui TR w I 4 ADC Calib These fields are used to apply a multiplication factor to the value retumed by ADC function The multiplication factor 1 x 10000 Example 1 If you apply 2 500V to ADC 1 on a PLC with 5 000V full scale you would expect the value retumed by ADC 1 to be 2048 But the actual average reading centers around 2060 Proportional Eror 2060 2048 1 005859 Multiplication factor required to corect this emor 1 1 005859 0 9942 1 58 10000 gt x 58 You should therefore enter a value of 58 into the ADC Calib field for Ch 1 and save it to the PLC After the PLC has rebooted the CPU would apply the multiplication factor of 0 9942 to the readings it received which would corect the reading to 2060 x 0 9942 2048 Example 2 If you apply 8 000V to ADC 8 on a PLC with 10 000V full scale you would expect the ADC 8 function to retum a value of 8 000 10 000 x 4096 3277 However your program retumed a value of 3230 from ADC 8 TR RESEARCH 8 32 INTERNATIONAL Chapter8 Proportional Error 3230 3277 0 985658 Multiplication factor required to corect this emor 1 0 985658 1 0146 1 146 10000 gt x 146 To compensate for this emor enter a value of 146 in the ADC Calib for Ch 8 and save it to the PLC After the PLC has rebooted the CPU would app
79. relay 1 LOAD_EEP 10 A LOAD_EEP 2 DM 32 1 LOAD_EEP32 10 A LOAD_EEP32 2 SAVE _EEP 12 30 LOAD _EEP addr Note Purpose Examples Comments See Also CA v TRIANGLE URA RESEARCH LAS INTERNATIONAL Applicable to all Nano 10 FMD Series and F series but only to the legacy TLOOMD MX PLC with firmware r44 or higher This function retums a string previously saved into the PLC s intemal data EEPROM using the SAVE _EEP command X Load_EEP 5 FORI 1to 5 I Load_EEP I 10 NEXT 1 String saved in EEPROM string location 5 is loaded into X 2 Strings saved in EEPROM string locations 11 to 15 are loaded into A to E 1 to 5 represents A to E SAVE EEP for explanation of how the data EEPROM area are organized in these PLC sto provide storage area for both integers and strings 12 19 Chapter 12 12 31 LSHIFT i n Purpose Examples Comments See Also To shift 1 bit to the left the integer variable i which must be either an integer vanable a DM n ora system variable such asrelay n output n etc LSHIFT instruction permits more than one vanable to be chained together before performing a bit shift The parametern indicates the number of channels to be chained starting from i upward n 1 if only one variable is involved LSHIFT rela y 2 3 The relay channels 2 3 and 4 which represent relays number 17 to 64 are chained together in the following
80. request it doesnot need to be linked to the TLServer all the time only when it needs to request a service from the TLServer This makes it possible for a remote PLC to connect to the TLServer via the telephone line and modem to perfom the required file or email services then disconnects itself from the TLServer so that other PLCs can take tums to connect to the TLServerto request for services Note All the files created or used in the wrte append read actionsare located in the directory lt trilogi base directory gt FileService Hence the default path is CA TRILOG TL6 FileService You may also read write files that are located in the sub directory below the FileService directory provided that the sub directory already exists The currently supported filesand emails services are described below 1 Write data to Eg To save data of DM 1 to DM 10 to a file name file testWrite txt execute the following statement from a custom function Format PRINT 1 lt WRITE testWrite txt gt Write data request lt WRIE filename gt FORI 170 10 a ae PRINT 1 DM I REM delimited by space characters lt q gt NEXT PRINT 1 send a CRcharacter PRINT 1 lt gt End of Service request The TLServer will close the file after it receives the end of service tag lt gt from the PLC and it will in tum send a lt OK gt string to the PLC to acknowledge that the WRITE request has been completed successfully It is u
81. set the bit4 amp 5of data E g SETSYSTEM 1 amp HFF This will change all 4 COMM ports to wait for 4 cycles 0 60s for serial port and 0 80s for PLCs with finmware r77 or TRI De be INTERNATIONAL Chapter 12 higher For TLOOMD and T1LOOM X 1 data d is applied to all 3 COMM ports simultaneously and can be any value from 0 to 255 e g SETSYSTEM 1 3 The PLC will wait 3 x 150ms 450ms for a valid response from the slave controller on all 3 serial ports 12 64 2 Number of Com Retries of retries if NETCMD READMODBUS WRITEMODBUS READMB2 or WRITEMB2 failed to get a valid response from slave controller For Nano 10 FMD and F series PLCs 2 dd dd dd dd SETSYSTEM 2 data affects the 4 COMM port individually COMM4 is Ethemet client connection where bitO amp 1 for COMM1 bit 2 amp 3 for COMM2 bit 4 amp 5 for COMM3 and bit 6 amp 7 for COMM4 By default data is set to QHAA binary 10 10 10 10 This means 2 re tries a total of 3 tries forall4 COMM ports data dd dd dd dd Comm port 4 3 2 1 Where dd 00 01 10 or11 maximum 3 re try In orderto change the number of retries for COMM2 to 1 retry you have to set the bit 2 amp 3 of data E g SETSYSTEM 2 amp HA5 binary 10 10 01 10 The above example set COMM2 to 1 retry and the other 3 ports are 2 retries gt d For TLOOMD and T100MX Tri RESEARCH 12 47 INTERNATIONAL gp ZE In TRIANGLE RESEARCH INTERNATIONAL Chapter 12 dat
82. software and they do not necessarily emulate a standard PC COM port propeny They also demand quite a bit of CPU power to process the communication propeny Therefore these type of modems may not work too well with the TLServer If your built in soft modem does not work propery with TLServer you should get an extemal PCMCIA card modem and these are quite inexpensive nowadays and they will work much better with the TLServer modem support function To setup TLServer to dial a modem first close the active COM port by clicking on the Close Port button Select the COM port where the modem isconnected to you can find out the which COM the modem is connected to by checking the Control Panel gt Modems gt Properties Click to select the Modem checkbox You will then be able to entera telephone number to dial The 3 buttons Connect Hang Up and Special become enabled when you select the Modem mode Note that the Baud Rate field now becomes the DIE speed which specify the line rate between the PC and the modem this has nothing to do with the actual baud rate between the modems which will be automatically negotiated based on the quality of connection Normally you should leave the DTE speed set to the highest value 115200 unless your modem manufacturer specifies otherwise The PLC can be operating ata different baud rate from the PC to modem line rate because of the modulation dimoduation action of the modem Important The PL
83. space Byte Word and Long Word Addressing Note that the FRAM space for 8 bit 16 bit and 32 bit SAVE EEPXX and LOAD_EEPXX commands are the same space and they are mapped as shown below SAVE_EEP32 SAVE _EEP16 SAVE_EEPS land 2 123 amp 4 3 and 4 5 6 7 8 2N 1 amp 2N 4N 3 4N 2 4N 1 4N If you intend to use the EEPROM FRAM space to store more than 1 type 8 16 or 32 bit of data then you must propery manage the EEPROM FRAM data space reserved for storing each type of data so that they don t overwrite each other address pace The easiest way is always to reserve enough space for 32 bit data followed by space reserved for 16 bit and or8 bit data E g If you have 6000 words 16 bit of FRAM space this means you have space for storing 6000 2 12000 bytes of 8 bit data and you only have 6000 2 3000 long words for storing 32 bit data Now assume that your program needs to store up to 500 x 32 bit data and the balance for storing 8 bit data If you reserve 500 long words for 32 bit data that means you are using up 500 4 2000 bytes of the FRAM space This leaves you 12000 2000 10000 bytes of FRAM space for storing 8 bit data starting from byte address space 2001 to 12000 Please refer to your PLC s reference manual for the upper 12 33 Parameters data addr Examples See Also Chapter 12 limit of available FRAM EEPROM storage May be an integer constant orvanable
84. the I O Table label namescould only be 10 characters but i Trlogi 6 2 and up allows label names of up to 16 characters see the IOTable section for more details It is now possible to print an I O Table with label names up to 16 Characters and still fit all of the information within the page width The only difference is that Relays 257 to 512 will be printed on a second page to provide more room Export the I O Table Now you can export the I O Table to a csv file that can be opened by any program that has csv compatibility If you use Microsoft Excel you can open TRI RESEARCH 8 7 INTERNATIONAL Chapter8 the csv file and the I O table contents will automatically be displayed in an Excel spreadsheet This provides limitless possibilites for printing the contents of the I O Table and for integrating them into other documents To export the I O Table just choose the O Tables option from the Print Control Panel and click on the WAN button asshown in the Print Control Panel below You will then be prompted to save the I O Table asa csv file e Print Control Panel Sa ge e II e D i Print Page setup Print Preview Print O Tables From 1 To 256 Export NOTE You can select the range of I Os you want to export to a csv file just like you can select the range of I Os you want to print Export Custom Functions Now you can export custom functions to a txt file that can be opene
85. the PLC will be left in PAUSE state if a program transfer has been aborted to prevent execution of an incomplete program NOTE The Program Transfer window is now wider to accommodate file names with longer strings and or in other languages IMPORTANT For Nano 10 FMD88 10 and FMD1616 10 PLCs If your program is using any timers or counters you must click Reset or Reboot when the program transfer is complete so that the set values are properly stored to FLASH memory in the PLC If you click on Close instead the set values would not be retained and would be lost when PLC power is tumed off or cycled unless the bei Wegen 8 15 INTERNATIONAL Chapter8 program executes a RESET or SETSYSTEM 252 0 command first This is nec essary whether ornot any FRAM RIC module is installed Referto the Program Transfer section for procedure details 8 3 5 Transfer CO5 File To PLC This new command is added from i TRILOGI version 6 41 onwards It lets you transfer a file that has been saved previously to the hard disk using the File gt Write Compiled Code To Disk function under the File Menu Using this function you can send compiled code to other users to be transferred into the PLC using a licensed copy of i TRILOGI v6 41 and above but without revealing your source code To ensure that the file is not conupted when you email to others try to compressit using a Zp or Rar software 8 3 6 Open Matching Source File
86. the TLServer on your PC and configure the PC s serial port to work with the PLC s serial port The configuration tool will connect to the PLC indirectly via the TLServer software Click here for more details about TLServer If your i TRILOGI is not yet connected to a TLServer software or directly to the PLC built in hostlink command server known as F Server in the Nano FMD or F series PLCs then when you try to calibrate the PLC you will see the login popup windowsasfollow Login To TLSever Server s IP Address port 492 168 1 5 9080 _Detect ID 1 PLC Only ID Hex C localhost 127 0 0 1 9080 Use Http Proxy Server Username Password Iw Memorize Username amp Password Cancel OK omen V TRIANGLE 8 40 LURR RESEARCH L INTERNATIONAL Chapter8 If you are connecting to the PLC via TLServer that runs on the same PC asi TRILOGI then simply select the localhost 127 0 0 1 9080 to connect to TLServer If you are connecting to the PLC s F server the IP address of the PLCs and the port number should be entered in the Server s IP Address Port field and select the corresponding radio button The default settings for the Ethemet port are IP 192 168 1 5 and port 9080 with no usemame and password required Same as shown in the screenshot above Once you have entered the corect login information click on the Detect ID button and wait forthe PLCsID to populate in ID box 01 is the default ID
87. the defined home postion 12 70 STEPMOVE ch count r Purpose Parameters ch gp ZE URA TRIANGLE RESEARCH INTERNATIONAL To activate the PLC s built in stepper motor pulse generator channel ch to output count number of pulses The speed and acceleration parameters for the motion is defined by the SIEPSPEED statement on the same channel ch which must be executed at leat once before the firt SIEPMOVE command is issued After executing the SEPMOVE command the PLC hardware will take over the actual pulse generation operation The users program will continue to execute even though the pulse generation is not yet completed The intemal relay r can be used to signal to the other parts of the ladder program regarding the status of pulse generation as follow Stepper Channel Range 1 to 8 12 61 count r Comments Important ae TR d TRIANGLE RESEARCH INTERNATIONAL Chapter 12 Step Count Range 22 to 231 Move Complete Relay Bit Range 1 to 512 When STEPMOVE command is first executed the intemal relay r will be cleared before the first pulse is sent After the completion of the movement i e when all the pulses have already been sent the relay r will be set Count isa 32 bit integer number which allows you to program the stepper motor to move from 231 to 23 Le about 2 x 102 steps Count can also be an integer vanable A Z However if you use a 16 bit variable suc
88. the ladder logic special functions are related to the use of the sequencer These are described below 1 Advance Sequencer AVseq Increment the sequencers step counter by one until it overflows This function is the identical to and hence interchangeable with the UpCtr function 2 Resetting Sequencer RSseq The sequencer can also be reset to become inactive by the RSseq function at any time Note that a sequencer that is inactive isnot the same assequencerat Step 0 as the former does not activate the SeqN 0 contact To set the sequencer to step 0 use the StepN function described next 3 Setting Sequencer to Step N StepN In certain applications it may be more convenient to be able to set the sequencer to a known step asynchronously This function will set the selected sequencer to step N regardless of its current step number or logic state The ability to jump stepsisa very powerful feature of the sequencers 4 Reversing a Sequencer Although not available as a unique special function a Sequencer may be stepped backward by decrementing its step counter using the DNctr command on the counter that has been defined as a sequencer This is useful forcreating a reversible sequencerorfor replacing a reversible drum controller 9 4 2 Other Applications a Driving Stepper Motor A sequencer may be used to drive a stepper motor directly A two phase stepper motor can be driven by four transistor outputs of the
89. the replacement PLC will work identically to the orginal PLC 8 3 10 Ethernet amp ADC Configuration This tool which is located in the Controller Menu allows you to configure the Ethemet Port and ADC RIC calibration settings on a TRi s PLC with built in Ethemet port such as the F Series PLCs When the Ethemet amp ADC Calibration is selected you will see the following screen on O Pi em 8 21 INTERNATIONAL Chapter8 Ethemet Configuration BASIC ka IP Add Address L Factory Default Subnet Mask Node N Gateway IP Addr ode Name SMTP SewerIP pot Ss FSewer DNS Server OoOo Number of i IT Connections FServer Port TimeOut ae ee MBTCP Port Secs FTP Timeout s LAN Speed 100Mbps v Username Use username pass word Password eege Yes No AccessLevel 1 Proqrammer e Help Retrieve Parameters from PLC v Reboot PLC after Save Close Note Default settings shown here The configuration tool communicates with the PLC via the same user interface as all other communication functions under the Controller menu This means that the configuration tool will be communicating with the PLC using TCP IP protocol Since only PLCs with built in Ethemet can utilize this function it means that most likely the PLC would be connected to a router or switch with a preconfigured static IP address If your PC is also on t
90. this command is used by an intenupt service function then it is possible to get the system out of the dead loop since the 12 30 Chapter 12 interrupt function can interrupt the dead loop and reset the PLC 12 46 RESTART REBOOT Purpose To perfom a cold reboot of the PLC from within a CusFn The effect is identical to a power on reset except that you execute thiscommand without tuming OFF powerto the PLC Comments RESTART may be necessary for some changes to take effect such as forthe PLC to assume new IP address after executing the SET IP command Note This Command is ignored by i TRILOGI simulator 12 47 RETURN Purpose Unconditionally ends the execution of the current CusFn and retum to the caller which is either the ladder program or another CusFn which has executed a CALLCommand Use of the RETURN statement is optional if there is no conditional ending required After executing the last statement the CusFn will retum to the callerautomatically See Also CALL 12 48 RSHIFTi n Statement Purpose To shift the integer variable i 1 bit to the right i must be either an integer vanable a DM n or a system vanable such as relay n output n etc RSHIFT instruction permits more than one vanable to be chained together before performing a bit shift The parametern indicate the number of channels to be chained starting from i upward n 1 if only one variable is involved Tal Boe 12 31 INTERNATI
91. to change the port number is to use the port forwarding capability of an NAT router so that different F series PLCs may be accessible from the Intemet using the same public IP address of the router but with different port numbers 8 Node Name Mode Mame F server You can assign up to 16 ASCII characters any character in naming a PLC The node name is curently not used by the network router so it is merely a convenient name for user to identify a PLC 9 Usemame and Password FServer only Username g Password You can use the usemame and password feature to prevent unauthorized accessto the FServer It adopts the same propnetary encryption scheme used in the TLServer and i TRILOGI software to encrypt the password transmission However unlike the TLServer that allows you to define unlimited number of usemames and passwords the FServer only pemits a single usemame and password and this is limited to a length of 16 characters 10 Use Usemame Password Yes No Use username passyword D Yes No In applications where there is no danger of unauthorized access to the PLC via FServer you can elect not to use the usemame password With the No option oe V TRIANGLE 8 98 Ir RESEARCH LI Sc INTERNATIONAL Chapter8 selected the i TRILOGI client or Java Applet can log in to the FServer using whatever usemame and password since FServer will bypass the usemame and password authentication
92. two formats if you run the following sample program r RESEARCH INTERNATIONAL Ton TRIANGLE LOO Appendix 2 Clk1 0s En 1 PAA Cusfn Clk1 Os Em 2 LS Custom Function 1 A A 1 Custom Function 2 B B 1 Run the program in simulator and press the lt V gt key to view the changes in the varablesA and B You will see that B is incremented by one every second while A is incremented wildly for 0 5s and then stops for 0 5s Try it It can be very educational If you want to penodically check the status of an analog input or the real time Clock you should use a clock pulse 0 1s 1 0s etc as shown in the example and connect to a dCusF Connecting to non differentiated version would mean checking thousands of times for half the period and not at all for the other half penod certainly not the intended outcome A2 1 3Timers Contact Updating Process All the timers contacts of the PLC like the inputs and outputs are updated simultaneously at the beginning of every ladder logic scan and not at the rung that contains the TIM coil So if you are using self reset timer please note that if a timer times out its contact will be ON from the beginning of the ladder logic rung until the rung that contains the self reset circuit Thereafter the timer contact will be OPEN since the coil has been self reset Hence please note that you should place the self reset timer rung after all the ladder rungs that utilize the
93. usually provides the SMTP server in domain name form such as mail socglobal net but you should also be able to request the numencal IP address of the SMTP server from the ISP Tigi Bae 8 25 INTERNATIONAL Chapter 8 For Windows XP or Vista users you can resolve the IP address as follows First launch the Command Prompt window Then enter the command nslookup lt smtpserver name gt to get the IP address An example is shown below where the IP address of mail socglobal net is resolved to the IP address 207 115 36 120 ER Administrator Command Prompt 0 X gt nslookup mail sbcglobal net Server pd2nsc3 st vc shawcable net Address 64 59 144 92 Non authoritative answer Name mail sbcglobal net Address 207 115 36 126 KK Windows users may also search the Intemet fora free host exe tool that lets you resolve the IP address from a given domain name one host exe tool that we found to work was downloaded from hittp pigtail net LRP dig For example executing the command line host mail socglobal net will resolve its IP address Of course you can only use this smtp server provided your ISP is SBC almost no SMTP server will relay emails from a client that is not one of its own subscribers If you do not plan to use the FServer to send out emails yet then you can leave the default SMTP Server IP Address 0 0 0 0 You can change the settings anytime later when you need i
94. was left open 5 The PLC program is not using the serial port If the PLC program is trying to send data out of the seral port then it will Comupt communication attempts from TRILOGI TLServer and would not work It is possible to pause the PLC using DIP Switch 4 on the blue switch box that is physically located on the PLC Note that it is jumper J 4 for the Nano 10 PLC The PLC should be power cycled after being paused which will bypass any program initialization function that could affect the default PLC communication settings TLServer can be set to the default com settings 38 400 bps 8 data bits 1 stop bit no parity and communication can be reattempted Refer to chapter 1 8 1 of your PLCs user manual for more information on this If Communication is still not possible at this point please contact tech support by phone at 877 874 7527 or by email at support tn plc com M Ton RESEARCH AS INTERNATIONAL Appendix A Appendix 4 A 4 PLC to Modem Communication Setup CA v TRIANGLE DA RESEARCH INTERNATIONAL Appendix A A 4 PLC to Modem Communication Setup A remotely located Nano 10 FMD senes or F series PLC can be connected to a host PC via public switch telephone network PSIN radio or cellular phone network This can be accomplished by using two analog modems one connected to the PLC s RS232 serial port and another modem connected to the remote host PC as follow Public Telephone Network
95. when the TL6 application re starts Each user has his own exclusive directory for storing his i TRILOGI files Once authenticated a network file dialog will be opened for you to select a file delete a file orcreate a subdirectory asshown below GC TRIANGLE S URA RESEARCH 8 2 LAS INTERNATIONAL Chapter8 Open files stored at TLServer Clock PC6 FileService_Modem HMI I 7000 ladderExamples Analog Timer PC6 backup 001 backup 002 backup 003 Blank pc Call pc Clock PC6 ClockPulses pc CRC16 PC6 Demo Protected pc Simply double click on the desired file or select the file you wish to open and click the Open button to open the i TRiLOGI file Sub directory The MKDir button allows you to create a sub directory on the server to organize your files Subdirectory names always end with a character If you open a subdirectory its contents will be displayed in the file window To retum to the parent directory from a sub directory you simply double click on he AIT stet 8 1 4 Save As TLServer 3 Use this command if you wish to save the curently edited i TRILOGI file to the TLServer 3 x using a different filename You will be prompted to enter the Usemame Password and the IP address if it isa TL6 application to gain access to TLServer Once authenticated the network file dialog similar to that described in Open TLServer 3 will be opened for you to enter a file name or select a filename t
96. whole ladder logic program all I O tables and all the custom functions to the disk The current file will be saved to the same source from which it wasopened from i e If a file has been previously opened from the TLServer via the network this command will save the file back to the TLServer Likewise a file opened from the local harddisk will be saved automatically to the local harddisk 8 1 3 Open TLServer 3 lt Ctrl O gt This command is for loading a i TRILOGI program file xxx PC 6 from the TLServer version 3 x or later Due to the need to use Unicode in the network stream to handle Unicode based PC6 file this function on TL6 can only work with TLServer 3 x and above Since TLServer 2 x does not support Unicode network stream this function will not work with TLServer 2 x If you attempts to execute Open TLServer 3 and put in the IP address of a running TLServer 2 x or ea rier TL6 will complain that the TLServer is not running or unsuccessful connection to TLServer When selected you will be prompted to enter the Usemame and the Password to gain access to the TLServer the same Usemame and Password must have already been defined in TLServer for this to work If you are running i TRILOGI as a local application instead of asan applet you may be required to enter the P Address port of TLServer in order to connect to TLServer Note that last entry of IP Address port is saved to the TL6 configuration file and will be loaded
97. 0 12 to 10 0 seconds FOR I l to 4 DM 1OO I ADC I 40 NEXT setLCD 1 1 1 STRS DM 101 10 STR DM 101 MOD 10 setLCD 1 9 2Z STR DM 102 10 STR DM 102 MOD 10 100 Set_Time x setLCD 2 1 3 STR DM 103 10 STR DM 103 L setLCD 2 9 4 STR D M 104 10 STR DM 104 MOD 10 lt lt lt IL gt gt gt L Rename CusF b View Other CusFn v r Click Continue button or PAUSE button in the simulator screen to continue Keyword Helps v Undo Abort Program stops at defined break point feel Define Toggle Breakpoint Send Brk Pts to PLC View Var Continue 10 2 1 Split Pane Window The upper pane is used asa text editor for writing TBASIC code and the lower pane can either display information about Tnhangle Research as shown above TR RESEARCH 10 2 INTERNATIONAL Chapter 10 or provide immediate help for any TBASIC keyword as shown below To use the lower pane for help on TBASIC keywords simply select the keyword from the Select Keyword drop box or highlight the text in the editor For Example in the following screenshot the code SETLCD is highlighted and the syntax for SETLC D would be displayed asit isin the screenshot KS Custom Function 1 EventCount Sle ee ee Initial value of X
98. 0 21 INTERNATIONAL Chapter 10 10 6 On line Monitoring of TBASIC Variables If you execute the On Line Monitoring Control command from the Controller pull down menu i TRILOGI will continuously query the PLC for the values of all their intemal varia bles These variables values will be updated in real time in the View Special Variables window as described in Section 5 2 You may also alter the value of any vanables in the PLC using the Edit Varnable window by Clicking on the Edit button at the View xxx Vanables window This ability of i TRILOGI to provide instant and full visibility of all the PLC s intemal variables greatly facilitates the programmers debugging process The ease of programming offered by the i TRILOGI programming environment is really what really sets the Nano 10 FMD series and F Series PLCs apart fom many other PLCs 10 6 1 PAUSE and RESET of Target PLC During On Line Monitoring if the View Special Vanables window isopened you can still reset the PLC s intemal data by pressing the lt Ctr R gt key The PLC can also be halted by pressing the lt gt key A halted PLC can subsequently be released from the halted mode by pressing the lt P gt key again You can also change any intemal vanable data using the Edit button on the View Vanable screen 10 6 2 Using LCD Display for Debugging You should take advantage of the built in LCD display port of the PLC to display intemal data at the lo
99. 000 4096 Set the timer running with value proportional to A D value Comment To take full advantage of the resolution of the A D converter the timing range of 0 10 seconds is more finely divided when timer is defined as high speed timer using the HSTIMER command The time base is now 0 01s This means that for maximum value of 10 00s the timer should count down from 1000 The next statement in CusFn 10 computes the ratio of the A D input with respect to its full scale value of 4096 and multiplies it to the maximum timing value of 1000 Le if the potentiometer wiper is at half way the A D reading will be around 2048 the computation will results in a timing value 2048 1000 4096 500 or 5 00 second Note that TRILOGI 6 x does not support floating point arthmetic Hence the multiplication must be camied out before the division Otherwise if you compute 2048 4096 1000 the result of the integer division of 2048 4096 0 and the whole expression yields a 0 which is cleany wrong CT TRIANGLE S Lied RESEARCH A2 8 LAS INTERNATIONAL Appendix 2 The timer 1 s Present Value P V register is loaded with this number which will start the timer countdown In the next logic rung the timer coil connected to the latched OUTI is necessary to prevent the timer from resetting itself But It will not overwrite the PV with its own Set Value SV which will not be used atall in this case This is because the previ
100. 10 Expression D Az B C 11 Expression2 BS AS Extension 12 Expression3 If DM 1 DM 2 DM 3 1111 ENDIF 13 E FOR 1 TO 1000 DM I 2 X X 1 CALL 2 NEXT fz The following explanations will reference the above example define table a Creating Vanable Definitions It is possible to define label names for any variable available in TRILOGI The following results willhappen based associated program code b Creating Constant Definitions It is possible to define label names for constant values The following results will happen based associated program code TRILOGI Pogram Code Pest A A Numberl A would contain its current value plus 1 DM Numberl 2 DM 1 would equal 2 c Creating Expression Definitions It is possible to define label names for entire expressions or code snippets The following results will happen based associated program code Ti ees 11 9 INTERNATIONAL Chapter11 TRILOGI Pogram Code Peak O D would equal A B C FA 1 f A equals 1 Expression3 will execute and the Expression3 following code will run ELSE B 1 if DM 1 DM 2 DM 3 1111 ENDIF ENDIF If A doesnot equal 1 B will be equal to 1 Long_Expression The following code would execute FOR I 1 TO 1000 DM I 2 X X4 1 CALL2 NEXT 11 3 String Constants Variables amp Operators A string is a sequence of alphanumeric characters 8 bit ASCII codes which collectively fom an entity
101. 12 so that digital control in discrete time can be implemented The PID sampling period dependson the time constant of the system For very slow response processes such as the cooking temperature of a large body of water the time constant is very large and even slower than 1 0 seconds clock may be sufficient Do not use unnecessarily short sampling time because it increases computation time and sows down overall performance of the system 12 37 PiDdef ch Imt P I D Purpose 0 at See D TRIANGLE RESEARCH INTERNATIONAL To set up the parameters for a Proportional Integral and Derivative PID Controller function The function PIDcompute will make use of the parameters defined here for the corresponding channel ch channel number 1 16 Maximum saturation limit forthe computed result ProportionalGain KP Integral Gain KI Differential Gain KD Transfer Function of a PID Controller are defined as follow SEL z KI z G s Kp Kg Kps 1 Porportional Band 1 Integral Time Constant Kp Proportional Gain K Integral Gain All four parameters Imt P amp D can be either 16 or 32 bit integer constants or integer variables For the Imt term the computed controller output value by the PIDcompute function isnot allowed beyond the Imt value i e Imt represents the saturation point of the computed controller output PlIDcompute function implements Integrator anti win
102. 31 to 231 the remaining system vanablesand data memory DM n are all 16 bit vanables which means that they can only store number between 32768 to 432767 However all numerical computations and comparisons in TBASIC are camed out in 32 bit signed integer regardless of the bit length of the varia bles involved in the numerical expression 11 2 1 Integer Constants These may be entered directly in decimal form or in hexadecimal form by prefixing the number with the symbol GH e g 12345678 amp H3EF 1007 decimal If the result of an expression is outside the 32 bit limits it will overflow and change sign Care must therefore be exercised to prevent unexpected result from an integer overflow condition A constant may be used in an assignment statement or in an expression as follow A 12345 IF A 30 2345 123 gt 100 THEN ENDIF TRI DE Ni INTERNATIONAL Chapter11 IMPORTANT 16 bit variables comparison When entering an integer constant using the hexadecimal prefix amp H it is important to note the sign of the intended value and extend the signs to most significant bit of the 32 bit expression E g to represent a decimal number 1234 the hexadecimal representation must be amp HFFFFFB2E and not amp HFB2E Assuming that a 16 bit varnable DM 1 contains the number 1234 and a comparison statement is made to check if the number is 1234 The 32 bit hexadecimal representation of constant 1234 is a
103. 6 file HELP When running i TRILOGI you can get on line help any time by pressing the 41 gt A Help window will open to show you the typical key mouse actions You can also click on the lt More Help gt button to get context sensitive help loaded into your web browser i TRILOGI version 6 x and up now uses the default browser of your computer to display help data If the config tl6 line does not contain the path to an altemative browser in the Browser Path line which it doesn t by default However If you do not want to use the PCs default browser then you ll need to use the Notepad program to manually edit the config tl6 file in the C A TRILO GN TL6 directory For example If you wanted to use Intemet Explorer asthe browser for i TRILOGI you will need to Modify the first line in config tl6 as follows Browser Path C Program Files Intemet Explorer IEXPLORE EXE to match the corect browser path info There isno need to configure the applet browser path since the TL6 Applet automatically uses the same browser in which it was loaded to open the help files Hence the applet does not need to know the browser path atall 5 2 Running TRILOGI Applet Using Web Browser 1 Before you could run the TRILOGI Applet in a web browser make sure that the TLServer 3 0 is already running 2 Next start up your Intemet Browser It should be either an Intemet Explorer version 5 0 or later Netscape Navigator Communica
104. 65535 that needs to be specified on top of the IP address when accessing the FServer from across the network The default value is 9080 which is the same default value used by the TLServer and i TRILOGI client software Please see the i TRILOGI programmer s manual for an explanation of the use of the port number One reason why you may want to change the port number is to use the port forwarding capability of an NAT router so that different F series PLCS may be accessible from the Intemet using the same public IP address of the router but with different port numbers 7 Modbus TCP Secondary Port No MBTCP Port SUER According to MODBUS ORG specifications all Modbus TCP servers must listen on port 502 However Modbus org also permits the device to be assigned a different secondary port number As such the Modbus TCP server will always Ton Bakes ge INTERNATIONAL Chapter8 listen on port 502 for all of its connections by default Should you choose to define a secondary port number then the Modbus TCP server will only listen on port 502 on one connection while the additional connections 1 to a maximum of 4 would be listening on the secondary port You may specify any port number between 1024 and 65535 except for the port number already used by the FServer to be the secondary port number Please see the i IRILOGI programmer s manual for an explanation of the use of the port number One reason why you may want
105. ANGLE S URA RESEARCH 4 9 INTERNATIONAL Chapter 4 Using TLServer Double clicking on an existing usemame opens up the usemame password dialog You can now add password to the Administrator if you wish to prevent unauthorized access to the predefined usemames and passwords There is also a pre defined user named samples with no password where many samples TRILOGI files are stored Add New User Setup Username Password If you select a usemame and then press the lt DEL gt key you can delete the user provided its directory is empty You can use Window Explorer or TRILOGI Application to delete the contents of the users directory first before deleting him her from TLServer 4 3 2 Add New User Clicking on this field allows you to add new users to the system You can add as many usersas you like subject to memory and hard disk limit 4 3 3 Server Port If you click the check box to the left of the Server Port label you can change the default port that the TLServer listens on When the client accesses the TLServer Whatever you define here must be matched by the same port number E g if the port number 8000 then localhost access must be http 127 0 0 1 8000 However if the port number is defined as 80 default port for HTIP server then you can access the server using just the IP address without the port number http 127 0 0 1 4 3 4 What Port Number Should TLServer Use In most cases you Can sim
106. C You can copy a block of circuits from the current ladder program and store them into the clipboard for pasting into another part of this ladder program or into another ladder program file altogther The range dialog box similar to Cut Circuit will appearfor you to enterthe range of circuit to copy 8 2 5 Paste Circuit lt Ctrl V gt When you execute this command the block of ladder circuit which you Cut or Copy into the clipboard will be pasted just before the currently selected circ uit The current circuit number will be adjusted to reflect the change GC TRIANGLE _ Da RESEARCH 8 10 INTERNATIONAL Chapter8 8 2 6 Find lt Ctrl F gt The Find command allows you to quickly locate a ladder logic circuit that contains a particular label name This is useful for searching for the activity of a particular I O in the program The Find command can also be used to search for a keyword in a TBASIC program When this command is executed you will be further prompted to select the options of either searching for a ladder logic label orfinding a text in a Custom Function gt Find Label Control Label Name O00000 Find Find All F2 key select from I O Table Type CusFn Search Text Here Find Ladder element You can enter into the the text field a string that partially or fully matches the label name you wish to locate You can also press the 42 gt key to open up the I O table and pick the label name from the
107. C s firmware version number the maximum of input outputs relays timers and counters supported on this PLC as well as the total amount of program memory available The same info will be disolayed when you try to transfera program to the PLC 8 3 8 Set PLC s Real Time Clock The PLC s real time clock RTC which includes both date and time can be set quickly using this command When you execute this command a dialog box which contains the year month day hour min sec and day of week are displayed for you to enter the value The dialog box is initially filled with value taken from the client s computers own calendar and clock You can change any of the field to the desired values and then click on the Set PLC s Clock button Set Target PLC s Real Time Clock Month Day Year 1 7day fe kb ft Mon fa foo fp Hour M in Sec Set PLC s Clock Cancel The dialog box will be closed after the i TRILOGI has transferred all the data to the PLC You should use on line monitoring to verify that the data has indeed been propeny written into the PLC Note that the Year field is restricted to only between 1996 and 2096 Month is between 1 and 12 Day is between 1 and 31 Hour is between 0 and 23 Min and Sec are between 0 and 59 If you enter an illegal value i TRILOGI will beep and the cursor will be put at the offending text field Correct the mistake and then click on the Set PLC s Clock button again to transfer the
108. C to modem connection must be propeny prepared before you can use TLServer to connect to the PLC s modem You can find more details about this in the PLC to Modem Communication Setup appendix Once you have entered a proper phone number click on the Connect button to start dialing the modem make sure that the Auto Answer check box is not checked If the remote modem is busy or does not answer the call you will see CT TRIANGLE z URA RESEARCH 4 7 LAS INTERNATIONAL Chapter 4 Using TLServer the comesponding enor messages in the response box Click on the Hang Up button anytime to abort the dialing operation If you click on the Special button a special dialog box willappearas follow Special Setup xj You can change the DTE speed by selecting a new value from the choice menu 115200 You can specify a special ATcommand to be sent to the modem dunmmg modem initialization Normally you can leave this field to its default value which is AT amp KO You can also specify a special Call in Password which is only used if the TLServer puts itself in auto answer mode see description later Any incoming connection made by a remote modem must give the correct password upon connection otherwise the connection will be immediately dropped The Call ln password feature is disabled if the corresponding textbox is empty 2 Auto Answer If you select the Auto Answer checkbox and click on the Connect button
109. CING TO THE PLC A1 1 Part 1 Serial Communication Setup Guide 1 CONNECTTHE PLC TO THE PC VIA SERIAL PORT Choose one of the following two options to connect the PLC to your PC Note that if yourPC requiresa USB adapter it should already be installed at this point a Connect via RS232 If you are connecting via RS232 with a USB RS232 adapter follow this diagram Super PLC ER Straight Thru Connect USB RS232 DB9 Cable to PC USB Port b Connect via RS485 H If you are connecting via RS485 with a USB RS485 adapter follow this diagram o_O TRIANGLE _ Ind RESEARCH Al INTERNATIONAL Appendix 1 Super PLC Note The D teminal of the U 485 isconnected to the terminal ofthe PLC R485 port The D terminal of the U 485 isconnected to the terminal of the PLC R485 port 2 POWER THE PLC Now that the communication wiring is setup you can connect power to your PLC Refer to your PLCs installation guide chapter 1 of the respective user manual forinstructions on powering the PLC 3 RUN TLSERVER Start TLServer by selecting TLServer Version 3 1 from i TRILOG 6 in your PCs start menu below top left screenshot or by clicking on the quick launch symbol for TLServer below bottom left screenshot Once opened you will see the PLC Webserver window below right screenshot Open TLServer from Start Menu TLServer Opened Successfully mei i TRILOGI Helps EE i TRILOGI Version 6 4
110. CusFn will be used throughout this manual to mean Custom Functions Up to 256 CusFnscan be programmed using a special language TBASIC TBASIC is derived from the popular BASC computer language widely used by microcomputer programmers Some enhancements as well as simplifications have been made to the language to make it more suitable for use in PLC applications There are foursimple waysto create a new CusFn 1 From the Edit pull down menu select the item Edit Custom Function and select the function number from a pop up CusFn selection table which may range from 1 to 256 The selection table allows you to define unique and easily identifiable names for each custom function Once you have selected the custom function the editor window will open up with the contents of that partic ular custom function 2 You may also use the hotkey lt F7 gt to open up the selection table 3 If you have already created a ladder circuit which connects to either a CusFn or dCusF function both appear as menu items within the Special Function pop up menu then you can easily open up that particular CusFn by double clicking the left mouse button while the highlight bar is at the CusFn or dCusFn Altematively you can open the CusFn by clicking the right mouse button while the highlight barisatthe CusFn or dCusFn 4 You can open a custom function by clicking on the Open CusFn button on the status bar below the pulldown menu 10 2 Custo
111. D function will automatically compute the FCSand append to the end of x and together with the terminator characters will be sent to the other PLC via COMM ch 1 If the target PLC does not respond then this function retums an empty string 2 This function checks the FCS of the response string and if the FCS is wrong it indicates an enor in the serial reception and it will retum an empty string A NETC MD 3 05RI00 To read the Input channel 0 of the PLC with ID 05 connected to COMM 3 of this PLC The response string will be assigned to A If the last character of x isa character NETCMD will send out the string without the character It will not append the FCS and to the outgoing string and it will not send out the camiage retum ASCII 13 character It will also NOT check the response string for FCS This allow NETCMD to be used to interface to third party ASCII devices with different command response formats E g A NEIC MD 3 Hello Word 12 2 Chapter 12 The string Hello Word will be sent out of sral COMM port 3 A will receive the full retumed string without applying any FCS check on the retum string 12 34 OUTCOMM mn Purpose Examples 12 35 Purpose PAUSE This statement can be used to send an 8 bit byte of data x via Comm port n Thiscommand isadded because PRINT n command cannot be used to send out CHR 0 Zero is treated as the end ofa
112. D LocalHost Applet htrm wa TLServer Version 3 1 ei Uninstall i TRILOGI 6 45 buildO1 Internet TRILOGI Server Open TLServer from Quicklaunch PE Copyright c Triangle Research Int l Inc TLSvrLauncher exe Shortcut 2001 2012 AN Rights Reserved Version 3 17 4 TLSERVER COMMUNICATION SETUP Tan RESEARCH Al 2 INTERNATIONAL Appendix 1 Click on Serial Port Setup to open the senal port setup window below screenshot Once TLServer is configured leave it running because it is needed to communicate with the PLC Serial Communication Setup amp Test Co CE fee Port Name X Baud Rate 38400 D Data Bits 8 e Stop Bits 1 e Parity None v Time Out ms 500 Close Port a O Command String Press lt Enter gt to Send Response Strings amp Modem Messages FCS COM3 opened at 38400bps Please close port before changing any parameters Change PLCID Close F1 Help If no settings have been changed in the PLC then the default baud settings shown above can be used You will only need to select the comect COM port from the Port Name field Select the port your USB adapter is installed on If you are unsure check the device manager in your PCs control panel You can see from the below screenshot that the Prolific USB adapter for RS232 is installed on COM so you would select COM6 from the Port Name field Similarl
113. DD PD HHH HH OOOD vd rd m a P e Gn S oo CH CH CH K te 2005 10 21 ZS DGD Edt Close TRI RESEARCH 6 19 INTERNATIONAL Chapter6 14 This screen shows the values of TBASIC vanriablesA to Zand many other data It also providesa simulated 4 lines LCD display that show case the action of the SETLCD statement contained in Custom Function 1 As you can see the value of variable X used in the Custom function is also shown in the vanable section The value of X is converted by the SIR X statement into a string and displayed after the text string Cycle Count at line 1 column 1 of the LCD area Summary We have completed this hands on session and have successfully created a simple ladder BASIC program We have also performed real time simulation to test the program s functionality By now you would probably have a good appreciation of i TRILOGI s superb capability and ease of use and are ready to include i TRILOGI asan integral part of your programming needs TRI DE Se INTERNATIONAL Chapter 7 Chapter 7 i TRiLOGI Ladder Logic Editor CA TRIANGLE URA RESEARCH UN INTERNATIONAL Chapter7 7 TRILOGI LADDER LOGIC EDITOR i TRILOGI s ladder logic editor window lies between the main menu bar along the top of the screen and the help message line along the bottom of the screen The cursor will appear in the window whenever you are in the logic editor The ladder logic editor compnses two mod
114. EEPROM FRAM address fordata storage save_EEP relay 1 100 save_EEP8 relay 1 100 save_EEP16 relay 1 100 save_EEP32 relay 1 100 LOAD EEP GETHIGH16 _ SETHIGH16 LOAD EEP _ and SAVE_EEP 12 50 SAVE EEP strdata addr Note Purpose Parameters strdata addr Implementation CA v TRIANGLE URA RESEARCH LAS INTERNATIONAL Applicable to all Nano 10 FMD Seres and F series but only to the legacy TLOOMD MX PLC with firmware r44 or higher To store a string strdata in the users definable EEPROM address addr fornon volatile storage may be any string constant or string variable FRAM EEPROM address 1 2 3 Please refer to your PLC s reference manual forthe upper limit of FRAM EEPROM space Save_EEP allows you to save strings into the non volatile data area of the PLC which could be FRAM FLASH or EEPROM legacy M series PLCs only This data space is divided into 40 byte chunks for string storage Le regardless of the length of the string each string storage location will occupy a fixed 40 character length Hence if stringdata parameter is longer 40 characters then only the first 40 characters will be stored in the memory space and the remaining characters willbe discarded The string and integer data actually share the same pool of data space However the string spaces are allocated from 12 34 Chapter 12 the top of the data space downward while the integer spacesare allo
115. Hence you can only abort changes to the curently opened custom function before you exit the editorornavigate away to another Custom Function 10 2 8 Define Table ane In previous versions of i TRILOGI it was not possible to define variable names for the A Z DM A Z etc variables However in i TRILOGI versions 6 42 and up a define button hasbeen added to the custom function editor that allows users to create a table of variable and expression definitions for all integer string vanables available in TRILOGI as well as constant values The next section will describe in details how to use the Define Table Toggle Breakpoint 10 2 9 Toggle Breakpoint This new debugging aid feature is introduced since I TRILOGI version 6 45 For more information please referto Section 7 Debugging amp Breakpoints 10 3 Define Table When the above Define button is pressed a table of definitions willopen asa new window as shown by the picture on the left below Only the Label Name and Vanable columns can be edited such that the name you would like to use should go in the Label Name column and the name of the variable eg DM 1 A A etc should go in the Vanable column It is then possible to right click on any of the cells to bring up the list of options shown by the picture on the right below Tri Boss 10 10 INTERNATIONAL Chapter 10 El Label Name V Find Ea Delete Row Copy Row
116. I MAIN MENU REFERENCE 8 1 8 1 Fle Men Ee 8 1 8 1 1 New ER ET 8 2 8 1 2 Save lt lt UHS EE 8 2 8 1 3 Open TLS rer 3 st DH zs 8 2 8 1 4 Save As ILSGIVET 3 EE 8 3 8 1 5 Open Local Drive Save AS Local Drive 0 ccc ecseesseesseecseeceeeceseeeesaesssaessneeaees 8 4 8 1 6 View Protect Un Protect ccecescescceeceeteceeseeeceaneeceneseeeeasseesaseeeesaseeetaesneseaneneeaaeas 8 5 8 1 7 Write Compiled Code to Dik 8 6 8 1 8 NV 8 6 8 1 9 EX ess EAT ieiecducueedteasdaticu les cage calaneets nendanssblsutelasasincessdzeesiaeuslivesssdactile 8 9 8 2 Edit Mier epssreeeegtasgseessespgesrsegguEeegsssEEEEESReEEEEESSEEEEEEESESEEKEEERREEEESEEREEEESEERESRER 8 9 8 2 1 Abort Edt CMC TI 8 9 1 TRIANGLE UR RESEARCH Page v INTERNATIONAL USER MANUAL 8 2 2 Undo C Cu EE 8 10 8 2 3 Cut Ci Ui E 8 10 8 2 4 COPY Circuit CUNAC ET 8 10 8 2 5 Paste Circuit st DIN 8 10 8 2 6 Pad STARS EE 8 11 8 2 7 GOWO ee 8 12 8 2 8 VO Table E 8 12 8 2 9 View 1 0 Type on Ladder E 8 12 8 2 10 Edit Custom Function F EE 8 13 8 2 11 Clear Custom FUNCIONS seciisiiresiniewsaseadiineanapi nai andaian rinnad aiina Aaaa ea daian Naa 8 13 8 2 12 SOE TAB WO U EEN 8 14 8 3 Controller MON sasisiecctcnccsctsccscnstccnssncsscacnscacscsndnnsasansaccnscesssdsasessdessedsnsaicnnan 8 14 8 3 1 Select Controller Cl 8 14 8 3 2 Connect Disonnect tO ener 8 15 8 3 3 On Line Monitoing lt CtAAM gt ee ecsessesseeeseesseescneceeecseeseaeessaesaaeseaesaes
117. I Os in the simulation engine without invoking the simulator Since all I Os whose logic states are tumed ON in the simulator will also be shown as highlight on the ladder diagram this offersa_ way to clear the I Os if it hinders your viewing of the ladder program TR RESEARCH 8 42 INTERNATIONAL Chapter8 8 5 Circuit Menu 8 5 1 Insert Comments Comments are specific remarks used by a programmer to explain varous Charactenstics of a program segment and are ignored by the compiler TL6 allows comments to be freely inserted between circuits Execute this command and the Comment Editor will be opened The comment editor allows you to enter any text you like that best describe the working of the circuit All standard text editing keys including cut and paste are applicable to the Comment Editor In early versions of i Trlogi you would press the lt ESC gt key orclick the E button to close the comment window and automatically save the changes when you had finished editing it i Tilogi 6 2 and higher allows you to save and close the comment the same way as before or by clicking the K button tt is also possible to exit the comment and discard any changes made since it was last opened by clicking on the new ___ Abot button Once a comment has been created it is assigned a circuit number and is treated like any other circuits You can edit it by pressing the lt Spacebar gt when you are in Browse mode altematively yo
118. ID to the PLC If the response string box become too cluttered click the Gest button to clear the response box content The button can be used for computation of the FCS Frame Check Sequence characters from whatever text string you enter in the Command String box In the above example since there is curently a text string 01RVIA in the Command String box clicking on the 2 button will compute the FCS of the string 01RVIA You can then append the computed FCS to the command string to form a complete command string with FCS and send to the PLC 01RVIA4D o 4 2 2 Changing Communication Settings Most likely you may want to leave the comm port settings at their default values 38 400 bps 8 data bits 1 stop bit no parity One reason for changing the comm port settings may be due to the need to change the PLC s senal port to lower values e g for communication via radio using 9600 bps Changes to the comm settings are saved to the TLServer configuration file TLserverl cfg when you quit TLServer One other scenario is when you need to power cycle a M series PLC with DIP switch 4 tumed ON to halt the CPU to disable the Ist Scan pulse The Nano eD TRIANGLE _ URA RESEARCH 4 5 LAS INTERNATIONAL Chapter 4 Using TLServer 10 FMD and F series PLCs will be forced to the default baud rate of 38400 bps with 8 data bits 1 stop bit and no panty when started in pause mode forall 3 serial ports Th
119. ILOGI Setup Guide 4 Next you will see the first step in the installation process that recommends closing open programs Click Next to continue Welcome to the i TRILOGI 6 45 build 05 setup program This will install TRILOGI on your computer It is strongly recommended that you close all other applications you have running before continuing This will help prevent any conflicts during the installation process Click Next to continue or Cancel to exit Setup 5 The next step isto accept the license agreement Click Yes to accept it and continue T TRIANGLE 1 3 ire RESEARCH INTERNATIONAL Chapter1 I TRILOGI Setup Guide f Please read the following License Agreement Use the scroll bar or press the Page Down key to view the rest of the agreement The Internet TRILOGI Application software Software is the copyrighted work of Triangle Research International Inc TRI Use of the Software is governed by the terms of the end user license agreement if any which accompanies or is included with the Software License Agreement An end user is disallowed to install the software unless he or she first agrees to the License Agreement terms Any reproduction or redistribution of the Software not in accordance with the License Agreement is expressly prohibited by law and may result in severe civil and criminal penalties Do you accept all the terms of the preceding License Agreement If you choose No
120. IT n and CTRBIT n so that they may be easily accessed from within a CusFn These I Os are arranged as shown in the following diagram on 2 TRIANGLE 11 4 URA RESEARCH L SC INTERNATIONAL Chapter11 I O numbers 48 33 32 17 16 LUTE mmm Bit INPUT 3 INPUT 2 INPUT 1 OUTPUTS OUTPUTT2 OUTPUTT11 RELAYT31 RELAYT2 RELAYT11 TIMERSIT 3 TIMERSIT 2 TIMERBITT1 CTRBITTS CTRBIT 2 CTRBIT 1 b Timers and Counters Present Values The present values PV of the 128 timers and 128 counters in the PLC can be accessed directly as system vanables timerPV 1 to timerPV 256 fortimers present value ctrPV 1 to ctrPV 256 for counters present value c DATE and TIME Vanables The PLC s Real Time Clock RTC derived date and time can be accessed via variables DATE 1 to DATE 3 and TIME 1 to TIME 3 respectively as shown in the following table DATE HOUR mE MONTH DATE 2 MINUTES TIME 2 DATE 3 SECOND TIME 3 seet een OO O DATE 1 may contain four digits e g 1998 2003 etc DATE 4 1 for Monday 2 for Tuesday 7 for Sunday d High Speed Counters The NANO 10 FMD series and F Series PLCs support High Speed Counters HSC which can be used to capture high frequency incoming pulses from positional 2 TRIANGLE 11 5 Jr RESEARCH Chapter ll feedback encoder These high speed counters are accessible by CusFn using the variables HSC PV 1 to HSC PV 8 All HSC PV n are 32 bit in
121. L 12 22 Purpose Synta x Chapter 12 IF THEN ELSE ENDIF Nesting of IF statement Testing Equality gp ZE URA TRIANGLE RESEARCH INTERNATIONAL To make a decision regarding program flow based on the result retumed by an expression IF expression THEN If the result of the expression is non zero logical true the block of program lines between the THEN and the ELSE statements will be executed If the result of the expression is zero false the block between the IF and ELSE will be ignored and the block between the ELSE and ENDIF statements will be executed instead If there is no ELSE statement and if the result of the expression is false the block of program lines between the THEN and the ENDIF statement will be ignored but execution will continue right after the ENDIF statement Statement blocks within the IF THEN ELSE statement may contain other IF THEN ELSE blocks nesting Note that each IF statement must be ended with the ENDIF statement Otherwise an enor message IF without ENDIF will be reported during compilation Special comparison operators may be used in the expression of the IF statement Only integer expression may be compared For comparison of strings please refer to the STRC MP A B function Equal Not Equal Greaterthan Lessthan Greater than or Equal to Less than or Equal to ATW IATY bi 12 14 Chapter 12
122. L PORT RS232 RS485 2 ETHERNET Wired RJ 45 terminated NOTE There are other indirect ways to physically interface to the PLC such as serial Ethemet radio serial Ethemet modem wireless Ethemet bridge XBEE radio and others Many of these are described further in subsequent sections of this document independent documents or the individual PLC reference manuals Software Interface The i TRILOG I programming environment client is required to interface to the PLC for programming and online monitoring whether the physical connection is serial or Ethemet but the server could be either TLServer or the FServer depending on the PLC model and type of connection 3 1 Physical Connection Three methods of physical connection to the PLC are described here Senal RS232 Serial RS485 and Ethemet Ca TRIANGLE URA RESEARCH 3 1 LAS INTERNATIONAL Chapter3 3 1 1 Serial Port All TRi Super PLCs have at least one R485 port and all but the Nano 10 have a RS232 port Either of these ports can be used to connecta PC to the PLC for programming or monitoring RS232 TRi Super PLCs with a DB9 serial port 9 pin connector can interface via R5232 directly to a PC if it has the same type of port or indirectly through a USB port Mos modem PCs now only have USB seral ports so this would be the only option For USB connection you will need a USB to RS232 adapter that plugs into the USB port of a PC and the DB9 seral port of
123. LOGI programming software It is described in more detail in Chapter 2 Introduction to i TRILOGI Client Server Architecture TLServer is not needed for TCP IP communication to the PLCs Ethemet port only forseral communication 1 First you will need to start Server which can be done from the start menu or quick launch See section 1 5 Run TRILOGI and TLServer for more details on starting TLServer The below left window will open Oo gt TRIANGLE TRY RESEARCH 3 5 INTERNATIONAL Chapter3 2 4 4 Serial Communication Setup amp Test o E Port Name 8 5 v Baud Rate 38400 v Data Bits 8 v Stop Bits 1 v Parity None v Time Out ms 500 Close Port O ia Ai PLC WebServer co IS aa Command String Press lt Enter gt to Send Internet TRILOGI Server IP Address1 192 168 1 141 9080 Response Strings amp Modem Messages FCS e Serial Port Setup COM3 opened at 38400bps e Please close port before changing any parameters Configure Users Setup Emails Copyright c Triangle Research Int l Inc 7 2001 2012 All Rights Reserved 4 j Help Version 3 17 Change PLCID Close F1 Help Next you need to configure the sral port settings by clicking on Serial Port Setup and the above rght window will open The default seral port settings are as follows Baud Rate 38400 bps Data Bits d 8 Stop Bits 1 Parity
124. M A 8 5 where A and Bare integer vanables A comment can also be o amn TRIANGLE 3 R RESEARCH INTERNATIONAL Chapter11 appended to DM varnables as follows DM 1 Curent_status of _producti refersto variable DM 1 Starting from version 6 45 the DM 1 to DM 4000 can also be used as 32 bit variables DM32 1 to DM32 2000 in the following manner DM 1 amp DM 2 DM32 1 DM 3 amp DM 4 DM32 2 DM 2N 1 amp DM 2N DM32 N If you require lots of 32 bit variables it may be simpler to use only the DM32 and not the 16 bit DM If you mix the use of both DM and DM 32 then you need to manage the memory propery to ensure that they don t overwrite each other memory space The simulator fully support the use of DM32 variables in any expression However for the actual PLC only those with firmware r78 supports DM32 variables PLC with older firmware cannot directly use DM32 in the program Eg DM32 100 DM 1 A System variables These are special integer vanables that relate to the PLC hardware which will be described in the next section 11 2 3 System variables NOTE All of the following System Variables can have comments appended to them with the same format asdescribed in section 5 Integer Variable Comments a Inputs Outputs Relays Timers and Counters Contacts The bit addressable I Os elements are organized into 16 bit integer variables INPUT n OUTPUT n RELAY n TIMERB
125. MANUAL TABLE OF CONTENTS Page 1 I TRILOGI 6 SETUP GUIDE 1 1 11 Introduction to the i TRILOGI Program sessteesee seen 1 1 1 2 Download the Latest Version of I TRILOGI ssssssunsnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 1 1 13 Install Java Run Time Enviroment RE LA 3 19 erreeEEREEREEEEEEEEEEREEEEEEuER 1 1 1 4 Install PRILOGI 6X ssissiscssts isdcs cccsase es ccnes canes caatsaacasassensatansancansaisenssiansnenceeaass 1 2 1 5 Run TRILOGI and TLServer ssssssnsssnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnmnnn nnan 1 8 1 6 Using TRILOGI 6 x with Intemational LanguageS s ssssssssssnus1usu 55 1 9 2 INTRODUCTION TO I TRILOGI CLIENT SERVER 2 1 2 1 Client Server Arc htec tUre ssssssnnsnennsnennnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnmnnn nnana 2 1 2 1 1 Glet narastania Dese de dee Eege 2 1 2 1 2 e EE 2 1 2 2 i TRLOGI Client Software VersioOnS s sssennsenunnnunnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 2 2 2 2 1 JAVA Applic atO M msie eriaren ennie a aaaea a aana Rai 2 2 2 2 2 Fava TE 2 2 2 3 i TRILOGI Application vs Applet Which is Better sssssnsssunnsnnnnnnnnnennnnnnnn 2 3 3 INTERFACING TO THE PLC 3 1 3 1 Physical COnnecton s s ssssssssennsennnnennnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn mnnn nnnn annnm nananana nanan 3 1 3 1 1 Sena PO ME naria a aa aaa a E a E i e AE A aaa a Ra ai aE dR 3 2 3 1 2 Ethe me tonia EE EE 3 3 3 2 Software ALE 3 5 3 2 1 Server Set P EE 3 5 3 2 2 TRiLOGlCommunkaton ianiai aaan
126. MER D sepegeusgeteeekgereegEageguEeEeSEEEESEASESEEEESKSSEEEEESEEEEKEESEEEEEEREEEEEEEEEEN 12 10 12 19 I2C_READ i2cslave dmstart Court vssEEEEEREEEEEEEEEEEEEEEEEREEEEEEEEREEEEEEE 12 11 12 20 P O O E E 12 12 12 21 I2C_WRITE i2cslave dmstart COUNt ssssssssennnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 12 12 12 22 IF is THEN lt lt HSE Te TN 12 14 12 23 INCOMM C E 12 15 12 24 INPUT C h sesiisssscstciccssincnnaccastsnancscsntnscndandnaesennastseesednnnscasesdanascsanndanuaweaienanes 12 15 12 25 INTRDEF ch fn men eEdge ssssssssssnnsennnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnmnnn nanna 12 16 12 26 INTRO FF ME 12 16 12 27 LEN XG EN 12 17 12 28 Il pA asuuaaaessacasaasaasansesavsanmsasancaaees 12 17 12 29 LOAD EEP addr LOAD _EEP8 addr8 LOAD EEP16 addr16 LOAD _EEP32 addr32 12 18 12 30 LOAD EEP addr EEN 12 19 12 31 Bea a EEN 12 20 12 32 MIDS ON 12 20 12 33 NERC MDS ch el sseusessgguseessseekegeseeerEeRuEEEASESEEEEEASEEOEHERSEEENERESEEEEENE 12 21 12 34 OUICOMM N SG sacancescsaceatnaccascsatendsaceaacacaassecasanaacnacaansnanantsaasecesnasaccstansens 12 22 12 35 PR SE EN 12 22 12 36 Beeopstetch Egegesgteegsesegeggerseiegereert eres eegduEegeeEEeRaEEEEaeEegeeEN 12 22 12 37 PiDdef ch Imit P ss 12 24 12 38 PMON ch PMOFF ch sssoseeesegsgeussesggeuesksEuEEASeEEEKRASEEEEEESSEEEEEEREgEEREAE 12 25 12 39 PRINT N X Yy Z SHAMIM EN 12 25 12 40 PULSEFREQUENC Y c h PULSEPERIO D c h PULSEMDTH Ch sssesses 12 26 12 41 READMODBUS
127. Note Purpose Examples CA v TRIANGLE URA RESEARCH INTERNATIONAL Applicable to all Nano 10 FMD Series and F series but only to the legacy TLOOMD MX PLC with firmware r44 or higher This function retums the computed CRC16 for a range of integers starting from variable var with the range indicated in the parameter count CRC16 is a 16 bit version of Cyclic Redundancy Check a popular mathematical formula forchecking erorina data stream DM 100 CRC16 DM 5 8 X CRC16 RELAY 2 4 12 4 Comments 12 10 Purpose DELAY Example Comments 12 11 Purpose gp a TRI EXIT TRIANGLE RESEARCH INTERNATIONAL Chapter 12 CRC16 for DM 5 DM 6 DM 12 will be assigned to DM 100 CRC16 for RELAY 2 RELAY 3 RELAY 4 RELAY 5 will be assigned to X n To provide a time delay of n millisecond to the process DELAY 100 Provide a 100 ms 0 1s delay to the current custom function It is important to note that this is a brute force delay method and only to be used with caution When a DELAY function is executed the CPU waits at the statement until the penod specified by the delay is over This means that all the remaining ladder programs and other custom functions will stop responding to changing input conditions only system services seral input countdown timers and host link commands etc as well as interrupt driven CusFns will work during the pernod of
128. ONAL Chapter 12 Examples RSHIFT rela y 2 3 Comme See Also 12 49 Note Purpose Comme d In nts The relay channels 2 3 and 4 which represent relays number 17 to 64 are chained together in the following manner RSHIFT 15 o 615 0o 15 0 Relay 4 Relay 3 Relay 2 Bits are shifted from the upper channel towards the lower channel Bit 0 of Relay 4 will be shifted into Bit 15 of Relay 3 and so on Bit 0 of the lowest channel Relay 2 will be lost LSHIFT SAVE_EEP data addr SAVE_EEP8 data addr8 SAVE_EEP16 data addr16 SAVE_EEP32 data addr32 SAVE_EEP8 SAVE_EEP16 and SAVE_EEP32 are only available on PLCs with fimware gt r78 SAVE EEP is equivalent to SAVE_EEP16 and isavailable on all firmware versions To store an 8 bit or 16 bit or 32 bit integer in the users definable EEPROM FRAM space at address addr8 addrl16 addr32 for non volatile storage nts SAVE _EEP8 If you attempt to save a 32 bit data only the lower 8 bits will be saved SAVE _EEP SAVE EEP16 To save the entire 32 bits of data TRIANGLE z RESEARCH 12 32 INTERNATIONAL gp ZE URA TRIANGLE RESEARCH INTERNATIONAL Chapter 12 a If your PLC firmware is lt r78 then save the upper 16 bit using the GETHIGH16 function and the lower 16 bit directly in two separate locations b If your PLC firmware is gt r78 use SAVE EEP32 command to save 32 bit variable to the EEPROM FRAM
129. One convenient feature implemented in TRILOGI Version 6 4 and higher is the ease of getting help forthe syntax of a known TBASIC keyword E g if you want to find the syntax for the keyword READMODBUS instead of navigating through the help file links you can simply select the READMO DBUS keyword in the custom function editor and you will be immediately presented with the help content for the READMO DBUS command as illustrated in the following screen shot pT 1 MBREAD e e EISE READMODBUS ch DeviceID address Rename CusFn View Other CusFn Purpose Automatically query a MODBUS ASCII device and return the 16 bit register data using the MODBUS ASCII protocol The communication baud rate is the default Keyword Helps baud rate of that COMM unless it has been changed by the SETBAUD command A Undo Abort ch PLC COMM port number 1 8 Define DevicelD device ID ofthe MODBUS device 1 to 255 Toggle Breakpoint address offset address ofthe holding register in the MODBUS device _ Send Brk Pts to PLC Examples relay 3 READMODBUS 3 5 101 a ee l TR RESEARCH 8 45 INTERNATIONAL Chapter9 Chapter 9 Ladder Logic Language Reference GC TRIANGLE URA RESEARCH L NO INTERNATIONAL Chapter 9 9 LADDER LOGIC LANGUAGE REFERENCE 9 1 Ladder Logic Fundamentals Contacts Coils Timers and Counters 9 1 1 Contacts Ladder logic programs mimic the el
130. PLC intemal timers without changing the source program A TBASIC function can be written easily to make use of a few digital or analog inputs to modify the SV of these intemals timers should be between 1 and 128 12 39 Value Examples Comme See Also nts Chapter 12 should be between 0 and 9999 SetC trSV 10 1234 SetTimerSV 3 GetTimerSV 3 10 Counter 10 willassume_ a SV of 1234 S V of Timer 3 will be increased by 10 For F series PLC the new SV is stored in the onboard FRAM and hence is non volatile See sample program set_TC SV PC4 For Nano 10 and FMD PLC the new SV are only stored on RAM shadowed CPU flash memory and is nomally volatile unless a RESET or SETSYSTIEM 252 0 command has been executed which forces a backup of the RAM shadow to the CPU flash memory Programmer should therefore use this command sparingly Note that TBASIC custom funciton can start a timer simply by setting its TIMERPV vanable to any integer value between 1 reset timer and 9999 so it is not necessary to change the timer S V The present values P V of timers can be read or written directly as integer variables TimerPV n But the Set Values can only be changed by this function GetCtrSv _ GetTimerSV _ Gett trSV 12 57 SETDACn x Statement Purpose Examples Comme gp a TRI nts TRIANGLE RESEARCH INTERNATIONAL To set channel n of the PLC s Digital to Analog Converter
131. RA RESEARCH 8 6 LAS INTERNATIONAL Chapter8 fa Print Control Panel Een a Print Page setup Print Preview Print Ladder Circuits Ladder Circuits I O Tables Custom Functions Define Table From 1 To 0 No of Cc To print first select the item from the choice box and define the range you wish to print and then click on the Print button For Ladder Circuits the range indicates the circuit numbers For V O Tables the range indicates the I O number up to 256 and for Custom Functions the range is the function number You can use the Print preview button to check the pagination of the printing on screen You can select paper size and print orientation etc by clicking the Page setup button Empty custom functions will be automatically skipped to save paper When you select to print the Ladder Circuits a special No of Element textbox appears This textbox is for you to enter the maximum number of series element that can be printed on the paper width Changing this number affects the scaling of the ladder diagram when printed The smallest number is 5 and largest number is 13 Use a smaller number if you wish to have a larger printout However please note that if your ladder program contains circ uits with more elements than that indicated by the No of Element parameter the out of page part of those ladder circuits will not be printed Widerl O Table Previously
132. SW2 is true Think of an imaginary current flowing through the Master contact then through the controlISW1 and finally through the normally closed controlSW2 contact to tum ON the lamp On the other hand if controlISW1 is OFF but c ontroISW2 is ON the Lamp is also tumed ON because the curent could flow via Master and then through the lower parallel branch via N C controlISW1 and the N O c ontroISW2 Note As you can see although the switch controlISW1 is connected to only 1 physical input to the PLC but it appears twice in the ladder diagram If you actually try to connect physical wires to implement the above circuits both controlSW1 and controlSW2 will have to be of multiple poles type But if you use a PLC then these two switches only need to be of single pole type since there is only one physical connection which is to the input terminal of the PLC But in the ladder diagram the same contact may appear as many times as you wish as if it has unlimited number of poles Tri eat 9 2 INTERNATIONAL Chapter9 The above example may be simple but it illustrates the basic concept of logical AND and OR very cleanly controlISW1 and controlISW2 are connected in seres and both must be TRUE for the outcome to be TRUE Hence this isa logical AND connection On the other hand either of the two parallel branches may be used to conduct curent and hence this isa logical OR connection Another type of conta
133. T 2 TRIANGLE R RESEARCH INTERNATIONAL l TRILOGI Ladder BASIC Version 6 45 Programmers Revision 1 1 Reference USER MANUAL Copynght Notice and Disclaimer All rights reserved With the exception of legitimate TRi PLC users who may print or make copies of this manual for reference purposes no parts of this manual may be reproduced in any fom without the express written permission of TRi Triangle Research Intemational Inc TRi makes no representations or warranties with respect to the contents hereof In addition information contained herein are subject to change without notice Every precaution has been taken in the preparation of this manual Nevertheless TRi assumes no responsibility for emors or omissions or any damages resulting from the use of the information contained in this publication Windowsisa trademark of Microsoft Inc MODBUS a trademark of Mobdus org All other trademarks belong to their respective owners Revision Sheet Release Revision Description No Rev 1 3 14 2013 Complete Update of all chapters for synchronization with TRILOGI version 6 45 build 06 Rev 1 1 5 03 2013 Added notes on using RESET and SETSYTEM 252 0 commandsand performing a Reset after program transfer to backup timer amp counter set value data o_O TRIANGLE ii LRA RESEARCH Page ii INTERNATIONAL USER MANUAL Conditions of Sale and Product Warranty Triangle Research Intemational Inc TRi
134. TERNATIONAL Chapter 2 Introduction To l TRiLOGI 2 INTRODUCTION TO I TRILOGI CLIENT SERVER 2 1 Client Server Architecture i TRILOGI is a Client Server application suite The entire program is broken into two parts the Serverand the Client 2 1 1 Client The i TRILOGI program is the one which you use to create your ladder logic TBASIC program and iscalled the Client program If you are programming the PLC offline then you only need to run the client program without the server The beauty of the client server configuration is that it does not matter whether the server and client are located at the same computer or at 10 000 miles apart and they work exactly the same way The client and the server can communicate via any form of network connection including the Intemet This makes it possible for the user to program the PLCs either locally or remotely via the Intemet oreven wirelessly via mobile Intemet Another important advantage of client server architecture is that multiple clients may access the same server simultaneously Hence you can run multiple copies of the i TRILOGI clients at different places around the world simultaneously for troubleshooting a single PLC You can also run the i TRiLOGI client AND the TRi Exc elLink separate data collection software clients simultaneously 2 1 2 Server Since i TRILOGI client program only communicates using TCP IP networking protocol itneedsto connect to a server that
135. a d is applied to all 3 COMM ports simultaneously and can be any value from 0 to 255 e g SETSYSTEM 2 5 The PLC will retry up to 5 times if it failed to communicate with the slave Note that there will be longer waiting times when failures occur if you increase the number of retnes 12 64 3 Hostlink Command Response Time data 0 Respond asfast as possible to seral port hostlink commands received from the host computer or another PLC data 1 default at least a 0 01s 10ms must lapse before responding to host link commands received from the host computeror another PLC This delay isneeded for auto switch type RS485 converter to allow time forthe hardware transceiverto switch direction 12 64 4 Configure Quadrature Encoding Set Enhanced Quadrature Encoding for HSC channels see the PLC s User manual on High Speed Counter hardware for details 12 48 Chapter 12 12 64 5 DM s Cleared During Reset data 0 All DM cleared when PLC issoft reset data d DM 1 to d will not be cleared when the PLC is soft reset NOTE Applicable only to PLC with fimware r78 and above 12 64 6 Modbus Function Select data 3 READMODBUS and READMB2 use Modbus Function 03 WRITEMO DBUS uses default function 16 data 4 READMODBUS and READMB2 use Modbus Function 04 WRITEMO DBUS uses default function 16 The following is applicable for PLC with fimmware r77 and above only data 6 WRITEMODBUS uses Modbus Function 06
136. a TLServer that runs on the same PC asi TRILOGI then simply select the localhost 127 0 0 1 9080 to connect to TLServer If you are connecting to the PLC s host link command server the IP address of the PLCs and the port number should be entered in the Server s IP Address Port field and select the comesponding radio button The default settings for the Ethemet port are IP 192 168 1 5 and port 9080 with no usemame and password required Same as shown in the screenshot above Once you have entered the correct login information click on the Detect ID button and wait forthe PLCsID to populate in ID box 01 is the default ID Then click OK and the configuraton tool willbe populated with the current Ethemet settings After you have retrieved the existing parameters from the PLC you will see that various fields in the configuration software screen are filled up These fields and the remaining unpopulated fields can be configured as described in the rest of this document Tri nat 8 23 INTERNATIONAL Chapter8 8 3 10 1 BASIC CONFIGURATION IP Address S Factory Default Subnet Mask Node N Gateway IP Addr TI ode Name SMTP Server IP pot FSever DNS Server hacer a Lal WW FServer Port TimeOut METET MBTCP Port Secs FTP Timeout s LAN Speed 100Mbps M Username Use username password Password Seeeeeeeeeee eg O Yes No AccessLevel 1 Proarammer
137. a aiaa 3 7 4 USING THE TLSERVER WEB SERVER FOR TRILOGI 4 1 4 1 OVO IVIOW sesessegeeuegerergeereeer ebeeEEEseEEEEKEEEEEESEEKESSEEEEEEEEEKEEEEEEKEEEERSEEEEEREEEEREEEEEEESER 4 1 4 2 Serial Port SetUp E 4 4 4 2 1 Setting Up and Testing TLServers Serial Communication Port 4 4 4 2 2 Changing Communication Getting s eee cece eeeeeeeeeeeeeeetaeeeeeeaeeeeteeeeaetaeeeeeeaeens 4 5 4 2 3 Modem SUPPO EE 4 6 4 3 LR e UE 4 9 4 3 1 Select Use ma MG 1 cecccesecssecssecseeeseeeseeesneesnsesseeseeesceesceesceescaescaescaesseessaesseeseaessrseessensees 4 9 4 3 2 Add New USE Tisai Site Deeg gees Inline Eaa nel ahi ieee 4 10 4 3 3 SERVED POM AE E E E E E A geleet E g 4 10 4 3 4 What Port Number Should TLServer USC AAA 4 10 4 4 Setup Bak ca scsi ecsatsci nsec nndene denne cca cencendencnsecandcsennceenscneisunseseanisantawescantssandes 4 11 4 4 1 MINTO let e BE 4 11 4 4 2 Configure And Test SMTP EMail Gener 4 13 4 4 3 Setting Up TLServer As Email Master For Multiple PLCs on bann 4 17 4 4 4 Writing i TRILOGI Programsthat Can Send Emails via TLServer as Email Master4 18 4 5 Fale and Email ServiC eS isicscsisecacssccessasasnccasadsnsndcastecsaseancsdesssceccasessenscanseceite 4 19 e TRIANGLE Dok RESEARCH Page iv INTERNATIONAL USER MANUAL 5 RUNNING THE INTERNET TRILOGI CLIENT 5 1 5 1 Starting The i TRILOGI Applicaton sss sssensssunnnonnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nn 5 1 5 2 Running TRILOGI Applet Using Web BrOWSEer s sssens
138. a ble Comments 11 8 11 2 7 Variable Define Table INDIEN 11 8 113 String Constants Variables amp Ope rat0rs sssccsssssssessssssseesssssseeeeseenes 11 10 11 3 1 SING Melen 11 10 11 3 2 SUIVI 11 10 11 3 3 Sng belge 11 11 11 3 4 String Variable Comments 11 11 11 3 5 Variable Define Table INDIEN 11 12 12 TBASIC KEYWORD REFERENCE 12 1 12 1 PAS EE 12 1 12 2 PAD 1 stssssesssssssensssssssssnsssedtneseesescasensessossecsnsesenstssnesdsansssscsssensesssnessesssdanaesi 12 1 12 3 Ee E E noses sn sda 12 1 12 4 CA e 12 2 12 5 n lU 12 2 12 6 Lef ei E 12 2 12 7 CLRIO labelname SETO labelname TOGGLEIO labelname TESTO 3 lADGINAMEC svsssecesscicessscccssseeceanescsensecndanccsdnneccsseneestineatsnceesscusesaccesdenenscntncuccndiaedaas 12 3 12 8 6 UCI EN 12 4 12 9 CRCIG var Couptl esextssssssugugkeerereuuEeEEueeEEuEeESuEEEERESEEuEEEENEKESuEkSENER 12 4 12 10 DELAY 10 TTT 12 5 12 11 LU E 12 5 12 12 POR N T sesssgsspegesgeseetesesspeeegeeesggessseEEEekeEEeseegeREEEEEEEEERRSERSEREEEEEEESEEER 12 6 12 13 Get DM n GetTimerSV N ertEEEREEEEEEEEEEEEEEEEREEEEEEEEEEEEREEEEEEEEEEEEEEEEEEEEEN 12 7 Ca TRIANGLE jjj LRA RESEARCH Page viii OUN INTERNATIONAL USER MANUAL 12 14 GEMIGHIO V EEN 12 8 12 15 HEX n EENS Ip dl esssssueessessseusetsesteeessesgeeusssueuusseegesgeereREeeRAEuEEEEN 12 8 12 16 HSC DEF ch fn_num value sssssssennnsunnnennnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnmnnn annman 12 9 12 17 RSG OPE e a E 12 10 12 18 HSI
139. ading it click Next to continue Please read the following important information before continuing BZ Please Click on the Start Menu open the Internet TRILOGI 6 and read the document on Internet TRILOGI Helps to learn about the program When you are ready to continue with Setup click Next 13 Finally installation is complete Click Finish to close the window and proceed to the next section of this manual for instructions on running TRILOGI and TLServer Tt v TRIANGLE 1 7 R RESEARCH INTERNATIONAL Chapter1 I TRILOGI Setup Guide Setup has finished installing i TRILOGI 6 45 build 05 on your computer The application may be launched by selecting the installed icons Click Finish to exit Setup 1 5 Run TRILOGI and TLServer All i TRiLO GI Version 6 x files will be installed in the following default folder C A TRILOG N TL6 You nomally would not need to go directly to this folder to run TRILOGI or TLServer Thisisbecause durng installation of i TRILOGI a program Group folder TRILOGI 6 xx will be created in the Start Menu to provide short cuts to the TLServer program the i TRILOGI application and the TL6 Applet starter as illustrated in the following picture A i TRILOGI6E 5 i TRILOGI Helps i ES j TRILOGI Version 6 4 5 LocalHost Applet htm i YA TLServer Version 3 1 7 Si Uninstall i TRILOGI6 45 build 01 II In the example screenshot above the TRILOGI programmin
140. aeesas 8 15 8 3 4 Program Transferto PLC set DT 8 15 8 3 5 Transfer CO5 File Oe 8 16 8 3 6 Open Matching Source bie 8 16 8 3 7 Get PLC S Hardware Info 8 16 8 3 8 Set PLCS Real Time ClO CK EE 8 17 8 3 9 EEPROM Manager 8 17 8 3 10 Ethemet amp ADC Configuration cecceecceesse ce eeeeeceeceeeeeseeceeeeeecneseeseetaeseestaeenestaees 8 21 8 3 10 1 BASIC CONFIGURATION EE 8 24 8 3 10 2 ADVANCED CONPGUBATON 8 30 8 3 11 Auto Analog Calibration on eee cece cseeeeeeceeeeeeaeeeeeaeceeecaeseeesaseessaeeeesaaeeestaeseeeeaeeas 8 36 8 4 Simulate MON sisssiicasscctnassccssccnssccsincsensscacaccecnesccsaccasaccccacsccacsandscandnccsssesccncs 8 41 8 4 1 Run All O Reset CC DH 8 41 8 4 2 Run reset Except Hp et DE 8 41 8 4 3 Continue Bun NO reset el 8 42 8 4 4 Comple Ony F S EE 8 42 8 4 5 RESEEAI I OS et RER oete eekebtesgerdedeeStNeNEENN ena aaa Ea aada Nanana aandie 8 42 8 5 Circuit Menu ciiicincesctcccsncesesctcccnnsesassssnsecsnnssscancaseasscnseccasecanssnnsidcndensnansannnas 8 43 8 5 1 INSSTE Comments eirinn ai a ai iT 8 43 8 5 2 Insert el ef EEN 8 43 8 5 3 IO eG NC UM EE 8 43 8 5 4 APDend C ire Ulbes EE 8 44 8 5 5 Delete el EE 8 44 8 6 Help NN E 8 44 9 LADDER LOGIC LANGUAGE REFERENCE 9 1 9 1 Ladder Logic Fundamentals Contacts Coils Timers and Countess 9 1 9 1 1 SO MLS Le CN 9 1 9 1 2 ENEE 9 4 9 1 3 EH 9 5 9 1 4 IMEF 6 ONS onnaa a a a a adits Wass eda a a 9 5 9 1 5 Counter Cols areenaa ege ERT aa Naa aa Aep agm 9 5 9 2
141. age Example 1 If you execute SETDAC 1 2048 you would expect the DAC 1 to output 5 000V ona 10 000V full scale DAC but instead you only get 4 960V Proportional Error 4 960 5 000 0 992 Multiplication factor required to cormect the DAC output 1 0 992 1 0081 1 81 10000 You can therefore enter the value 81 into the DAC Calib field cormesponding to DAC 1 and save the parameters to the PLC After the PLC has rebooted when you execute the statement SETDAC 1 2048 the CPU would apply the multiplication factor of 1 0081 to the actual digital value it sendsto the DAC output The actual DAC output 4 960V x 1 0081 5 000V Example 2 Same as Example 1 but you measure 5 030V when you expect 5 000V Proportional Error 5 030 5 000 1 006 Multiplication factor required to corect the DAC output 1 1 006 0 9940 1 0 0060 You should therefore enter the value 60 into the DAC Calib field cormesponding to DAC 1 and save it to the PLC After the PLC has rebooted when you execute the statement SETDAC 1 2048 the PLC will apply the multiplication factor of 0 9940 to 2048 before it writes to the DAC hardware Tai Bae 8 34 INTERNATIONAL Chapter8 The actual DAC output 5 030V x 0 994 5 000V 5 DAC Zero Offset If you plot the line graph for the output voltage versus the DAC set value the line should nomally pass through the ongin But if there were any zero offset error the
142. ain compatibility with the Ethemet XServer device which is not Unicode aware the TL6 Application still uses standard ASCII encoding when communicating with the PLCs This is unlike opening or saving i TRILOGI program files to the TLServer that would require Unicode network stream as mentioned in the File menu help page Asa result the TL6 application can work with TLServer version 3 x as well as older TLServer 1 x and 2 x when it is only for the purpose of programming controlling and monitoring the PLC and not to read write i TRILOGI file If there is no existing connection made to the TLServer then execution of any command in this menu will always bring up the password dialog for you to enter the Usemame Password as well as the IP Address port of the TLServer You must be positively authenticated before you are able to log in to the TLServer See Log In to TLServer for detailed explanation of the Usemame Password Dialog box Once you have log in to the TLServer see explanation of each function below 8 3 1 Select Controller lt Ctrl l gt The only editable field is the ID field You have to enter the ID address in hexadecimal notation 00 to FF This command allows you to select another PLC that is connected to the same TLServer but with a different ID for on line monitoring or program transfer bei Wegen 8 14 INTERNATIONAL Chapter8 8 3 2 Connect Disconnect to Server Use this command to log in to the TLServer onl
143. allow you to connect a userdefined custom function CusFn to the ladder logic asif it isa relay coil Custom functions are created using the integrated editor provided by i TRILOGI Version6 x Please refer to TBASIC Reference manual for detailed descriptions of custom function creation and deployment methods 9 3 8 Master Reset An ON condition to this function clears all mailbox inputs outputs relays timers and counter bits resets all timers counters sequencers to inactive state and Clears all latched relay bits All integer vanables will be cleared to zeros and all string variables will be assigned to empty string 9 4 Using i TRiLOGI Sequencers A sequencer is a highly convenient feature for programming machines or processes which operate in fixed sequences These machines operate in fixed Cleary distinguishable step by step order starting from an initial step and progressing to the final step and then restart from the initial step again At any Tri ee 9 14 INTERNATIONAL Chapter 9 moment there must be a step counter to keep track of the current step number Every step of the sequence must be accessible and can be used to triggersome action such astuming ona motor or solenoid valve etc As an example a simple Pick and Place machine that can pick up a component from point A to point B may operate as follow Sep Acton Wait for Start signal Forward am at point A Close gripper Retractam at point
144. ant since its content will be evaluated before being used in the expression e g A Total is 4 STR B C STR n isa function which retums a string and therefore can be used directly in the above string assignment statement The most distinguishable feature of a FUNCTION is that its arguments are enclosed within parenthesis and e g ABS n ADC n MID A n m SIRC MP A B Note Statements or functions and their arguments are NOT case sensitive This means that commands such as PRINT and PriNt are identical However for clarity seek we use a mix of upperand lowercase characters in this manual 11 1 3 DELIMITER A TBASIC program consists of many statements Each statements are usually separated by a different line The new line therefore acts asa delimiter which separate one statement from another Some statements such as IF THEN ELSE ENDIF span multiple statements and should be separated by proper delimiters Ten Resear 11 1 INTERNATIONAL Chapter11 To make a program visually more compact the colon symbol may be used to act asdelimiter e g IF A gt B THEN C D 5 ELSE C D 5 ENDIF may be written more compactly as IF A gt B C D 5 ELSE C D 5 ENDIF 11 2 TBASIC Integer Constants Variables amp Operators The TBASIC compiler in i TRLOGI supports full 32 bit integer computations However only variable A to Zare 32 bits in length which allow them to represent number between 2
145. are r72 and above 12 64 19 Ethernet Port Enable data 0 Disable Ethemet port to save power execute only when Ethemet connector is disconnected data 1 default Enable Ethemet port data 2 Clear ARP cache so that it will request ARP data before connection Applicable only to PLC with firmware r74 and above Note Do not disable Ethemet port when Ethemet connector is plugged into the switch or router This is because if Ethemet is disabled while active connection is going on the CPU can lock itself into undefined Interrupt error state 12 64 20 Watchdog Timer This allows you to enable on C PU Watch Dog Timer Tri Boss 12 54 INTERNATIONAL gp a In TRIANGLE RESEARCH INTERNATIONAL Chapter 12 All F series 2 675 4 47s 0 17s 0 28s default default defa ult If enabled and the CPU goes astray because of noise induced trouble the WDT will reset the CPU when it times out Note that to simplify users application the TBASIC O S automatically resets the WDT during its normal execution except when the program isstucked insde a GOTO loop Hence if your program is likely to spend longer time within a GOTO loop than the predefined timeout you must run the SETSYSTEM 255 0 command periodically to reset the WDT before it times out to prevent the WDT from resetting the CPU However the WDTwill not kick in if your program is tucked inside a FOR NEXT or WHILE ENDWHILE loop WDT also will not activate i
146. ata must be entered in comma delimited format asdescribed below 1 Integer EEP Buffer Format Integer EEPROM data should be entered in the format address data and a line break Eg to store decimal data 12345 equivalent to 3039 in hex into address 10 enter the following text into the Integer EEP Buffer area 10 12345 or in hexadecimal data format 10 amp H3039 2 String EEP Buffer Format String EEPROM data should be entered as address text string E g to store the string Test Message 10 into string address 5 enter the following text into the String EEP Buffer area 5 lest Message 10 8 Rm Temp 25 DFC If you need to store a non printable character or ASCII character which is gt 127 in value into the string EEP buffer you can enter it as an escape sequence which is in the format of XX The backslash character denotes that this is an escape sequence and XX is the hexadecimal value of the character E g characterA can be wnitten as 41 and character Zcan be wnitten as 5A In the second example above the DF character is ASCII 223 which on an LCD216 or LC D420 willbe displayed asa degree symbol Note 1 Normally when an EEPROM isin erased state all it memory bits contain binary T and when you read them from the EEPROM asstring they will be retumed as FF 2 To prevent disrupting communication with the PLC the strings to be wnitten to
147. ater is able to actually use DM32 n in its program i TRILOGI will check the PLC firmware version number during program transfer and will not transfer TBASIC program that contains DM 32 variables to those PLC with lt r78 firmware amp View Variables DM n amp View Variables DM32 n Only for PLCs with fi T 1234 89B 0 0 0 L 12348594B 0 0 sal 0 0 0 0 0 6 0 0 0 21 0 0 0 0 0 thal 0 0 0 31 0 0 0 0 0 16 0 0 0 41 0 0 0 0 0 al 0 0 0 EA 0 0 0 0 0 26 0 0 0 6l 0 0 0 0 0 al 0 0 0 tal 0 0 0 0 0 36 0 0 0 EM 0 0 0 0 0 41 0 0 0 91 0 0 0 0 0 46 0 0 0 101 0 0 0 0 0 Sub 0 0 0 DD Jg 0 0 0 0 56 0 0 0 ala D 0 0 0 0 6l 0 0 0 Carn 0 0 0 0 66 0 0 0 141 0 0 0 0 0 TL 0 0 0 I5 i0 0 0 0 0 76 0 0 0 View DM32 n PgUp _ PgDn Bee _ViewDM n PgUp PgDn Dee For PLC Firmware gt 78 c String Variable Screen The third screen displays the value of the 26 string vanables A to Z in 4 pages depending on the length of each string If the execution condition isON and the TR RESEARCH 10 20 INTERNATIONAL Chapter 10 CusFn is not of the differentiated type then the CusFn will be continuously executed The result of the vanable will be continuously updated on the viewing window d System Vanable Screen System variables such as INPUT n RELAY n and emINT n are visible in this screen You may wish to click on the Hex button to view the values in hexadecimal notation as they are more com
148. bel name of the element This can be a convenient feature if you need to change one or two characters in the name only However if the element isa custom function dC usFn or CusFn then the custom function editor willbe opened for you to edit the function directly Insert Ladder Element You create the ladder circuit element simply by moving the mouse pointer to the icon and pressing either the left or the right mouse button to insert a ladder logic element to the curently highlighted element The following isa description of the functions of each icon A yellow color highlight barwillappear which you can move to select an element in the ladder circuit GC TRIANGLE 7 URA RESEARCH 7 8 INTERNATIONAL Chapter 7 lt 1 gt Left dick to insert a normally open series contact 1 lt 2 gt Right dick to insert a normally dosed series contact lt 3 gt Left dick to insert a N O parallel contact to highlighted element 3 lt 4 gt Right dick to insert a N C parallel contact to highlighted element lt 5 gt Left dick to insert a N O parallel contact to endose one or more elements los Right dick to insert a N C parallel contact to endose one or more elements lt 7 gt Insert a normal coil which may be an output relay timer or counter lt 8 gt Insert a parallel output coil not an entire branch to the current coil lt 9 gt Insert a special function coil which indudes execution of CusFn lt 0 gt Inse
149. cHons nnne 10 8 10 2 6 Undo Chang EE 10 9 10 2 7 Aborting Changes ce cecececeeceeceeeeeee cece eae eeeeeaeeeeesaeeeeeaeseeeaesaeesaeeaessaeeeesaeseeeeaeseeeeatias 10 9 10 2 8 FDS PING Ta EE 10 10 10 2 9 Toggle Breakpoint EE 10 10 10 3 Meare Wea T da das E E E E A TT 10 10 10 3 1 lee WEE 10 11 10 3 2 IN ele 10 11 10 3 3 Delete e EE 10 11 10 3 4 CODY e UE 10 12 10 3 5 Paste ROW E 10 12 10 3 6 ulstelgtRIUENET IER 10 12 10 3 7 Export Define Ta Bless 5208 aniston tad sale ele 10 13 10 3 8 More Information on Define Ta DIOS ceccesecesecseceseseeesseesseessaeesuesaeecaeseaeeses 10 13 10 4 How to Use A Custom Func Don esreeEEEEEEERSEEEEEEERSEEEEEEEREEEEEEEERESEEEEEEEE 10 13 10 4 1 Triggered by Ladder Logic Special function coil IC usbnl nn 10 13 10 4 2 Periodic Execution Of a Custom Func tion 10 15 10 4 3 Intenupt Service CUSEN iraissonionic unien iaiki cee eet 10 16 10 5 Simulation amp Examination of TBASIC VarableS sssssssnssssnnnnnnnnnnnnnnnnnn 10 17 10 5 1 Simulation Run Of CuSEN wisviwnedienrarinta cen asad nae a 10 18 10 5 2 Viewing TBASIC Vanables A 10 19 10 5 3 Changing the ContenteofVanables A 10 21 10 5 4 Decimal and Hexadecimal Representation ceeeccecseeeeeteeeeeeeceeeeeeeeeetees 10 21 10 6 On line Monitoring of TBASIC Var ableS ssssssssssnssennnnunnnunnnnnnnnnnnnnnnnnnnn 10 22 10 6 1 PAUSE and RESET of Target PLC ecceccesceecceseceeeeeeeeteeeeaeeaeeaeseeeeaeseeesaeseeseaseeeeaeees 10 22 egen
150. cated from the bottom of the data space and grow upward This implementation allows say both SAVE_EEP n 1 and SAVE_EEP x 1 to be executed in the same program without the string and integer data writing over eachother space However when the addresses grow larger up to a certain point the integer and string data space will cross path and overwrite each othersspace It istherefore the programmer s responsibility to check that this does not happen Here is how Assume the total data space for integer data N words 16 bit Total numberof data space 2N bytes gt Maximum number of string data space 2N 40 rounded down To determine the upper limit of one type of storage you have to first decide how much space you want to allocate to the other type E g 1 N 1700 and you want use the first 510 location for integer data that means the maximum number of string space available 1700 500 2 40 59 E g 2 N 7700 and you want to store 200 strings The maximum number of integer space available 7700 2 200 40 2 3700 Example save_EEP A 3 The content of A will be stored at string space 3 of data EEPROM See Also LOAD EEPS 12 51 SETBAUD ch baud_no Purpose To set the communication Baud Rate of the PLC s seral channel ch All of the Super seres PLC serial ports are Tri Boss 12 36 INTERNATIONAL Chapter 12 defined as 8 data bit 1 stop bit and no panty and each has been pres
151. cation where you want to track their values especially if the value changes rapidly which may not be constantly captured by on line monitoring screen 10 7 Debugging With PAUSE amp Breakpoints 10 7 1 Using the TBASIC PAUSE Statement When debugging your program it is often easier to identify program bugs by pausing the PLC ata certain execution point so that you can examine the data in the vanables to understand why the program does not behave the way you expect it to TBASIC offers the PAUSE statement which is always available in all versions of i TRILOGI software and supported on all firmware versions of the Super PLCs TRI DE PS INTERNATIONAL Chapter 10 When the program reaches a PAUSE statement it will enter a PAUSE Mode and you can then examine the vanable in the PLC You can add as many PAUSE statement as you need in different part of the program to halt the program execution However since the software does not show you exactly where the program is halted except to tell you that a PAUSE statement is known to have been executed in a particular function number and if you have more than 1 PAUSE statement in a particular custom function then you will need to put some markers so that you know where the program has stopped The markercould be displaying of some text on the LCD e g Pause 21 that a certain PAUSE point has been reached or you can assign a certain value to a reserved variable and the value comesponds to th
152. ces which can tnggera CusFn a Physical Interupt inputs The NANO 10 FMD serey F Series PLCs contain some hardware Interrupt inputs which when enabled by the INTRDEF statement will tigger a particular CusFn defined in the INTRDEF statement when the logic level at the interrupt pin changes state eitherfrom OFF to ON orfrom ON to OFF b Periodic Timer Interupt PT The Periodic Timer Interrupt PTI lets you define a custom function that will be executed by the CPU precisely every x number of milliseconds ms The PT runs independently of the ladder logic and its execution is therefore not affected by the total PLC program scantime NOTE The PT isnot available on the legacy TLOOMD TLOOM X PLC c Power Failure Interrupt PFI The NANO 10 FMD serey F Series PLCs CPU has a built in power failure sensing circuit that will call a custom function when it detects an impending power failure This allows you to perfom such critical function such as saving critical data to the PLC snon volatile memory just before power failure NOTE The PFlisnot available on the legacy TLOOMD T1OOM X PLC d High Soeed Counters HSC Reach Target Count These PLCs also contain some High Speed Counter inputs which when enabled by the HSCDEF statement will tiggera particular CusFn defined in the HSC DEF statement when the counter reaches a preset target count value This enables the CPU to cany out immediate action such as stopping a motor or performi
153. click on the Save Parameters to FServer to save your data to the PLC snonvolatile memory When MODBUS TCP Use Trusted IP is enabled it means that only TCP IP packets that come from a client whose IP address matches one of the Trusted IP would be allowed connection to the MODBUS TCP server 3 Calibration of ADC and DAC amp Moving Average Definition The ADC and DAC are factory calibrated such that a voltage of half of fullscale voltage 5 00V on F2424 and 10 00V on F1616 BA should retum a value of 2048 when read by the ADC n function Likewise an output voltage of half of fullscale voltage should be present at the DAC pin when you SETDAC to 2048 However if there isa need to re calibrate the ADC and DAC you can follow the procedure outlined below To perfom calibration of an ADC channel you need to supply a precise DC reference voltage to the ADC channel and then check the analog readings obtained via the ADC n function and compare it to the expected value If there isan eror you can apply a conection factorto it bei Bass 8 31 INTERNATIONAL Chapter8 The bottom half of the Advanced Configuration screen contains ADC and DAC calibration constants that you can enter and transfer to the PLC as shown below GA ADC Calib Chi th Ch3 ch4 omg Lan 100 25 Ten Ile Zero Offset lo o DAC Calib Zomme 10 lo Zero Offset SE o o ADC Moving Avg o RTC Calib of data
154. compilation if the destination label is undefined 12 15 HEX n HEX n d Purpose To retum a string that represents the hexadecimal value of the numeric argument n If the second format is used then this function will retum a string of d number of characters Tai Bae 12 8 INTERNATIONAL Chapter 12 Examples A HEX 1234 B HEX 1234 7 Comments A will contain the string 4D2 B will contain the string 00004D2 See Also i HEXVAL SIR VAL HEXVAL x Purpose To retum the value of a hexadecimal number contained in the argument x Examples B HEXVAL 123 100 Comments B should contain the value 29100 amp H123 291 See Also f HEX STR VAL 12 16 HSCDEF ch fn_num value Purpose Enable and set up parameters for the High Soeed Counters channel ch These counters operate independently of the ladder logic scan time and can capture high speed input pulses generated by position encoders ch channel number 1 8 fn_num Custom Function to tigger when value is reached value trigger when HSC reach this 32 bit integer value If the PLC supports quadrature encoder inputs then the HSC counter vanable HSCPV ch will increment decrement according to direction of rotation When value is reached the specified custom function activates immediately Important All High Speed Counters are disabled automatically when the PLC is reset unless they are enabl
155. control Output 5 which is bit 4 of the variable OUTPUT 1 The statement SETBIT output 1 4 tums ON output 5 3 Actually it may not be necessary to check the minute hand since when the RIC tums from 18 59 to 19 00 the output will be tumed ON as long as TIME 1 19 Only when TIME 1 7 then output 1 needsto be changed A2 2 6HVAC Heating Ventilation and Air Conditioning Control Assignment Ca TRIANGLE A2 1 URRY RESEARCH INTERNATIONAL Appendix 2 1 Read desired temperature setting S from a potentiometer connected to A D 5 2 Read curentairtemperature T from sensorattached to A D 1 T 3 Tum ON cold air conditioner output 1 with labelname OUTI if T gt Sby morethan 1 50C 4 ON heaterif output 2 if S gt Tby more than 1 50C 5 Tum OFF both heaterand cold air conditioner if Tis within 1 5 oC ofsS Parameters Full scale A D is 4096 Range of Set Point A D 5 0 gt 16 0 C A D 5 4096 30 0 C Range of Sensor ADC 1 0 gt 10 0 C ADC 1 4096 50 0 C C1k 1 0 Fn_ 20 Le dust Custom Function 20 S ADC 5 300 160 4096 160 Convert to Cx10 T ADC 1 500 100 4096 100 Convert to Cx10 IF S T gt 15 SETIO OUT1 Cold Air conditioning ON ELSE CLRIO OUT1 if T is hotter by 1 5 C ENDIF IF S T lt 15 SETBIT OUTPUT 1 1 Heater ON ELSE CLRBIT OUTPUT 1 1 if T is colder by 1 5 C ENDIF Comment Since TRILOGI Version 6 x doe
156. controller directly for small motors with phase current lt 0 5A or via solid state relays The stepper motor can be driven using a sequencer that cycles through Step 0 to Step 3 full step mode or Step 0 through Step 7 half step mode Each step of the bei Bass 9 17 INTERNATIONAL Chapter9 sequencer is used to energize different phases of the stepper motor A clock source isneeded to drive the stepper motor through its stepping sequence The stepping rate isdetermined by the frequency which is equal to 1 period of the clock source Clock pulses with periods in multiples of 0 01 second can be generated easily using the Clk 01s bit and an Upctr function For e g to generate a clock source of period 0 05s use Clk 01s to feed to an Upctr counter with Set Value 4 The counters contact completion flag willbe tumed ON once every 5 counts 0 1 2 3 4 which is equivalent to a 0 05 sec clock source b Replacing a Drum Controller A drum controller can be replaced easily by a sequencer if the timing of the drum s outputs can be divided into discrete steps Assuming a drum controls two outputs with the timing diagram shown in the following figure oO A wm wm amd em wm wm ent wm wm wech EEN D S Ki Sa T GE EE EE BEE E aana SE KEE EE Eed a z EE ES 4 o EE Ecker Thiscan be replaced by an 8 step sequencer Step 1 e g Seq1 1 tums ON and latch Output A u
157. creen All ladder logic contact symbols are TR RESEARCH 8 12 INTERNATIONAL Chapter8 nomally identified by their label names However you can also choose to display an optional small literal to indicate the I O types and physical I O number which is now linked to the I O labelname e g ilSnput 1 012 output 12 25 relay 25 tl timer 1 and c5 counter 5 When i TRILOGI first starts the display is enabled but you have the option of tuming it off if you find it distracting 8 2 10 Edit Custom Function lt F7 gt Opens up the Custom Function Editor window for you to enter the TBASIC program You will be required to select the custom function number ora label name from the CusFn table which is part of the I O Table Each i TRiLOGI file can contain a maximum of 256 custom functions At any one time only one custom function will be opened for editing The custom function number and the required label name will be displayed on the Title of the Custom Function editor window Le ES Custom Function 1 IF_COMPARISON Co TI etal Example use of multiple IF THEN ELSE Each IF statement must have an ENDIF SS ae EE ELSE 7s optional A INPUT 1 A VALCAS IF A gt 0 THEN oan 14F COMPARISON X Sr 3 Value entered A is greater than 0 DM 1 A 10 ELSE lt EWEN gt gt IF A lt 0 THEN it PRINT 3 Value entered sA is less than 0 Rename CusF
158. ct available for all of the Ethemet PLCs only is the Rising Edge contact which looks like this KS in the ladder logic toolbar and like this when placed ina ladder logic circuit This type of contact will detect a change of status from off to on and then send a single pulse out one shot This contact can be used for any physical input or output or any intemal bits relay counter timer In the case of physical input and output rising edge contacts a rising edge will be detected if the I O haschanged from off to on from one I O scan to another any I O status changes that happen during a ladder logic scan won t matter for physical I O In the case of the intemal bit rising edge contacts a rising edge will be detected if the intemal bit has changed from off to on from one ladderlogic scan to another any intemal bit status changes that happen during an I O scan won t matter for intemal bits Here are some examples of this forthe physical I O Ex1 In the circuit shown below if Inputl is off foran I O scan and then on for the next I O scan a single pulse one shot will be sent to Outputl and Output will be tumed on for one program scan time tumed off on the next I O scan On the same I O scan that Outputl istumed off and all following I O scans whether Inputl is still on or has been tumed off a rising edge will not have been detected and Output will remain off Fora new rising edge to be detected Inputl must be scanned as off fi
159. cute a series of instructions for a specified number of times ina loop FOR variable x TO y STEP z NEXT where variable may be any integer varnable A to Zonly and is used asa counter x yand zare numeric expressions STEP z isan optional part of the statement x is the initial value of the counter y is the final value of the counter Program lines following the FOR statement are executed until the NEXT statement is encountered Then the counter is 12 6 Examples Comments See Also Chapter 12 incremented by the amount specified by STEP If STEP is not specified the increment is assumed to be 1 A check is performed to see if the value of the counter is greater than the final value y if STEP is postive or smaller than the y if STEP is negative If it is not greater the program branches back to the statement after the FOR statement and the process is repeated If it is greater execution continues with the statement following the NEXT statement This is called a FOR NEXTloop A run time enor will result if STEP is evaluated to be 0 FOR I 1 TO 10 FORJ 100 to 1 STEP 10 DM I DMJ NEXT NEXT FOR NEXT loops may be nested i e a FOR NEXT loop may be placed within the context of another FOR NEXT loop When loops are nested each loop must have a unique vanable name as its counter The NEXT statement for the inside loop must appear before that for the outside loop Each Loop must have a separate NEXT
160. d Brk Pts to PLC View Var Continue At this point you can examine the variable data by clicking on the View Var button which will open up the View Vanable screen You can release the program from its PAUSE state by either clicking on the Continue button or by clicking on the Pause button on the on line monitoring screen The program will continue execution until it hits the next breakpoint Note that when the program is halted at a breakpoint you can define more breakpoints so as to track the program execution You can remove old breakpoint at any time if you run out of the maximum 8 breakpoints limit 10 7 4 Debugging Using Breakpoints on PLC Notice the H Send BrkPtstoPLC Chackbox below the Toggle Breakpoint button If you wish to halt the actual PLC not the simulator when the program runs to the breakpoint you can send all yourdefined breakpoints to the PLC by clicking on thischeckbox i TRILOGI will connect to the PLC and check if the program in the PLC isthe same asthe curently open program by verifying the checksums If the program is curent then it will transfer all the defined break point to the PLC TR RESEARCH 10 25 INTERNATIONAL Chapter 10 With the checkbox shown as checked any subsequent addition or deletion of breakpoints will be immediately transferred to the PLC When the PLC program reaches the defined breakpoint it will stop execution and the
161. d String text entry field allows you to test Communication with the PLC using its native or MODBUS ASCII protocols If you enter a string here and press lt Enter the ASCII string will be sent to the PLC connected to the seral port and the response string will be disolayed in the bottom text box If the comm port isnot yet opened thiscommand will automatically open it O TRIANGLE UR RESEARCH 4 4 INTERNATIONAL Chapter 4 Using TLServer Note that only multi point host link commands are accepted here The only point to point command acceptable here is the R command which queries the ID addressof the PLC If you have only one PLC connected to your TLServer computer then you can test the communication now using the following command string Command String IR Response String IRO1 The response string tells you that the ID address of this single PLC is 01 You can then try other host link commands using this ID address e g O1RIOO00 to query the states of inputs 1 to 8 If you have more than one PLC connected you should not use the IR since all connected PLCs will try to respond simultaneously thus resulting ina garbage retum string To change the ID of a PLC e g from 01 to 05 you can send the command string 01IW0500 to the PLC There isalso a Tange PLC E EE this for you automatically You can click on the Detect ID button to check the current ID and then the Change ID button to write the new
162. d any text editing program It is best to use a text editor that interprets ca mage retums as new line characters as well so that each custom function is displayed as it would be in the i Trilogi Custom Function Editor instead of as one long line that is very difficult to read A good editor to use is Wordpad or Microsoft Word To export Custom Functions just choose the Custom Functions option from the Print Control Panel and click on the P t button as shown in the Print Control Panel below You will then be prompted to save the Custom Functions asa txt file M INTERNATIONAL TRI RESEARCH 8 8 Chapter8 Print Control Panel mes Print Page setup Print Preview Print Custom Functions e Tab spaces 4 en EE From 1 To 256 Export NOTE You can select the range of Custom Functions you want to export to a txt file just like you can select the range of Functions you want to print Export Define Table The new Define Table feature introduced since version 6 43 can be exported to a txt file that can be opened any text editing program or MS Excel program To export Custom Functions just choose the Define option from the Export Print Control Panel and click on the button 8 1 9 Exit Execute this command to exit orderly from the i TRILOGI program You will be prompted to save the curent file if the contents have been edited and the changeshave n
163. ded with a matching NEXT statement to define the boundanes for the block controlled by the FOR statement For nested FOR loops each FOR must be matched by a comnesponding NEXT Expect keyword TO Required by FOR statement TRI De ad INTERNATIONAL Chapter 10 Must be an integer String variable orconstant not allowed Must be an integer vanable only Integerconstant not allowed Must be an integer constant Integer variable not allowed only Must be a string Integerconstant orvanable not allowed Must be a string variable only Must be a string constant only Incomplete Expression String constant missing closing String constants must be enclosed between a pair of opening and closing quotation Character Must be IntegerA to Zonly index for FOR NEXT loop must be A Z 10 8 2 Run Time Errors Certain errors only become apparent during the execution of the program e g A B C This expression is perfectly OK except when C 0 then you would have attempted to divide a number by zero which does not yield any meaningful result In this case a run time eror is said to have occured Since run time errors cannot be identified during compilation i TRILOGI also checks the validity of a command during simulation run and if a run time enor is encountered a pop up message window will report to the programmer the Cause and the CusFn where the run time enor took place This helps the programmer locate the cause of th
164. der program can have an effect on the behavior of the program Output bits which are changed asa result of the program execution will only be updated to the physical outputs at the end of the ladderlogic scan One scan time is defined asthe time it takes to execute the 3 steps read physical inputs execute program update physical outputs The CPU repeats these 3 steps continuously all the time known as Ladder Logic Scanning Hence it is important to note that the vanables INPUT n s and OUTPUT n in TBASIC are not the actual physical I Os of the PLC but only a memory representation of the actual I Os which will be updated only during the I O update cycles The logic states of physical inputs are copied into the INPUT n vanables dunng input scan and the physical outputs are set to the logic states contained in the OUTPUT n va rables during output updates Therefore one potential emor that traditional BASIC programmers tend to commit isto attempt to poll fora change in the vanable INPUT n within TBASIC such asthe following X lt WHILE INPUT 1 0 ENDWHILE FR TRIANGLE A2 1 r RESEARCH INTERNATIONAL Appendix 2 This will result in an endless loop since the value of the variable INPUT 1 will never change during execution of the custom function regardless of the actual logic states of physical input 1 to 8 The only way to force upon a physical I O update is to use the REFRESH command but it isnot a good
165. dues 12 52 12 64 16 Close TE P COMMEC COM wiecccgssdcscscenge teehee didiec ev syne agaceageddaguaccade Migeecaageisiqeeddgndeeanestaans 12 53 12 64 17 Wite to Fla EE 12 53 12 64 18 Control the RIC Operation NENNEN 12 53 12 64 19 Ethemet Port Ena ble 2 20 wcivlicitt e Retenuen Ae 12 54 12 64 20 Watchdog Tmer ntun annansnnnn nenn nnnn nnan nnn nnna 12 54 12 64 21 VO SCAN Nte EE 12 55 12 65 oi a n 12 56 12 66 STATUS TD ssssgeekssesssksesEeueekNEEEEEEEESNEOERVESEKEEEEKEREREANEEEAKECEEECEEAEEERKKEEEKEEREEEKEREEN 12 56 12 67 STEPCOUNE CH sssvisvceicstescstacncassscsadinttadecassaanataaserisacssadeseussassascanntsanndaansian 12 60 12 68 STEPCOUNTABS C h eegeecreeeegeeueebCeeuECNRSNEeE EENS adarna anana 12 61 12 69 SIEPHOME ch esesessessgesgesssegkssessssekERSVEENGSEREESEKEESEEEEKEESEEEEKEENENER KREE NEEE NEEN 12 61 12 70 STEPMOVE ch de TT dl 12 61 12 71 STEPMOVEABS ch poston F ssssssssssnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnana 12 63 12 72 SIEPSPEED h EE 12 64 12 73 STEPSTOP C E 12 65 A TRIANGLE Dok RESEARCH Page x INTERNATIONAL USER MANUAL 12 74 SIRS N STIRS NM A eseseegesseuieretrsseekeguseebteeeNeeENEESSREEEESRENEEEKESRREEEEEENeeEEN 12 65 12 75 SIRC MP A S B isiin adis ca eect ndisans dee acces wannaccanexadansanennwancanaxansunennonduane 12 65 12 76 SST ssacitcs ac ctcsidecdiratns an cawunansnaneacaueiinadeienctunauuasdwuubewannsnemecnnnanaesaes 12 66 12 77 STRUPRS AS sssiisssscsisstsses
166. dup feature which will avoid integrating the erorsignal when output is already saturated 12 24 Chapter 12 Important When this statement is run the integral and differential terms of channel ch is set to zero Hence PlDdef should be run only once during initialization and not repeatedly executed Otherwise the PIDcompute function will not run propery because of the lossof integral and differential data See Also PIDcompute 12 38 PMON ch PMOFF ch Purpose PMON enables Pulse Measurement Function at channel ch whereas PMOFF disables the channel After enabling the channel you may then use the functions PULSEWIDTH ch and PULSEPERIO D ch to obtain the width and period of the input pulses amiving at the pulse measurement input pin You must call PMON once duning initialization to enable the pulse measurement hardware Otherwise the two functions will only retum 0 You should avoid repeatedly executing PMON function otherwise the pulse measurement hardware will be reset repeatedly as well and accurate measurement cannot be obtained If you no longer need to measure the pulse width or period for a particular channel which has been PMON before you should disable it using PMOFF to save CPU time because pulse measurement is interupt driven and consumes CPU time Example PMON 1 PMOFF5 See Also PULSEWIDTH PUSEPERIO D PULSEFREQ UENC Y 12 39 PRINT n x vz Statement Purpose To send a string of ASCII characters
167. e altematively you can move it around copy it to another destination or delete it entirely using commandsin the Circuit menu O De TRIANGLE 7 4 UR RESEARCH INTERNATIONAL Chapter 7 7 2 2 Insert Circuit This command enables you to insert a new circuit just before the curently selected circuit The current circuit number will be increased by one while the new circuit will assume the current circuit number You will be placed in the Circuit editing mode for immediate circuit creation 7 2 3 Move Circuit You can rearrange the order of the circuits by using this command Select the circuit you wish to move and execute the Move Circuit command then select a destination circuit location and press lt Enter gt The selected circuit will be moved to the new location before the destination circuit Note that if you wish to move a block of circuits to a new location you may find it more productive to use the Cut Circuit and Paste Circuit commands in the Edit menu 7 2 4 Append Circuit Execute thisto add a new circuit to the ladder logic program This new addition willbe positioned immediately after the last circuit in the entire program 7 2 5 Delete Circuit This command allows you to delete the one or more circuits You will be prompted to enter the range of circuits that you wish to delete Please note that you can t UNDO a delete circuit operation r G 7 5 INTERNATIONAL Chapter 7 7
168. e TLServer Since no filename has been specified the default file in the web server root directory index html is loaded This HTML file is written in Javascript to provide some other options To start the TRILOGI as an applet select the appropnate option and the TL6Appletjar file will be loaded from the TLServer into your browser for execution Oo gt TRIANGLE S TRY RESEARCH 9 3 INTERNATIONAL Chapter5 Note The TLServer s root directory is not the same as the PC s root directory In TLServer the root directory is actualy at C A TRILO G N TL6 public This is the directory where the index html and TL6EApplet jar file are stored and these files are served to the web browser when you enter the Leners IP Address as mentioned above Visitors have no access to the PC s file directory above the servers root directory so the content of your other PC files will not be at risk of being exposed to visitors to TLServer Disabling TRILOGI Applet If you want to prevent visitors to TLServer from loading TRILOGI Applet at all just remove the TL6Applet jar file from the directory C TRILOG N TL6 public In that case you can only access the PLC using the TL6 application program Ti Bae 5 4 INTERNATIONAL Chapter6 Chapter 6 Ladder Logic Programming Tutorial GC TRIANGLE URA RESEARCH L NO INTERNATIONAL Chapter6 6 LADDER LOGIC PROGRAMMING TUTORIAL Your Assignment Creating Your First Ladde
169. e coil remains energized all the time the counter will not decrement Hence counter is suitable for counting the number of cycles an operation hasgone through When the count register hits zero all the counters N O contacts will be tumed ON These counter contacts will remain ON regardless of whether the counters Ca TRIANGLE _ URA RESEARCH 9 5 LAS INTERNATIONAL Chapter9 coil is energized or not To tum OFF these contacts you have to reset the counter using a special counter reset function RSctr 9 2 Special Bits i TRILOGI contains a number of special purpose bits that are useful for certain applications These include 8 clock pulses ranging from periods of 0 01 second to 1 minute a Nomally ON flag and a First Scan Pulse etc To use any of these bits enter the ladder editor and create a contact when the I O table pops up scroll the windows until a Special Bits menu pops up This menu is located afterthe Counter Table and before the Input table as shown below VO Labels Ea al Special Bits Le el Label Name BH SegN x Normally ON 1st Scan 0 01s Clock 0 02s Clock 05s Clock m 0 0 0 2s Clock D il 1 min Clock RTC Error 9 2 1 Clock pulse bits The 8 clock pulses supported by i TRILOGI are Tigi Bae 9 6 INTERNATIONAL Chapter9 A clock pulse bit is ON for the first half of the rated period then OFF for the second half Duty cycles for
170. e expression becomes false It is possible to break out of a WHILE loop using the GOTO command or the EXIT command only on PLCs with r75 or higher firmware Be careful that the WHILE loop will not be an endless loop as the PLC will appear to freeze up being trapped in an endlessloop execution TRILOGI simulator attempts to detect this situation by giving a waming message if a loop is executed for an unduly large number of loops Adding a break condition using GOTO or EXIT makes for more reliable WHILE loops WHILE S 1 IF INPUT 1 amp amp H0002 S 0 ENDIF ENDWHILE Execution will only be terminated when input 2 is ON WHILE loops may be nested i e a WHILE loop may be placed within the context of another WHILE loop Each Loop must have a separate ENDWHILE statement to mark the end of the loop 12 83 WRITEMODBUS ch DevicelD address data Purpose Comments Parameters ch eD TRIANGLE URA RESEARCH L SC INTERNATIONAL Automatically write the 16 bit data to a MODBUS device using the MODBUS RTU ASCII protocol The communication baud rate isthe default baud rate of that COMM port unless it hasbeen changed by the SETBAUD command The command automatically checks the response string received from the slave device for the correct LRC and the Slave address The status of the operation can be checked by the user program by testing the SIATUS 2 function which will retum a 1 for successful command and a
171. e following data are defined More parameters may be defined in future Some commands are specific to a PLC model and these will be mentioned in the relevant section of the hardware manual D data Description Tri RESEARCH 12 45 INTERNATIONAL Chapter 12 12 64 1 Com Response Wait Time The data value determines the of wait states multiple of 0 15s for serial and 0 20s for Ethemet to wait fora response from a slave controller after executing a NETCMD READMODBUS WRITEMODBUS READMB2 or WRITEMB2 command Note For PLCs with firmware before r77 the Ethemet port wait time is a multiple of 0 5s instead of 0 2s which is for PLCs with firmware r77 or higher The sral wait time is 0 15s for all firmware versions For Nano 10 FMD and F series PLCs Only SETSYSTEM 1 data affectsthe 4COMM ports COMM4 is Ethemet client connection individually where bit 0 amp 1 are forCOMM1 bit 2 amp 3 are forCOMM2 bit 4 amp 5 are for COMM3 and bit 6 amp 7 are for COMM4 By default data is set to amp H55 binary 01 01 01 01 which means a 2 wait multiple is used for all4 COMM ports This is about 0 30s for all 3 serial COMM ports and about 0 40s the Ethemet port PLCs with r77 or higher firmware Bit 76 54 32 10 dddddddd qata dd dd dd dd Comm port 4 3 2 1 dd 00 01 10 11 ofReties 1 2 3 4 Note maximum 4 retres In order to change the wait states for COMM3 you have to
172. e ladder program After that it will be permanently tumed OFF This is useful if you need to initialize certain conditions at the beginning When the program is transferred to the PLC this bit will only be ON when the PLC is first powered up or after it has been reset 9 2 5 Real Time Clock Error RTC Err FMD and Nano 10 PLC This bit is tumed ON if an Nano 10 or FMD PLC does not have one of the following installed FRAM RIC FRAM RIC 0 FRAM RIC 256 or I2C FRAM RIC and the clock hasbeen reset due to power failure or watchdog timer reset This gives waming to applications that require a comect real word time such as scheduled ON OFF operation that the clock data is incorect hence enabling corective action to be taken F Series PLC Since the F Series PLCs do not use the MX RIC and instead have an on board batterbacked RIC the RIC Emor event occurs if the RIC is conupted or damaged see the F Series User Manual section 12 8 for more detail or if the battery is not installed The special bit is called RIC Er and can be obtained from the Special Bits I O Table The RIC Em contact can be used to activate an alam of some kind M Series PLC Legacy This bit is tumed ON if the M series PLC does not have battery backed MX RIC option and the clock has been reset due to power failure or watchdog timer reset This gives waming to applications that require a correct real word time such as scheduled ON OFF operation that the clock data
173. e location of your PAUSE statement This unfortunately means that you need to modify your program in order to break the PLC program ata certain location Although it may be only a small effort to add and delete PAUSE statements in the TBASIC program and then re run the test immediately during simulation if you don t use the simulator but instead debug your program directly on the PLC then you must re transfer the program to the PLC every time you add or delete a PAUSE statement This can be time consuming if your program is large or you have a very long custom function So the new BREAKPOINT features described in the next section can be good a time saver 10 7 2 Using Breakpoints Starting from i TRILOGI version 6 45 a new Breakpoint feature has been added to the program so that debugging can be more easily performed without the need to modify and transfer the program to the PLC The Breakpoint feature is supported on all Super PLCs with firmware version r78 and above The break point feature is always available to the simulator in this software version but the program doesnot let you send the program break points to a PLC with fimware olderthan r78 To set a break point in any part of the TBASIC program open up the custom function and place the cursoron the line where you want the program to pause when it reach the line Then click on the Toggle Breakpoint button to set the break point A breakpoint that is set will be shown up asa blue rec
174. e or more circuits You will be prompted to enter the range of circuits that you wish to delete Please note that you can t UNDO a delete circuit operation 8 6 Help Menu All contents in this manual are available for instant reference on the computer where the TRILOGI program is running This includes running the applet version of TRILOGI program on a remote browser because the relevant help files will be retrieved from the TLServer automatically You can call up the help files anytime by pressing the lt 1 gt key You can also select the Content item from this Help menu to bring up the content page of the entire on line TRILOGI help files On the content page you can find the links to the Ladder Logic Editorand the entire TBASIC language reference There isa TRILOGI Upgrade link in the Help menu that allows you to obtain the latest Intemet TRILOGI upgrade setup program from the Intemet Simply follow the instruction to enter the website using the supplied usemame and password to obtain upgrade On TRILOGI version 6 1 there is also a special command called Chinese LCD Code Converter on the Help menu This is to help generate the escape sequences for special LCD model that can display Chinese characters Its function will be covered in the Chinese LCD installation and user guide and is not needed by non Chinese LCD users Instant Help for TBASIC Keywords Ten Resear SE INTERNATIONAL Chapter8
175. e run time emors to enable debugging The possible run time errors are listed in the following table and they are generally self explanatory TEST BIT position out of range STEPSPEED channel out of range Illegal Pulse Rate for SEPMOVE Illegal acceleration for SEPMOVE STEPMOVE channel out of range STEPSTOP channel out of range Ti DE e INTERNATIONAL Chapter 10 ADC channel out of range DAC channel out of range LED Digit within 1 12 Only PWM Channel out of range LCD Line must be 1 4 Only PM channel out of range System Variable Index Out of range Shifting of A 2 Out of range Illegal Opcode Please Inform Manufacturer Timer or Counter Out of Range RESEARCH INTERNATIONAL fei TRIANGLE 10 29 Chapter ll Chapter 11 TBASIC Statements Functions Operators and Variables GC TRIANGLE URA RESEARCH U N INTERNATIONAL Chapter11 11 TBASIC STATEMENTS FUNCTIONS OPERATORS AND VARIABLES 11 1 What are TBASIC Statement and Functions 11 1 1 STATEMENT A STATEMENT is a group of keywords used by TBASIC to perform certain action A statement may take 0 1 2 or more arguments The following are some TBASIC statements PRINT LET IF WHILE SETLED etc 11 1 2 FUNCTION A FUNCTION acts on its supplied arguments and retum a value The retumed value may be an integerora string A function can usually be embedded within an expression as if it is a vanable or a const
176. e used to indicate thata program hascompleted one cycle and isready fora new cycle Accessing individual steps of the sequencer is extremely simple when programming with i TRILOGI Simply create a contact NC or NO in ladder edit mode When the I O window pops up for you to pick a label scroll to the Special Bits table as follow D kE VO Labels x Special Bits v gt SegN x Normally ON 1st Scan 0 01s Clock 0 02s Clock 0 05s Clock 0 1s Clock 0 2s Clock D 1 1 m 5s Clock Os Clock min Clock RTC Error II L The Special Bits table is located after the Counters table and before the Inputs table Then click on the SeqN x item to insert a sequencer bit You will be prompted to select a sequencer from a pop up menu Choose the desired sequencer 1 to 8 and another dialog box will open up for you to enter the specific tep number for this sequencer Each step of the sequencer can be programmed asa contact on the ladder diagram as SeqN X where N Sequencers 1 to 8 X Steps 0 31 e g Seq2 4 Step 4 of Sequencer 2 Seq5 25 Step 25 of Sequencer 5 Although a sequencer may go beyond Step 31 if you define a larger SV for it only the first 32 steps can be used as contacts to the ladder logic Hence it is necessary to limit the maximum step numberto not more than 31 TR RESEARCH 9 16 INTERNATIONAL Chapter9 9 4 1 Special Sequencer Functions Quite a few of
177. e user can quickly determine the IP addresses that they can use to access the PLC The following are some possible IP address scenanios 1 If the computer is not linked to any network or the Intemet and doesnot have any network adapter installed then only the local host IP address will be displayed e g 127 0 0 1 9080 where 9080 is the port number Note regardless of whether your PC is networked ornot the local host IP address 127 0 0 1 is always available to the client program running on the same PC where the TLServer is running even though it may not be displayed on the TLServer s front panel TRILOGI or TRi Excellink are all eD TRIANGLE R URA RESEARCH 4 2 LAY INTERNATIONAL Chapter 4 Using TLServer known as client programs So whether your PC is networked or not you can still use TLServer and i TRILOGI on a localhost connection In that case the i TRILOGI and TLServer work together on the same PC just like a normal Window based programming software We recommend using the localhost IP address 127 0 0 1 9080 if you are running both the client and the serveron the same PC 2 Ifthe computer hasan always on connection to the Intemet directly then the IP address will be your Intemet IP address 3 If the computer is networked to the corporate Intranet or you have connected this computer to a router to share intemet connection with a few other computers then the IP address shown is an intemal IP address al
178. each full acceleration from standstill and the number of steps from full speed to a complete stop Comments The stepper motor calculates and performs the speed trajectory according to these parameters when the command STEPMOVE is executed STEPSPEED command should be executed at least once before executing any subsequent STIEPMOVE command to control the pulse generation The defined parameters will be remembered until another STEPSPEED statement operating on the same stepperchannel is executed again Examples STEPSPEED 2 2000 20 The PLC s Stepper motor controller channel 2 is configured to send out pulses at 2000 pulses per scond when STEPMOVE instruction is executed It follows a linear acceleration trajectory which takes 20 pulses to reach the full speed of 2000 pps This is equivalent to an acceleration of ve 20007 a 4 2x20 100 000 pulse s2 Tri Boss 12 64 INTERNATIONAL Chapter 12 12 73 STEPSTOP ch Purpose Examples Important See Also 12 74 STR n To abort a stepper channel ch that is in motion due to exceptional circumstances NOT intended for normal motor control operation SIEPSTOP 2 Motion aborted by STEPSIOP command will not trigger the end motion relay rspecified in the SEPMOVE command STEPC OUNT STEPSPEED STEPMOVE STR n d Purpose Examples Comments To retum a string that represents the decimal value of the numenc argument n If the second format is used then th
179. ect Password This is provided by your ISP and you should contact your ISP or System Administrator if you don t know what it is or if you don t know if you need it Port to Relay PLC Email If the TLServer is setup to be the email relay server for the PLCs TLServer will be listening on this port for a SMTP connection from the PLC The default port number is 9025 This port number is to be used as the SMTP port on the PLC s Ethemet amp ADC Configuration screen in order for the TLServer to relay the email content to the actual SMTP server that requires authentication Please see Email Method 3 Using TLServer as Email Relay Server for description onon this topic Important your PC s firewall must be setup to allow connection to thispor from other devices on your network in order for TLServer to work as an email relay server forthe PLC E g If the PC running the TLServer has IP address 192 168 1 100 and the Port to Relay PLC Email is set to 9025 then if the PLC wants to use TLServerasa SMTP relay server it should configure its Ethemet port settings as shown below Gateway IP Addr Node Name SMTP Server IP port F server FServer Port 9080 Timeout 120 Fserver MBTCP MBTCP Port 502 Secs 20 FTP Timeout s 120 LAN Speed 100Mbps ei EN Email Test You can test your email configuration by clicking the button once you have entered all the correct settings Once you click the Email Test button TLServer wi
180. ectrical circuit diagrams used for wiring control systems in the electrical industry The basic purpose of an electrical control system is to determine whether a load should be tumed ON or tumed OFF under what circumstances and when it should happen To understand a ladder program just remember the concept of current flow a load is tumed ON when the current can flow to it and is tumed OFF when the curent could not flow to it The fundamental element of a ladder diagram isa Contact A contact has only two states open or closed An open contact breaks the curent flow whereasa closed contact allows curent to flow through it to the next element The simplest contact isan On OFF switch which requires extemal force e g the human hand to activate it Limit switches are those small switches that are placed at certain location so that when a mechanical device moves towards it the contact will be closed and when the device moves away from it the contact will be open If a contact is connected to a load and the contact is closed the load will be tumed ON This simple concept can be illustrated by the most basic ladder diagram as follow Switch Lamp j OLIT The vertical line on the left is the Power line current must flow through the Switch contact in orderto tum ON the load Lamp In fact there should be a second vertical line on the right end of the ladder diagram to provide a retum path forthe curent flow but this is omitted to s
181. ed by the HSCDEF statement However if more than one HSCDEF for the same channel ch is executed only the last executed HSCDEF statement will take effect Hence you should put the next HSCDEF statement within the CusFn triggered by the first HSC DEF By chaining the HSCDEF statement from one CusFn to another you can control the motion of the machine using Ti ae 12 9 INTERNATIONAL Chapter 12 the HSC value to execute a series of CusFn one by one Within these CusFn you can program what to do to control the motion E g changing the speed putting on the brake change direction of motion etc You can use the SETO CLRIO for digital ON OFF control and setDAC setPWM for proportional control Example HSC PV 1 0 HSC DEF 1 19 3310003 SETLC D 1 1 STR HSC PV 1 6 Comments Enable High Speed Counter 1 and make it activate function 19 when the counter reaches 33 100 003 Present value of HSC 1 was cleared to O before activating it Note that TRILOGI Version 5 x does not perfomm simulation of the High Speed counter operation since there is no High Speed Counter inputs on the simulator screen Note that the HSDDEF statement will also activate the Pulse Measurement hardware as described in the Pulse Measurement section of the Nano 10 FMD senes and F series User Manuals does not apply to the legacy TLOOM seres PLCs See Also HSC O FF 12 17 HSCOFF ch Purpose Disable High Speed Counter ch ch 1 to 8 If you n
182. emet connection then you must run TLServer in order to program or configure the PLC To Start TLServer double click on its Icon and a TLServer panel will appear You can minimize TLServer but it should be actively running in order to service network requests from i TRILOGI via the Intemet orlocal area network 2 2 i TRiLOGI Client Software Versions i TRILO GI client software is available in two versions 2 2 1 Java Application The i TRILOGI program as well asthe J VM see below must be locally installed in the PC that it runson 2 2 2 Java Applet The client computer only needsto use a J ava enabled Web browser such asthe Intemet Explorer 6 x or Mozilla Fire Fox to invoke the i TRILOGI applet that is stored in the TLServer There is no need to install the i TRILOGI software in the local computer GC TRIANGLE z URA RESEARCH Se LAY INTERNATIONAL Chapter 2 Introduction To I TRILOGI 2 3 i TRiILOGI Application vs Applet Which is Better Application Starts up immediately Can read write TRILO GI files to local hard disk orto TLServer Can accessany TLServeron the network Program behavior predictable since the copy of JVM islocal No need to install any software or VM at the client computer Possible to control your PLC via any CyberCafe orata friend s house Maintenance and Upgrading of software issimple since only one copy of the TL6x jar file needsto be changed Centralised storage of program
183. ent that is capable of talking to your PLC e g another PLC oran instrument that can communicate with the PLC via Modbus protocol then the precision intrument can measure the DAC output of the PLC and write the measured readings into the DM 1 to DMI4 of the PLC which can also be used by the ___SEMDAC amp Reedominjtooma button to read the measured readings easily Ti Bae 8 39 INTERNATIONAL Chapter8 Once the reading has been obtained just click on the Calibrate Analog Outputs button to complete the calibration We have therefore reduced the analog output calibration to a simple two step process which can be easily handled by any production operator during production of an OEM equipment 7 Communicating with the PLC This program communicates with the PLC via the same user interface asall other communication functions under the Controller menu This means that the Calibration tool will be communicating with the PLC using the TCP IP protocol If the PLC hasa built in Ethemet port then it should be connected to an Ethemet router or switch with a preconfigured private static IP address If the PC isalso on the same network then you simply login to the PLC server using the private IP addressof the PLC However if you do not know or have lost the IP address of the PLC then it is still possible to calibrate the PLC s by connecting the serial ports on the PLC to the PC In this case you will need to run
184. enter the SV for the timer SV range is between 0 and 9999 Enter the value 1000 at this location 3 Fora nomal timer with 0 1s time base the value 1000 represents 100 0 seconds which means that the Duration timer will time out after 100 0 seconds If the timer had been configured as High Speed Timer using the TBASIC HSTimer command then the time base would become 0 01s meaning the value 1000 represents only 10 00 seconds 4 We are now left to define the sequencer Seq1 The sequencer is an extremely useful device for implementing sequencing logic found in many automated equipment i TRILOGI supports 8 sequencers of 32 steps each Each sequencer requires a Step counter to keep track of the current step sequence The first 8 counters in the counter table double asthe step counters for the 8 sequencers These sequencers must be named Seq1 to Seq8 if they are to be used i e Counter 1 to be named as Seq1 Counter 2 as Seq2 etc However any counter not used as sequencer may assume any other name up to a maximum of 10 characters if they are used as Ordinary counters If you are at the Timers table pressing the right cursor key again will bring up the Counters table Enter the name Seq1 at the label column for Counter 1 Press lt Enter gt and the text entry field will be opened at the Set Value column For now let s entera preset value of 4 for Seq1 Ti Bae 6 4 INTERNATIONAL C
185. enu screen display and some online help texts may be shown in other intemational languages including the CJK There is even an option in the language text file for you to increase the text size by several points to make it clearer to display some intemational characters such as Chinese orsimply to make it easierto read the menu and help text Several language files are currently available for download from the I TRILOGI upgrade website Language ISO Abbreviation Language specific file English en en_language txt Spanish es es language txt Chinese Zh zh_language txt Users of other intemational languages can create their own specific language help text by copying the en _language txt file into a file named as ox language D where xx is the two character ISO abbreviation of the language For example to create a Korean language help text you need to copy the en_language txt file into a file name ko_language txt and then edit the file to translate the relevant English text into Korean language Even ED TRIANGLE 7 Tea RESEARCH 1 9 LI INTERNATIONAL Chapter1 I TRILOGI Setup Guide English language user may modify the content of their pull down menu and on screen display by modifying the en_language txt file You can open some of the supplied language files e g English vs Spanish to understand how the English language itemsare translated to another language When the i TRILOGI version
186. er simply by setting its CTRPV vanable to any integer value between 1 reset counter and 9999 so it is not necessary to change the counter S V TR RESEARCH 12 37 INTERNATIONAL Chapter 12 The present values P V of counters can be read or written directly as integer variables CtrPV n But the Set Values can only be changed by this function See Also GetCtrSv _ GetTimerSV _ SetTimerSV 12 54 SET IPAddr dmindex Purpose To set the IP address of this PLC s built in Ethemet port using the parameters stored in DM dmindex to DM dmindex 4 Comments To change the IP address of a PLC s Ethemet port you can load the new IP address and port number into the variables DM 100 to DM 104 e g from a HMI panel and then invoke a function that runs SET IPAddr 100 to write the new IP addressinto the PLC For Nano 10 and FMD PLCs you should soft reset using the RESET or SETSYSTEM 252 0 command and restart cold boot the PLC after changing the IP address so that the new IP address will be saved into the virtual EEPROM The PLC will only assume the new IP address after it has been rebooted via the RESTARTCommand or power on reset Example DM 100 192 DM 101 168 DM 102 1 DM 103 101 DM 104 9080 SET IP 100 Set the IP addressto 192 168 1 101 9080 Note This Command is ignored by i TRILOGI simulator 12 55 SETDimmer ch value Note Applicable only to F series PLCs CL EI TR TRIANGLE
187. er to the Integer Constants Variables and Operators section or the String Constants Variables and Operators section for more information on how to use the define table in yourPLC program 10 4 How to Use A Custom Function It is important to understand when and how a TBASIC based Custom Function is executed with respect to the rest of the program There are basically two ways in which a CusFn will be executed 10 4 1 Triggered by Ladder Logic Special function coil CusFn A custom function may work the same way as any other special functions in the i TRILOGI ladder diagram programming environment When you are in ladder Circuit editing mode press lt ns gt key to open the Ins Element menu Select the item 8 FUNC or 0 4FUNC to create a special function output A pop up Selecta Function menu will appear Tri Boss 10 13 INTERNATIONAL Chapter 10 LES i TRILOGI Version 6 45 D TRILOGKTL6 usr samples Demo PC6 Source Local Disk lo amp ss File Edit Controller Simulate Circuit Help omg Sn a ETC ra elect a Function DNCtr Decrement Rev Counter RSCtr Reset Counter Upctr Increment Rev Counter AVseq Advance Sequencer RSseq Reset Sequencer StepN Set Sequencer to Step N Latch Latching Relay Output Clear Clear Latched Relay ILock Interlock Begin ILoff Interlock End ADIFU Differentiate Up ADIFD Differentiate Down CusFn Custom Function
188. es the browse mode and the Circuit editing mode We shall explain the operation of both modes 7 1 The Browse Mode You are nomally in the browser mode when you start up the program The browse mode allows you to manipulate the whole ladder logic circuit asa single entity you can view any circuit make copies of it move it to another location or delete it entirely Each complete ladder logic circuit is given a circuit number You should see a small red color marker showing you the curently selected circuit The circuit number of the selected circuit is shown on the upper status line as Circuit Xxx 7 1 1 Mouse Actions Since i TRILOGI Version 6 runs under windowing environment all usual mouse action applies You can grab the vertical scroll bar to scroll to your desired circuit and click on it to select it Double click on a circuit enters the Circuit Editing Mode which will be described later 7 1 2 Keyboard Actions The functions of various keys in the browse mode are explained below 1 lt Spacebar gt Allows you to enter circuit editing mode for the curently selected circuit If the selected circuit isa comment circuit the comment editor willbe opened automatically 2 lt 1 gt Activatesthe context sensitive help function to display on line help 3 lt 2 gt Opensthe I O Table to create the I O Label Names 4 lt 43 gt Tums ON OFF display of the I O type and the physical I O number for ladder logic contacts on the sc
189. es that contain the i TRILOGI Java Applet to enable you to use any Java enabled Web browser to access the PLC without the need to install a local copy of the i TRILOGI application software TLServer 3 17 now supports large font size increment so that it can display larger graphic on high resolution monitor on small screen Note TLServer also provides File and Email Services to the PLC That means that a PLC can send a command to the TLServer to open a file and save its data into the PC s harddisk TLServer 3 17 now also features an Email Relay Server to help PLC send out emails via authenticated SMTP servers The new Email Service works differently from the orginal email function provided in TLServer 1 0 in that TLServer does not poll the PLC instead it is the PLC that initiates an email request asynchronously This makes it possible fora PLC to dial in via a modem to request the TLServer to help it send out an email without demanding a constant connection the TLServer However the orginal email function is still supported in Version 3 x because that has the advantage of being able to service email requests for multiple PLCs linked via the RS485 network When TLServer is first started it will query the operating systems for the IP addresses of the computer that it runs on It may take a while if the O S is sow to retum the IP address It will then display the obtained IP addresses maximum of two on the TLServer front panel so that th
190. ese newer PLCs will NOT be forced to 9600 bps unlike that of the RS232 port on the M seres PLCs Since the PLC s serial port is set to 9600 bps when power ON with DIP Switch 4 set you will need to change the baud rate temporarily in order to communicate with the PLC e g to disable a program that causes trouble Port Name COMS V Baud Rate Port Name COMS v Baud Rate KZ v Data Bits 8 v Data Bits 8 v Stop Bits 1 v Parity None v Parity None V Time Out ms 500 Close Port gt Close Port O Command String Press lt Enter gt to Send Command String Press lt Enter gt to Send Response Strings amp Modem Messages Response Strings amp Modem Messages COMS opened at 38400bps COM opened at 38400bps Please close port before changing any parameters Please close port before changing any parameters COM5 opened at 9600bps emm Change PLCID Fi Hep Change PLCID F1 Help However do remember to change the baud rate setting back to 38400 bps after you have reset the PLC with the DIP switch OFF otherwise you may have problems communicating with the PLC later on since changes to comm settings are automatically saved NOTE The Nano 10 FMD and F seres PLCs will be forced to the default baud rate of 38400 bps with 8 data bits 1 stop bit and no parity when started in pause mode for all 3 seral po
191. et to a certain default baud rate which the PLC will assume every time its powers up The baud rate may or may not be changed depends on the PLC model Please refer to the PLC s User s manual for the baud_no that represent the baud rate of each seral channel and the range of baud_no each of these serial ports may assume Caution should be taken when programming the baud rate of the Host link port because if a wrong baud value is set the host PC may not be able to communicate with it If this happens suspend the PLC using its hardware switch such as DIP switch 4 on the FMD or F series PLCs and jumper 4 on the Nano 10 and re load the program with the Comect settings Consult chapter 1 of your PLCs reference manual for more details on regaining serialcommunication Examples SETBAUD 3 3 Set serial port 3 to 9600 12 52 SETBIT vn Purpose To set the bit n of the integer variable v to 1 v may be any integer vanable or a system vanable such as relay n output n etc The range of n depends on the PLC fimware version as follow PIC Fimware Before 178 78 orlater n is an integer constant or variable of value between 0 and 15 or between O and 31 Following digital electronics convention bit O refers to the least significant bit rightmost bit and bit 15 the most significant bit leftmost bit of the 16 bit variable and bit 31 is the most significant bit of a 32 bit integer vanable For older PLC firmware be
192. eters ch ID addr var CA v TRIANGLE URA RESEARCH LAS INTERNATIONAL Applicable to all Nano 10 FMD Seres and F series but only to the legacy TLOOMD MX PLC with firmware r44 or higher Think of this as the multi word version of READMODBUS command Unlike the READMODBUS command which is a function that retums a single 16 bit word this command is implemented asa statement so that multiple words of data can be stored into the PLC intemal memory PLC COMM port number 1to 8 using Modbus ASCII or 11to 18 using Modbus RTU Device ID of the MODBUS slave device 1 to 255 Zero offset address of the holding register in the MODBUS Slave device starting from 0 40001 the starting variable in the master for storing the retumed data may be a DM orany system vanable 12 28 count Example Comme Special See Also nts Chapter 12 number of variablesto read max 16 READMB2 3 5 101 DM 10 8 The PLC will use MODBUS ASCII protocol via its Comm port 3 to query the slave MODBUS device with ID 05 and ask for 8 words of data starting from register offset address 101 in MO DBUS tem this refer to the 40102 holding register Once it receives the retumed data these 8 words will be stored in the memory locations DM 10 DM 11 DM 17 This command automatically checks the response string received from the slave device forthe corect slave address and LRC or CRC16 RTU protocol i
193. execute the following two statements SETDAC 1 2048 SETDAC 2 2048 Your PLC will then output an uncalibrated analog output voltage on the DAC which you can then measure with a precision voltmeter If your analog outputs are configured for the 0 to 5V range then ideally at 2048 you expect the DAC to outputa voltage 2048 4096 5 000 2 500V However assuming that your precision voltmeter measures a voltage of 2 510V at DAC 1 and 2 488V at DAC 2 you will then need to convert the two measured readings to the range of 0 4096 and then enter into the Measured DAC fields For DAC 1 the measured reading 2 510 5 x 4096 2056 and for DAC 2 the measured reading 2 488 5 x 4096 2038 Enter these two values into the table as shown in the above diagram After you have entered all the above parameters you can then click on the Calibrate Analog Outputs button to start calibration of the analog outputs The program will compute the calibration parameters based on the SETIDAC and ED TRIANGLE _ I RESEARCH 8 38 LI INTERNATIONAL Chapter8 the Measured DAC write them into the PLC and then reboot it to complete the calibration 3 Automating Analog Output Calibration The procedure described in the last section may be a little bit tedious to work with since it involves several manual steps and require measuring the analog output readings and convert them into the 0 4096 range It however illustrates the principle used by t
194. exible for you to distribute self upgrade forthe end users The TL5 Uploader program can be obtained by emailing to sales tn plc com and installed by first unzipping the Install TL5 Uploader zip file found in your i TRILOGI Version 6 x CD ROM orand then run the Setup exe program Please note that the TL5 Uploader is a copyrighted program and Triangle Research Intemational is the copyright owner of this program However Triangle Research Intemational authorize the licensed users of the i TRILOGI version 5 xx software to freely distribute the Install TL5 Uploader zip program to their end users at no charge Note 1 Although i TRILOGI version 6 x supports Unicode for its user interface the compiled code produced by TL6 is identical to that of TL5 and therefore the compiled file is still saved in ASCII format To maintain backward compatibility the Wrte Compiled Code to Disk function still produces CO5 file that can be uploaded using the TL5 Uploader program 2 Beginning from i TRILOGI version 6 41 you can also use the i TRILOGI software to transfer the CO5 file to the PLC This allows licensed i TRILOGI users to exchange compiled CO5 file without revealing the source code 8 1 8 Print You may use all the printing resources supported by your O S to print a selectable range of the ladder diagram the I O Tables or the custom functions When executed the following Print Control Panel will appear Ca TRIANGLE S U
195. ey doesnot work on J RE 1 4 x so we added the lt SHIFT gt key to achieve this action The position of the insertion point has no effect when you connect a parallel contact to the highlighted element The left terminal of the element will always be connected to the left side of the parallel branch gt to gt J gt amp lt E gt keys Pressing the key gt to lt O gt and lt gt is equivalent to clicking on the icon shown in the table The equivalent keyboard number is shown asa small numeral at the lower right comer of the icon The lt gt key is the quickest way of converting a nomally open contact to a nomally closed one and vice versa Pressing the gt key when a contact or coil is selected allows you to edit the label name directly Note that it is the users responsibility to ensure that the label is valid bei Bass 7 10 INTERNATIONAL Chapter8 Chapter 8 TRILOGI Main Menu Reference CA TRIANGLE URA RESEARCH UN INTERNATIONAL Chapter8 8 TRILOGI MAIN MENU REFERENCE Both TRILOGI application and applet programs have neanly identical look and feel as shown below with the exception that the applet can t save to orload from local drive e i i TRiLOGI Version 6 45 C TRiLOGKTL6 usr samples Demo PC6 S Je zel File Edit Controller Simulate Circuit Help Circuit 1 DAAA Gene Bookmark GEE Start Stop Run R il i2 A a Run Duration ri ti Int Run Step Man
196. f your program encounters undefined interupt eror in order to give the programmer a chance to investigate the cause that leads to the Undef Interrupt enor Applicable only to PLC with fimmware r74 and above 12 64 21 UO Scan Interrupt data 0 default do not process user interupt during UO san interupt latency determined by scan time data 1 process pending user interrupt even during I O scan to minimize interupt latency Available to PLC with firmware 50 and above 12 55 Chapter 12 12 65 SLEEP Purpose To put the PLC CPU into sleep mode to save power Comments Upon execution of this command the CPU will enter a low power sleep mode but it can be woken up by a seral interupt oran active I O intemupt However this will only save power consumed by the CPU and does not save the static power required by other components on the PLC circuit board Note 1 Command available only to PLC with fimmware r67 and above 2 Do not execute this command with active Ethemet connection as it can trigger the CPU to lock up into undefined interupt eror state Only application that are not connected to the Ethemet should use this command 3 Thiscommand isignored by i TRILOGI simulator 12 66 STATUS n Purpose Retum the status of various system operations Retumed values may be dependent on the PLC model Reset Status v 0 Normal power on reset v 1 Reset by Watch Dog Timer WDT Command Status Used to chec
197. files only at the server This is good for providing PLC program training Require local installation of TRILOGI software at every client computer Require installation of JVM atevery client computer May need to specify the proxy server IP addressif running behind a firewall Can only read write TRILO GI files to the TLServer but not to the local hard disk Can only accessthe TLServer from which it wasloaded May take a few minutes to load itself the first time if connect via dial up modem Thereafter the browser should cache it forrapid start up Program behavior may vary for different make ordifferent versions of the browser bei Wegen 2 3 INTERNATIONAL Chapter 3 Chapter 3 Interfacing to the PLC CA TRIANGLE URA RESEARCH UN INTERNATIONAL Chapter3 3 INTERFACING TO THE PLC This chapter will discuss how to interface to the Super PLC in terms of the most direct physical connection and the necessary software components for the purpose of programming and monitoring the PLC These procedures will be covered ina bit of depth to explain certain aspects so you may wish to reference the quick connect guides instead which are in the appendix of this document if you would like simple connection directions without explanations Physical Connection There are two direct ways to physically connect to Super PLCs for programming and monitoring from the i TRILOGI software 1 SERIA
198. fore r78 SETBIT only works on the lower 16 bits Please refer to page 10 4 in Chapter 10 TBASIC Statements Tal moe 12 36 INTERNATIONAL Chapter 12 Functions Operators and Vanables for the mapping between UO bits and the variables Examples SETBIT output 2 11 Comments output 28 will be tumed ON Output channel 2 bit 11 Output 17 11 28 See Also CLRBIT TESTBIT 12 53 SetCtrSV n value Purpose Change the Set Value S V of the Counter n to value This statement to allow the user to modify the SV of the PLC intemal counters without changing the source program A TBASIC function can be written easily to make use of a few digital or analog inputs to modify the SV of these intemals timers counters Parameters N should be between 1 and 128 Value should be between 0 and 9999 Examples Get trSV 10 1234 SetCtrSvV 3 GetC trSV 3 10 Counter 10 will assume a SV of 1234 S V of Counter 3 willbe increased by 10 Comments For F series PLC the new S V is stored in the onboard FRAM and hence is non volatile See sample program set_TC SV PC4 For Nano 10 and FMD PLC the new SV are only stored on RAM shadowed CPU flash memory and is nomally volatile unless a RESET or SETSYSTEM 252 0 command has been executed which forces a backup of the RAM shadow to the CPU flash memory Programmer should therefore use this command sparingly Note that TBASIC custom funciton can start a count
199. function by nght clicking on the selected name and select Open from the popup menu as shown below T TRIANGLE R RESEARCH INTERNATIONAL 10 5 Chapter 10 KE Custom Function 13 xFMDProg TER RAER Find Find All ALL wrtModel KS View Custom Function 14 sendNetCmd fx Input string X output string x PRINT 1 01 x Copy Se MID C X 1 2 select AlI IF STRCMPCT CF 0 T MID CX 3 2 ELSE IF STRCMPC T CT 0 T MID CX 3 4 ELSE IF STRCMPCT WA 0 OR STRCMPCT RA 0 T MID CX 4 2 sendNetCmd Cust Fn 14 Usage CusFn 13 15 33 39 4 eee IF TESTIOCIOTEST 0 AND TESTIOCF3 0 T ENDIF IF LENCT lt gt 0 ct DH n SETLCD 3 14 C c 7P1404 4c 10 2 3 Search Find It is now possible to search fora word or phrase in the current custom function local search orin all of the custom functions in your program global search To do a local search simply type the text in the command line below the Find and Find All buttons and then click the Find button If the text is found in the Current custom function it will be highlighted in the text editor as shown below Also the text Find only in this CusF will be displayed below the command line in the search area indicating a local search Each time the Find button is clicked the next instance of the search text will be highlighted until the text cant be found anymore At this point the
200. g TRILOGI many ways as follows a Wired connection to a router that the PC is also connected to PC connection can be wired or wireless b Direct connection to the PCs wired Ethemet port via crossover cable c Wireless connection to a wireless router if the PLC is connected to a wireless bridge adapter Only the first option which ismost common will be described here In a typical local area network LAN there would be one router wired or both wired and wireless that the network devices connect to one modem that provides Intemet to the router and the devices connected to the router such asthe PLC and PC Before You Begin The first thing you need to do is configure the network settings in the PLC to match those of the LAN This is typically done as follows O o gt TRIANGLE Tey RESEARCH 3 3 INTERNATIONAL Chapter3 1 Find out what your routers gateway address is typically 192 168 1 1 or 192 168 0 1 and what static IP addresses are free to use with your PLC NOTE if the routers gateway address is 192 168 1 1 the default PLC IP address 192 168 1 5 will most likely work unless it is already used by another device on the same network If it is free to use the next two steps canbe skipped asthe PLC will already be able to connect to the LAN N Connect to the PLCs seral port from the PC with TRILOGI and TLServer Edit the PLC network settings using the Ethemet amp ADC Configuration tool f
201. g environment can be started by selecting i TRILOGI Version 6 4 from the option list Server can be started by selecting TLServer Version 3 1 Note A short cut for TLServer is also created on the Quick Launch toolbar For Windows XP user you may have to right click on the tool bararea T TRIANGLE 1 8 R RESEARCH INTERNATIONAL Chapter1 I TRILOGI Setup Guide along the bottom of the screen and check the Show Quick Launch option in orderforthe quick launch tool barto appear TLServer Icon 1 6 Using TRILOGI 6 x with International Languages The main improvement in the new TRiLOGI version 6 x and its accompanying TLServer 3 x is that in version 6 x all data file storage and communication are conducted using the intemational standard Unicode UTF 16 instead of the ASCII code found in the earlier versions of TRILOGI software When used with Unicode aware Operating System such as the Windows 2000 and XP it is now possible to create program that uses non Latin based characters such as the Chinese Japanese Korean also known as CJ K Thai Hebrew and Arabic etc in their comments and UO label fields In addition version 6 x also includes some enhanced capabilities such as a EEPROM manager that allows reading wnting of the PLC sdata EEPROM directly within the TRILOGI software Intemet TRILOGI version 6 x and TLServer 3 x also allow users to customize their menu and on screen display so that the m
202. ghlighted in the text editor as shown below Also the text Find in all CusF will be displayed below the command line in the search area indicating a global search Each time the Find All button is clicked the next instance of the search text will be highlighted until the text cant be found anymore in any custom function At this point the first result will be highlighted again If no text matches the search text the message in the search area will change to Text Not Found KS Custom Function 1 EventCount TB x ER aj Control X 1 Initial value of X 0 paaa x SETLCD 1 1 Cycle Count STR X Find Pmd Ai x Find in All CusF NOTE Highlighting of text found in the editor during a user initiated search or during compilation emor tracking now works with JRE Java Runtime Environment 1 5 and 1 6 8 2 7 Goto lt Ctrl G gt Use this command to move towards a specific circuit number The Goto command is particulary useful if your program contains many circuits and it is inconvenient to search fora particular circuit using the mouse orthe cursorkeys 8 2 8 I O Table lt F2 gt Open up the I O Table for defining label names for the PLC s I O For detailed explanation of I O tables please click on the following link I O Definition Table 8 2 9 View I O Type on Ladder lt F3 gt Toggle between display or no display of the I O type and physical I O number for ladder logic contacts on the s
203. h as DM n for count then the range of movement can only be between 1 to 32 767 Speed pps Stepper pule output epend trajectory Ifthe total number of ateps to m ove Is less than 2 tim es eccsteps Desired speed all not be reached No of Steps i d d Pulse generation can be mtemupted by issuing a STEPSTOP command in another CusFn which may occurin cases when the hardware hits a limit switch and must stop the motor immediately When a stepper channel is already activated i e mid way through its pulse generation repeat execution of SIEPMOVE command on the same channel will be ignored by the PLC Re execution of the SIEPMOVE command on this channel can only take effect afterthe channel s pulsing operation has been completed by itself or aborted by the STEPSTOP command 12 62 Chapter 12 When in TRILOGI simulation mode execution of the STEPMOVE command will bring up a pop up window that displays all the parameters of the motion path Examples SIEPMOVE 1 5000 10 Send out 5000 pulses on channel 1 and at the end of motion tum ON relay 10 See Also STEPMOVEABS SIEPCOUNT STEPCOUNTABS STEPSPEED STEPSTOP STEPHO ME 12 71 STEPMOVEABS ch position r Purpose This Command allows you to move the stepper motor ch to an absolute position indicated by the position parameter Parameters ch Stepper Channel Range 1 to 8 position Step Count Range 23 to 231 r Comme gp ZE TRI
204. hapter6 5 We have now completed defining the I Os timers and counters Press the lt ESC gt key to close the counter or other tables Note that not all labels need to be defined before programming You may create the label namesany timer during circuit creation by pressing hotkeys lt F2 gt 6 3 Ladder Logic Programming Tutorial STEP 3 We are ready to create Circuit 1 as shown below Start Stop Run i i RLY Run Duration Int 1 With the circuit pointer red color triangle at Circuit 1 press the lt Spacebar gt to enter the Ladder Edit mode You can also enter the circuit edit mode by double clicking at Circuit 1 i TRILOGI Version 6 45 Untitled face File Edit Controller Simulate Circuit Help Circuit 1 Once you enter the Ladder Edit mode a row of ladder icons appear along the top of the main i TRILOGI window just below the pull down menu The following is a description of each item A yellow color highlight bar which you can move to select an element in the ladder circ uit will appear O De TRIANGLE 6 5 UR RESEARCH INTERNATIONAL Chapter6 lt 1 gt Left dick to insert a normally open series contact lt 2 gt Right dick to insert a normally dosed series contact lt 3 gt Left dick to insert a N O parallel contact to highlighted element lt 4 gt Right dick to insert a N C parallel contact to highlighted element lt 5 gt Left dick to in
205. he calibration routine In orderto automate the calibration of the analog outputs an additional button cl seated ai isincluded to assist with the task When you click on this button i TRILO GI will perform the following tasks 1 It clears all the old analog output calibration parameters for any analog output channel that hasa non blank entry into the SETDAC field It reboots the PLC so that the analog output from the PLC will be freed from any old calibration data It sets the comesponding analog output channel using the data entered into the SETDAC field It waits for one second and then read the DM 1 to DM 4 data from the PLC and store into the Measured DAC fieldsfor DAC 1 to 4 2 3 lt 4 Therefore if your PLC s analog inputs are already calibrated previously you can make use of your calibrated Analog inputs to measure your uncalibrated analog outputs and store the measured readings into DM 1 to DM 4 to be used by yourcalibration program What you do isto connect the PLC sDAC 1 to itsown ADC 1 DAC 2 to ADC 2 etc and then write a PLC program to read the ADC data take an average readings to even out white noise then write the average readings into DM 1 to DM 4 The SETDAC amp Read DM 1 to DM 4 button can then retrieve the measured DAC readings from the DM 1 and DM 2 in a single step to perform the Calibration Altematively if you have a precision measuring instrum
206. he same network then you simply login to the PLC server using the static IP address of the PLC Of course if the PLC s Ethemet port is already mapped to a public IP address then you can also remotely configure the PLC via the Intemet However if you do not know or have lost the IP address of the PLC then it is still possible to configure the PLC s Ethemet port by connecting the senal ports on the PLC to the PC However in this case you will need to run the TLServeron your PC and configure the sral port to work with the PLC s serial port The TR RESEARCH 8 22 INTERNATIONAL Chapter8 configuration tool will connect to the PLC indirectly via the TLServer software Click here for more details about TLServer Before you make any changes to the PLC s Ethemet configuration parameters it isa good idea to retrieve the current settings You can do this by clicking on the Retrieve Parameters from PLC button and answer Yes when prompted If your i TRILOGI is not yet connected to a TLServer software or directly to the PLC builtin hostlink command server known as F Server in the F series PLCs then you will see the login popup windows as follow Login To TLSever CS Server s IP Address Got 192 168 1 5 9080 _ Detect ID 1 PLC Only 1D Hex C localhost 127 0 0 1 9080 Use Http Proxy Server Username Password jw Memorize Username amp Password Cancel OK If you are connecting to the PLC vi
207. highlight barto the junction as follow 4 i TRILOGI Version 6 45 Untitled fo meal File Edit Controller Simulate Circuit Help ED TRIANGLE E URA RESEARCH 6 7 INTERNATIONAL Chapter6 Note The highlight bar will move to the junction if you click on the dark green insertion point on the Start contact f kE i TRILOGI Version 6 45 Untitled File Edit Controller Simulate Circuit 6 Next right click on the icon It will change into yellow color nommally closed contact as shown in the above diagram You are now inserting a nomally closed seres contact at the location of the highlight bar Pick the Stop label from the Input table to add the seriescontact i i TRILOGI Version 6 45 Untitled oo Si e File Edit Controller Simulate Circuit Help EE AH Pf of d d Fmt rll da lr GS Sto 7 We will now connect a relay coil Run to the right of the Stop contact Click on the icon to insert the coil Select RUN label from the Relay table Remember that an input can never be used aSa Coil Fortunately i TRILOGI is smart enough not to call up the Inputs table when you are connecting a coil to avoid unintentional errors Notice that the coil symbol RLY indicatesthat thisisa relay coil which is helpful in identifying the function of the coil i TRILOGI automatically places the coil at the extreme right end of the screen and completes the connection with
208. hown during simulation are taken from the PC s intemal real time clock values However subsequent values can be affected by the values assigned to the variable DATE n and TIME n The present values of the first 3 high soeed counters HSC1 to HSC3 are also shown on this page Note that ADC data for any particular A D channel n will only be shown if an ADC n function has been executed Otherwise the ADC value shown on screen will not reflect the true current value of the ADC port b Data Memory Screen T i TRIANGLE 10 19 RESEARCH LI INTERNATIONAL Chapter 10 The second screen displays in 25 pages the values of the 16 bit DM variables from DM 1 to DM 4000 Each page displays 16 rows x 10 columns 160 DM vanables You can scroll up and down the pages by clicking on the PgUp or PgDn buttons or using the cormesponding keys on the keyboard Starting from version 6 45 you can use two consecutive 16 bit DM variablesasa single 32 bit DM32 vanable in the following manner DM 1 amp DM 2 DM32 1 DM 3 amp DM 4 DM32 2 DM 2n 1 amp DM 2n DM32 n A new button iew DM32 n is added and when clicked toggles the view of the DM variables between DM and DM32 as shown below The range of DM 1 to DM 4000 are mapped to DM32 1 to DM32 2000 Note Although this version of TRILOGI allows you to view any super PLC s DM as DM 32 during online monitoring only new Super PLCs with finmware version r78 or l
209. ick any undefined I O you will be prompted to enter the label name and what you entered will automatically be updated in the I O table 3 The contents in the table are not nomally meant to be edited at this moment Scroll to the Input table and chckon the label name Start and a nomally open contact will be created at Circuit 1 Oo gt TRIANGLE p TRY RESEARCH 6 6 INTERNATIONAL Chapter6 sE i TRILOGI Version 6 45 Untitled e Il S eee File Edit Controller Simulate Circuit Help EE AH Pl of E FF lof Fol Sh gt ei Start If you observe the highlight bar carefully you will notice a dark green color square at the right end of the highlight This indicates the insertion location where a sernes contact will be attached You can change the insertion location to the left or the right of the highlight bar by pressing the lt SHIFT gt key or lt IAB gt key Note lt IAB gt key only works on J RE 1 3 1 or earlier It does not work on J RE 1 4 x 4 Next create the contact RUN which is parallel to the Start contact by left clicking on the icon The I O table will appear again Scroll to the Relay table and select the RUN relay 5 To insert the nomally closed Stop contact in series with the Start and Run contacts you need to move the highlight bar to the junction of the Start and Run contact First click on the Start contact to select it Then click on the gt icon to move the
210. iew Other CusFn v TstInProg Relay 19 SetLCD Usage CusFn 13 40 Undo Abort Define b Selecta Vanable If the selected text isa variable name ora defined name in the Define table then the lower pane will display the current value of the selected variable The value is obtained from the simulator if i TRILOGI is currently disconnected from any TLServer or F Server If i TRILOGI is currently connected to a TLServer or F server then the program will retrieve the current value from the connected PLC In the following example variable DM 2479 has a curent value 197 and it is being used in Custom function 3 4 7 and 24 TR RESEARCH 10 4 INTERNATIONAL KE Custom Function 7 Control Calculate Push Force CV 10 90 P 100 Low Pass Filter of F PULSEFREQUENCY 3 R DMi2480 80 DMI2479 20 100 pM 2480 R Last Value simulated or monitored 197 Usage CusFn 3 4 7 23 c Selecta Custom Function Name Chapter 10 DEK v adc 2 DM 2490 10 2 DM 2491 Raw Push Force M nl CAAA Rename CusFn View Other CusFn bh SetLCD Undo Abort Define If the selected text is the name of a custom function a special read only popup window will appear which displays the content of the selected function This enables the programmer to view the code of another custom function CALLed by this function without leaving the current function You can also edit the selected custom
211. ill need to click Detect ID and the PLC ID should be retumed in the adjacent field as shown below if communication is functioning correctly TR RESEARCH 3 10 INTERNATIONAL Chapter3 enor eee eg m RE Men ze L an amp Dass j 4 Click OKto complete the server login process 5 Click Yes to continue when prompted with the program transfer confirmation window Note that the Transfer Program to PLC window also allows you to select a whether only the program file name should be sent with the program or b if the entire directory path of where the program is saved should be sent For more information on this referto section 8 3 Controller Menu 6 Click Start Transfer to initiate the actual program transfer if L_success is displayed which indicates program compilation was successful Ti wees 3 11 INTERNATIONAL Chapter3 Success Total Number of circuits 7 Ladder Diagram words 28 Custom Function words 17 l l Total code Size s Program compilation occurs automatically and you would not be able to proceed with the transfer if it failed In that case the general location of the eror will be displayed with a description to help with troubleshooting 7 Waitwhile the program transferta kes place below left screenshot Sending CusFn Addr Fn 128 256 Sending Program Word 45 Note Reboot Power ON RESET 8
212. implify the circuit diagram Now if instead of wiring the switch to the lamp directly as suggested in the above diagram you could connect the switch to the PLC s input and connect the lamp to the PLC s output and then wnte the above ladder program to perform bei Bass 9 INTERNATIONAL Chapter 9 the same job Of course it makes little sense to use a PLC if that isall you want to do We willsee how a PLC can simplify wiring shortly Note The contact Switch shown in the above diagram is termed a Nomally open N O contact Now let s say if there are 3 switches that must work together to control the lamp A Master switch must be ON and one of the two control switches controlsw1 and controlsw2 must be ON while the other must be OFF in orderto tum ON the lamp think of three way switches in your house and you will get the idea We Can wire all 3 switches to 3 inputs of the PLC and the lamp to the output of the PLC We can wrnte the following ladder program to perform this task Master controlSwi controlSyv2 Lamp OUT Control controlsvy2 A contact with a across its body isa Nomally Closed N C contact What it means is that the ladder program is using the inverse of the logic state of the input to interpret the diagram Hence in the above ladder diagram if Master and controlISW1 are tumed ON but controlSW2 is tumed OFF the lamp will be tumed ON since the inverse logic state of an OFF state control
213. in many cases authentication is not needed since the ISP will only allows connection from IP address that belongs to its subscribers However if your SMTP Server is not supplied by the ISP of the network to which the PLC connects then most likely authentication will be required In such a bei Bass 4 12 INTERNATIONAL Chapter 4 Using TLServer case the simple lt EMAIL gt tag method described on the PLC s manual will not work since the PLC doesnot handle authentication with the SMTP server It is possible to program the PLC to handle unencrypted authentication with the SMTP server using complex TBASIC statements in order to send email see examples described on the forum under Frequently Asked Questions However to simplify programming effort we have introduced a new Email Relay Server feature to TLServer starting from version 3 17 The Email Relay Server feature is forthe TLServerto act asa pseudo unauthenticated SMTP mail server to the PLCs and receive the email data from the PLC It then in tum connects to an authenticated SMTP server and relay the email data to the actual SMTP server In order to use this feature the PLC would configure its SMTP IP address to be that of the IP address of the PC that is running the TLServer and the SMTP port to that of the Port to Relay PLC Email The Email Relay Server can be any PC on your LAN that runs the TLServer that is already configured to work with an extemal SMTP
214. ince the PLC does not have a camer detect CD connection to the modem therefore if the connection is lost after a successful initial connection the PLC would have no way of knowing it immediately Your program would have to detect this condition e g if it sends a file service command and does not receive a lt OK gt acknowledgement string from the host Once the PLC notes that the connection is lost it can re establish the connection by simply tuming off the I O bit with label name Connected say by executing the CLRIO Connected statement As long as the DialModem I O bit is on the custom function will re dial and attempt to make another connection if it notices that the Connected bit has been tumed OFF for whatever reason r RESEARCH INTERNATIONAL Ton TRIANGLE A4 6
215. ing one custom function TR RESEARCH 10 8 INTERNATIONAL Chapter 10 X C2 call sendNetCmd IF DM 200 _ status 0 Failed to set PLC s ID Probably CO RETURN ENDIF PRINT 4 lt gt Close Ethernet Connection CALL RdComm4 clear buffer CALL ConnEthernet Connect to UUT via Ethernet N 4 Use Ethernet Port to transfer program IF STRCMP A lt CONNECTED gt lt gt 0 Order Sales 1 877 TRI PLCS 1 877 874 7527 xReady Inquiry 8 30am to 5 00pm PST Mon Fri 2 xMDRdy 10 2 6 Undo Changes Click this button to undo any changes you just made to the custom function You may also use the lt Ctn z gt shortcut key to achieve the same The Undo button shown below can be used to undo the last change to the text in the currently opened Custom Function 10 2 7 Aborting Changes The Abort button can be used to abort any changes made to the curently opened Custom Function since it was opened The custom function editor will be closed when you abort an edit Note If you navigate away from the curently opened custom function or if you exit a custom function by using the lt ESC gt key or by clicking the CusFn Editor 3 jog 1142 bytes button in the top rght comer of the editor then the content of the custom function curently in the editor will be updated into the intemal TR RESEARCH 10 9 INTERNATIONAL Chapter 10 memory and you will not be able to undo or abort changes
216. irmware r78 orabove 12 67 STEPCOUNT ch Purpose gp ZE URA TRIANGLE RESEARCH INTERNATIONAL While the tepper motor controller is sending out pulses this function can be used to monitor the number of stepper pulses sent to the Stepper Motor Channel ch since the execution of the last STEPMOVE command Hence this function retums the relative numberof step moves This function can also be used to measure the physical size of a part if we use the stepper motor to drive a sensor and use the STEPSTOP command and the interupt input to halt the stepper motor when the edges are detected The physical size is then computed using the number of steps the 12 60 See Also Chapter 12 stepper motor travels from one edge to another edge The center position can be easily determined using such data too STEPMOVE STEPMOVEABS STEPCOUNTABS STEPSPEED STEPSTOP STEPHO ME 12 68 STEPCOUNTABS ch Purpose Retums the absolute position of the stepper motor ch This function retums a zero if a STEPHOME command had just been executed and the steepperhasnot been moved since 12 69 STEPHOME ch Purpose Set the current position counter of stepper ch to zero This indicates a new Home position of that stepper motor This command should be executed only when the stepper has reached a particular position to be regarded as the home position All SEPMOVEABS command executed subsequently willbe relative to
217. is function will retum a string of d numberof characters A SIR 1234 B STR 1234 7 A will contain the string 1234 B will contain the string 001234 12 75 STRCMP A S B Purpose Examples Comments GC TRIANGLE URA RESEARCH U SC INTERNATIONAL Perform a comparison between its two string expressions A and B IF A and B are equals SIRCMP will retum a O if A is of lower order in ASCII table order than B the function will retum a negative value Otherwise it retumsa positive value IF SIRC MP A B 0 THEN STEPMOVE 1 1000 1 ENDIF IF A and B are the same then tum on the stepper motor 1 12 65 Chapter 12 12 76 STRLWRS A Purpose To retum a string which isan all lowercase copy of A Examples B STRLWR A 2 C STRLWR C Comments The second example shows how to convert a string to all lowercase 12 77 STRUPR A Purpose To retum a string which isan all uppercase copy of A Examples B STRUPR A C STRUPR C Comments The second example shows how to convert a string to upper case 12 78 TESTBIT v n Purpose To retum the logic state of bit n of the variable v The function retums 1 if the bit is 1 otherwise it retums 0 Parameters V Integer Variable or Register May be any integer vanable however if v is a 32 bit integer TESTBIT will only test the lower significant 16 bits n Bit Range Oto 15 Commen
218. ive the first data number of data bytesto read from the slave DC READ amp HOC 21 2 read 2 bytesinto DM 21 and DM 22 After sending the START bit the CPU will write the 7 bit save address amp H60 110 0000 binary and a R W bit set to 1 followed by 16 clock pulses to read 2 bytes of data and store into DM 21 and DM 22 and then the CPU will generate the STOP bit LC WRITE GC STOP 12 1 Chapter 12 1 This command is applicable only to Nano 10 and FMD PLC models with fimware gt 474 and DC interface 2 Thiscommand isignored by i TRILOGI simulator 12 20 DC STOP Purpose Special command to generate an DC STOP bit out of the PLC sI2C port requires I2C FRIC module to be installed Examples DM 5 12 DM 6 34 DM 7 56 I2C_WRITE amp H60 5 3 I2C_STOP Since the DC WRITE command does not automatically generate the STOP bit this command is used to end LC communication started by an I2C_WRITE command See Also I2C READ LC WRITE Note 1 This command is applicable only to Nano 10 and FMD PLC models with fimware gt 74 and DC interface 2 Thiscommand isignored by i TRILOGI simulator 12 21 I2C_ WRITE i2cslave dmstart count Purpose Special command to execute a DC WRITE out of the PLC s LC port requires I2C FRIC module to be installed The CPU will send a DC START followed by the slave address byte i2csave and count number of data bytes from the DM dmsta rt up to DM dmstart c ount 1 Comme
219. kthe status of a command sent to a device v 0 command failure TRI DE e INTERNATIONAL Leg d In TRIANGLE RESEARCH INTERNATIONAL Chapter 12 v 1 command successful v 255 End of File reached Appliesto the following TBASIC commandsor tags sent via PRINTComman4d except 255 will only be retumed during file access See the Extended File System chapter of the user manual for more information READMODBUS WRITEMO DBUS READMB2 WRITEM B2 I2C_WRITE I2C_READ lt READ gt lt WRITE gt lt APPEND gt tags Example IF STATUS 2 MODBUS READ WRITE OK ENDIF v 0 TCP IP connection closed orlast TCP operation failed v 1 TCP IP connection established or last TCP operation successful FIP tansfer status v 0 FiP client wasidle or last FIP failed v 1 FIP data transfer just started v 2 1st FIP segment transferred now transfering the rest v 3 FIP data transfer completed Note only for PLC with fimmware r77 and above Retum the main firmware version xx can be anything higher than 78 E g finmware r78A will retum 78 Note only for PLCs with fimmware r78 and above 12 57 d In Oto 255 TRIANGLE RESEARCH INTERNATIONAL Chapter 12 Retum PLC ID PLC s ID address stored in FRAM EEPROM for host communication Retumed asan integerin the range 0 255 decimal or 00 FF Hex Note if the ID ischanged a cold boot power cycle is required for SIATUS 8 to retum the
220. lation emor will occur if a CusFn appearsin more than one circuit 7 However a CusFn may be CALLed asa subroutine by any other CusFn and there is no restriction placed on the number of repeated CALL of a CusFn by more than one CusFn A CusFn may also modify the logic states of an I O element or the value of intemal timers and counters using its powerful TBASIC commands such as SetBit ClrBit The compiler however will not alarm the user that a CusFn may inadvertently alter the logic state of an I O already controlled by some other ladder circ uit This power and flexibility offered by the TBASIC based custom functions must therefore be handled with greater care by the programmer It is important to prevent conflicting output conditions due to an I O being controlled or modified at more than one place within a logic scan The net result is that the logic state of the I O appears to be in different states at different parts of the ladder circuit This could lead to bizarre outcomes that may be difficult to trace and debug 10 4 3 Interrupt Service CusFn A CusFn may also serve as an ntemupt Service Routine which is executed asynchronously from the nomal ladder logic execution An intemupt driven Tai Boe 10 16 INTERNATIONAL Chapter 10 CusFn is run when the condition which causes the interrupt occurs The response time to execution is very short compared to the scan time of the ladder program There are several interrupt sour
221. listens on a TCP IP port waiting for connections from i TRiLOGI or other client programs FServer Most of the newer TRI s brand of PLC such as Nano 10 FMD and F senes PLCs have a built in web server called FServer that is located on the PLC CPU chip and the i TRILOGI client can connect to it directly for programming and online monitoring The FServer can perform other tasks that a typical web server can do such as host web pages and receive connections from other devices software Please referto the PLC s User s Manual for details GC TRIANGLE 7 URA RESEARCH Ze LAY INTERNATIONAL Chapter 2 Introduction To l TRiLOGI TLServer All TRi Super PLCs including legacy PLCsthat do not have built in Ethemet port such as the TLOOMD and T100MX family can still be programmed using the same i TRILOGI software via a PC based server software called TLServer that converts TCP IP packets to serial Communication RS232 RS485 TLServer behaves like a typical web server and it is capable of serving HTML webpagesaswellas Java Applet to an Intemet Browser such as Firefox Chrome orlntemet Explorer TLServer connects to the PLCs via the PC s seral communication port and it isthe one responsible for conveying communication messages between the i TRILOGI client and the Super PLCs Note TLServer is not included with Education version of i TRILOGI since there is no real PLC involved Therefore if your PLC does not have Eth
222. ll initiate the sending of a test email using the Mail Server you specified A new TR RESEARCH 4 15 INTERNATIONAL Chapter 4 Using TLServer window will pop up asshown below that allows you to enter the recipient email address Test SMIP Settings Recipient Email to receive a test Email from TLServer Once you have typed the recipients email address you can press enter to send a default email can t be changed If it works you will see a message window that says the email has been sent as shown below and you will receive an email with the following content Test Message sent from TLServer Test Email has been sent Check mailbox of sales tri plc com for the test message If some settings in the email configuration are not comect or you do not have a working Intemet connection you will see an eror message gndosoansensodvenvenney Necveccersesencseet If you use the TLServer email relay feature and encounter failure when the PLC attempts to email and if you cannot figure out what caused the problems then you can start upthe TLServer with Java Console enabled and re run the email test with the Debug checkbox selected The Java console will output all interactive messages the TLServer exchanges with the SMTP server From the emor messages produced you may be able to better figure out the cause of the email failure Note TLServer automatically enables debug messages when you use the Email Test butto
223. llowing text and then close the editor window by click on the or by pressing the lt ESC gt key If you would like to exit the editor window without saving the changes click on the ee enh button TR RESEARCH 6 14 INTERNATIONAL Chapter6 LS Custom Function 1 EventCount Lola Z X 1 Initzal value of x SETLCD 1 1 Cycle Count ST St Find Find All 1 EventCount v e e e Rename CusFn View Other CusFn v w New TRILOGI version 6 45 Build 03 and TLServer 3 17 poe eee 1 Supports new commands 32 bit DM32 n SAVE EEPE SAVE_FEP32 j SE SE LOAD FEP8 LOAD FEP32 ae 2 Support breakpoint features to aid debugging 3 Fixed several reported bugs in 6 45 build 01 and 02 Toggle Breakpoint Follow Help gt TRILOGI Upgrade in your i TRILOGI to obtain the latest C Send Brk Pts to PLC upgrade EE View Var The pupo of this custom function is to keep a cycle count of the number of times the Sequencer has completed the complete sequencing and display the cycle count on the PLC s built in LCD display or on the Simulators View Variable screen This custom function should be run ONLY ONCE whenever the Seq1 4 contact closes which is why the differentiated version of Custom function must be used in thiscase dC usF not CusFn 9 We can make our program more comprehensive to other users by utilizing the
224. lly by placing the cursoron the breakpoint line and the click the Toggle Breakpoint button If you wish to Clear all breakpoints in the program you can click on the Edit pull down menu and select Clear All Brea kpoints 10 7 3 Debugging Using Breakpoint on Simulator With a break point set in the custom function and if you run the program using the simulator when the simulator runs to the line where a breakpoint is set the program will paus and the custom function where the breakpoint is defined INTERNATIONAL TE v TRIANGLE R RESEARCH 10 24 Chapter 10 will be opened with the breakpoint line highlighted as shown in the following picture le Castor Functor 5 fnGetDNS SETLCD 0 0 CHR 1 _ Clear LCD screen Se Find Find All mM 1000 8 This is used te store the timezone PST SETLCD 1 1 Resolving DNS PRINT 4 lt DNS time nist qov gt make a connection to NIST H RaComm4 a S STATUS 3 15 fnGetDNS SETLCD 2 1 A AS contains the response from DNS service Saa Rename CusFn View Other CusFn Keyword Helps Undo Abort al ll DEE SAS Define Program stops at defined break point 4 f f Toggle Breakpoint Click Continue button or PAUSE button in the simulator screen to continue C Sen
225. ltage source that falls somewhere in the middle of the range of analog values that you are concemed with For example if the temperature sensor that you nomally measure with would retum a voltage between 2 3V and 4 5V Then it is best to calibrate using a voltage source around 3V After connecting the voltage source to the analog inputs use your precision voltmeter to measure the actual voltage and convert it to a reading that you expect the ADC n to retum E g if your voltage source measures 3 045V and your analog input range is 0 5V then the expected reading that ADC n should retum corresponding to 3 045V should be 3 045 5 000 x 4096 2494 Lets say If you are only calibrating analog input 1 3 7 and 8 only and the rest are not used then enter the value into the Expected ADC n fields for each channel as shown below Leave any unused channel blank Auto Calibrate Analog Analog Inputs ADC Calibration Chi Ch2 Cha ch4 Expected ADCin 2494 2494 0 to 4095 chs Ch7 OS 2494 2494 Calibrate Analog Inputs Help When you have finished entering the expected ADC data then click on the button Calibrate Analog Inputs to start calibration The calibration program will first clear the old calibration data in the PLC and reboot it once After that it will read 50 samples from the PLC s analog inputs and compare it against the expected ADC n value The average readings of the 50 sample
226. ly the multiplication factor of 1 0146 to the readings it received which would corect the reading to 3230 x 1 0146 3277 Notes a We have created an MS Excel spreadsheet file AnalogCalibration xls to facilitate the computations of the correction factor X used in the ADC and DAC Calibration This file can be downloaded from the following web page http www tn plc com appnotes F seres AnalogCalibration xls b Changes to the ADC calibration data only take effect after the PLC has been cold booted You can either power cycle the PLC or simply check the Reboot PLC After Save checkbox and the PLC will re boot after you have transferred the parameters to it 3 ADC Zero Offset ADC n value Input Voltage RESEARCH INTERNATIONAL TR TRIANGLE 8 33 Chapter8 The zero offset emor can be corected by entering a value into the ADC Zero Offset field Any number between 100 and 100 can be entered here The ADC n function would add the zero offset value that you entered here to the measured value and retum the total sum to the calling routine 4 DAC Calib A value x entered in each of these fields represents the multiplication factor 1 x 10000 that the PLC will apply to the value parameter which is executed by the command SETDAC n value before actually writing to the DAC output This allows the user to apply a correction factor to the DAC output if there isa problem with the DAC volt
227. m Function Editor The custom function editor window allows creation of any number of lines of TBASIC program statements Since this is a standard text editor you should have no problem using the key and mouse controls to edit the text Eg To copy a paragraph of text select it using the mouse and the press lt Ctr C gt bei Bass 10 1 INTERNATIONAL Chapter 10 Altematively you can use lt Ctr X gt which will cut the text copy and delete Once you have copied or cut the desired text move the text editing cursor to the destination and press lt Ctr V gt to paste it to the new location i TRILOG 6 2 and up introducesa brand new custom function editor The custom function editor now hasa whole new interface with split panes that provide text editing for writing code just like before on the upper pane and a web browser TBASIC help information on the lower pane The first time the custom function editor is opened after starting i TRILOGI the text editor pane will be empty and the lower pane will display some information about Triangle Research our products or software update information see below The lower pane can also be used to display help or emor messages when wnting or compiling your program Update A define button has been added as of i TRILOGI version 6 42 and higher and a breakpoint feature for debugging purposes fa _ ES3 Custom Function 100 Set Time The ADC 0 to 4096 correspond to
228. me common Intemet application protocols are shown below Port Protocol 21 File transfer protocol 23 Telnet protocol 25 Simple mail transfer protocol 80 Hypertext transfer protocol 4 4 Setup Emails Seng Emails 4 4 1 Introduction Before the Ethemet port was integrated into the newer Super PLCs such as the Nano 10 FMD and F series TRi PLCS can only use the TLServer as TCP IP gateway to perform network related functions including sending of emails For newer PLCs with built in Ethemet in many cases the PLC can be setup to send email directly without relying on the TLServer Please see the following FAQ posting for a description of all the current email methods http www tn plc com faqans5 htm ans61 However TLServer can still be very useful as email helper in the following situations Ten Resear SCH INTERNATIONAL Chapter 4 Using TLServer 1 There isno Ethemet cable available to the PLC but the PLC are networked via RS485 to a PC 2 The PLCs are not permitted to make TCP connection directly to SMTP server residing outside of the LAN 3 The SMTP server requires authentication to send email that the PLC cannot handle natively The following describe in details the several ways in which the TLServer can be used to help the PLC send out emails Email Method 1 Using TLServer as Email Master The TLServer supports a legacy email feature camed over since version 1 0 where the TLServer act a
229. ments anyways Although in most cases it may be best to limit a variable to one comment to avoid potentially overwnting data since no new vanables are actually create asmentioned above For Example If a string vanable A wasnamed A one_string in one partofa program and named A two_string in another part of the program then they will still both referto A If each variation has different string data then the data that was stored in the last variation that was updated will be the data in A Then if the previous vanation is accessed it won t contain the data that was Originally stored in it 11 3 5 Variable Define Table NEW This new feature allows you to define an acceptable name for any vanable constant or even an entire expression Please see section 9 3 Define Table and 10 2 7 Variable Define Table for more details Tri Boss 11 12 INTERNATIONAL Chapter 12 Chapter 12 TBASIC Keyword Reference TRIANGLE URA RESEARCH UN INTERNATIONAL Chapter 12 12 TBASIC KEYWORD REFERENCE 12 1 ABS x Purpose To retum the absolute value of the numeric expression x Examples A ABS 2 16 100 Comments A should contain the value 68 12 2 ADC n Purpose To retum the value from the Analog To Digital Converter channel n n should be between land 16 Examples A ADC 2 Comments n may be a numeric expression which retums a value between 1 and 16 If it is out of range a run time eror will be rep
230. message in the search area will change to Text Not Found and the next time Find is clicked the first result will be highlighted again Ti aes 10 6 INTERNATIONAL Chapter 10 KS Custom Function 1 EventCount E Control S x Bi Initial value of x 0 SETLCD 1 1 Cycle Count STR X Find Find All x Find only in this CusF To do a global search simply type the text in the same command line and click the Find All button If the text is found in any custom function within the program it will be highlighted in the text editor as shown below Also the text Find in all CusF will be displayed below the command line in the search area indicating a global search Each time the Find All button is clicked the next instance of the search text will be highlighted until the text cant be found anymore in any custom function At this point the first result will be highlighted again If no text matches the search text the message in the search area will change to Text Not Found KS Custom Function 1 EventCount TB Control B x 1 Initial value of X 0 SETLCD 1 1 Cycle Count STR X Find Find All x Find in All CusF NOTE Highlighting of text found in the editor during a user initiated search or during Compilation eror tracking now works with J RE Java Runtime Environment 1 5 and 1 6 10 2 4 Navigating Custom Functions It is now possible navigate to any other functi
231. monitoring window will appear after successful login A1 2 Part 2 Ethernet Communication Setup Guide 1 NETWORK WIRING Below is an example of the most common network setup which assumes the default PLC IP address 192 168 1 5 is able to work on your network If this IP will not work then follow the seral port setup instructions in part 1 of this guide and INTERNATIONAL TRI RESEARCH A 9 Appendix 1 then refer to chapter 2 of your PLCs user manual for details on configuring the network settings via serial port connection Modem Router IP 192 168 1 1 w2 straight through CAT5 Ethernet Cable Super PLC IP 192 168 1 5 IP 192 168 1 100 2 STARTTRILOGI Refer to the START TRILOGI section in Part 1 of this guide TLServer is not needed for Ethemet communication so there isno need to start it or configure it 3 OPEN ALE Referto the OPEN FILE section in Part 1 of this guide 4 PROGRAM TRANSFER a Select Program Transfer to PLC from the Controller menu or press CTRL Ton the keyboard TRI RESEARCH II INTERNATIONAL Appendix 1 4 Select Controller Connect to Server On Line Monitoring Transfer CO5 file to PLC Open Matching Source File Get PLC s Hardware Info Set PLC s Real Time Clock b The Login to Server window will open as shown below Note that in this case TRILOGI will login to the PLCs FServer even though it displays Login to TLServer
232. monly used by programmers to identify the bit pattems in these vanables 10 5 3 Changing the Contents of Variables While the View Special Vanables window is open you may change the contents of the following variables by clicking on the Edit button A Z A to Z DM n DM32 n DATE n TIME n INPUT n OUTPUT n RELAY n TIMERBIT nN CTRBMIn IMERPV n CTRPV n and HSCPV n emINT n emLINT n A text entry window will pop up and you will have to enterthe values in the form of assignment statements such as A 5000 DM 99 5678 DM 32 100 amp H12789A BC OUTPUT 2 SH01AB B Welcome to TBASIC The varable will take up the new value as soon as it is entered and if the execution condition for any CusFn is ON the simulator will process the newly entered data immediately and produce the new outcomes This gives you greater flexibility in controlling the simulation process 10 5 4 Decimal and Hexadecimal Representation All the numeric data shown in the Special Variables window are by default displayed in decimal notation You can display the number in hexadecimal format by clicking on the Hex button or by pressing the lt H gt key Press the D gt key if you wish to switch back to the decimal format This feature is very useful for programmers who are familiar with hexadecimal representation of a binary number The Hex button will become the Dec button when you enter the Hex display mode pi We 1
233. mp HFFFFFB2E If you enter the constant as 16 bit representation amp HFB2E as follow IF DM 1 lt gt amp HFB2E CALL5 TBASIC translates the number amp HFB2E into a 32 bit decimal number 64302 which when compared to the number 1234 contained in DM 1 will yield a False result which isan error The following are the correct representation a IF DM 1 lt 1234 CALL5 ENDIF b IF DM 1 lt gt amp HFFFFFB2E CALL 5 ENDIF 11 2 2 Integer variables Vanables are memory locations used for storing data for later use All Integer vaniables used in TBASIC are GLOBAL vanables this means that all these vanablesare shared and accessible from every custom function With i TRILOGI version 6 2 and above you can now attach comments to any variable name of any length to make program easier to read See section 5 Integer Vanable Comments below for more details Specific examples with each vanable type are shown below TBASIC supports the following integer vanables 1 26 Integer variables A B C 2 which are 32 bit varnables Note that the variable name isa single character by default however as mentioned above you can append a comment to the vanable EG A_temperature A_distance both referto the same vanable A 2 A large one dimensional 16 bit integer array from DM 1 to DM 4000 where DM stands for Data Memory A DM is addressed by its index enclosed between the two square brackets TI and In e g DM 3 D
234. ms on the legacy M series PLC Note that if any expansion boards are connected to the FMD seres or F series PLCs it could also take up to 2ms to complete If used frequently it could increase the program scan time sig nific antly or Statement To allow explanatory remarks to be inserted in a program The text after the REM statement until the end of the line will be ignored by the compiler An abbreviation for the REM statement isthe apostrophe REM Waiting forthe right time to tum on This is also a remark line To perfom a software reset of the PLC from within a CusFn All the vanables will be reset to zero or inactive and all the hardware outputs such as DAC and PWM will be tumed OFF The effect isthe same asthe Master Reset MaRST function in the ladder logic The first scan bit 1st Scan will also be tumed ON forone scan time A RESET will also perform a FLASH memory backup for all NANO 10 and FMD series PLCs This is especially important after any SETNMERSV SETCTRSV or SET IPADDR commands are executed because the timer and IP data must be backed up into FLASH However it is better to use the SETSYSTEM 252 0 command to perform a FLASH backup since a RESET will cause all volatile data to be lost If the program is stuck at some dead loop such as WHILE FOR NEXT in a CusFn then MaRST would not be executed since the ladder program would not have a chance to scan the ladder rung containing the MaRST function If
235. n SE PRINT 3 Value entered is EQUAL to O View Other CusFn S a es BEE Keyword Helps v New TRILOGI version 6 45 Build 03 and TLServer 3 17 v Undo Abort NOTE This isa new and improved custom function editor Fora full description of its features see the TBasic Introduction page and go to the 2 Custom Function Editor section 8 2 11 Clear Custom Functions This Command allows you to select a range of custom functions whose content you want completely cleared You will be prompted to select the range of custom functions to erase Note that this action is not undoable TR RESEARCH 8 13 INTERNATIONAL Chapter8 8 2 12 Set TAB Width You can change the number of spaces the editor used to display the lt IAB gt Characterthat you insert to format the code hierarchically 8 3 Controller Menu All commands in this menu are for communication with the PLCs via the TLServer or the Ethemet XServer Hence the ener must be actively running and connected to the PLC s via its serial port before the commands here can be suc cessfully executed Note that TLServer can be running on the same computer that i TRILOGI is running on using localhost IP 127 0 0 1 or on another computer in the same local area network or anywhere in the word with an Intemet connection The expenence is identical regardless of where the TLServer and hence the PLC is situated Note In order to maint
236. n clock pulses to trigger a differentiated Custom function dCusF You can choose a suitable period from 0 01s 0 02s 0 05s 0 1s 0 25 0 5s 1 0s and 1 minute for the application Other periods can also be constructed with a self reset timer The custom function will only be executed once every period controlled by the system clock pulse orthe timer as follow Run Clk 0 1s A_Function dCusF For example you don t need to update the value of a variable displayed on the LCD screen any faster than the human eye can read them So using a 0 5s clock pulse may be sufficient and this will not take up too much CPU time for the display For Sow processes such as heating a 1 0s clock pulse to monitor temperature change is more than sufficient IMPORTANT 1 When the CPU scans the ladder logic to a circuit which contains a CusFn and the execution condition of the circuit is TRUE the comesponding CusFn will be immediately executed This means that the CPU will not execute the remaining ladder circuits until it has completed execution of the curent CusFn Hence if the CusFn modifies a certain I O or vanable it is possible to affect the running of the remaining ladder program 2 Note that the INPUT n variables contain data obtained at the beginning of the ladder logic scan and not the actual state of the physical input at the time of the CusFn execution Thus it will be futile to wait for the INPUT n variable to change inside a CusFn u
237. n contains multiple TBASIC statements that gives the PLC extremely powerful capabilities unmatched by many ladder only type of PLCs The Circuit we wish to create isas follow Geo A EventCount 6 First create the contact Seq1 4 as per previous circuits Then left c lick on the to connect to a Special Function coil Select from the popup menu the item E Diff Up Custom Function to create a Differentiated Up version of Custom Function For a full explanation of the meaning of Differentiated Up please refer to TBASIC Introduction The Custom function popup menu will appear for you to select the Custom Function number you wish to insert Up to 256 Custom functions can be defined and you can click on the first custom function as follows o Ge TRIANGLE 6 3 URA RESEARCH U Sc INTERNATIONAL Chapter6 Select CusFn Define Label Name Cust Func 1 EventCount 7 Since the custom function has not been defined with a label name you will be prompted to give ita label name The label name given to the CusF must be unique and are subject to the same limitations as that of the I O label names Lets enterthe label name EventC ount for function 1 Note Label name for Custom function is optional and if you don t wish to use label name then the program will automatically assign ita name Fn_ 1 for function 1 Fn_ 2 for function 2 and so on When the Custom Function editor has been opened enter the fo
238. n if the emEvent 1 has been reset it does not guarantee that the email has been conectly dispatched to the recipient Success of emailing is subject to the proper configuration of the TLServer the network quality and availability of the SMTP server at the moment when TLServer tries to send out the email For urgent situations you may consider sending out multiple emails penodically until the user has attended to the machine 4 5 File and Email Services Starting from version 2 0 the TLServer provides a number of File and Email Services to the PLCs via the senal comm port TRi Ethemet PLCs such as Nano Tri nat 4 19 INTERNATIONAL Chapter 4 Using TLServer 10 FMD series and F series PLCs can also perfom these file and email services via TCP IP from their built in FServer which is described in the Network Services section of the PLC user manual chapter 2 3 This section will only describe how to do such tasks with TLServer so the FServer would only be referenced when the TLServer is being used to make a connection to it Basically a PLC can send service requests to the TLServer using tags which are ASCII characters enclosed between the lt and gt characters and the TLServer will perform the service requests upon receiving valid commands All data between the lt command parameter gt tag and the lt gt tag will be treated as data forthe requested service Since the PLC isthe one that initiates the service
239. n the line would be above or below the ongin The DAC output on the F series PLC should not have any zero offset enor and you nomally should just leave these fields set to 0 However if for any reason there isa need to apply a zero offset emor correction you can enter a value between 100 to 100 into the DAC Zero Offset field The CPU would add the zero offset value you enter into this field to the X in the SETDAC n x statement and only send the sum to the actual DAC hardware 6 A D Moving Avg ADC Moving Avg p of data points This field lets you define the number of points of moving average that the F1616 BA CPU firmware uses to compute the value retumed by the ADC n function for F series PLC users please refer to Chapter 5 2 5 of the User Manual for an explanation of moving average A larger number of moving Average points has the positive effect of filtering out large noise spikes seen at the analog input but the disadvantage isthat the PLC would be slower in noticing a sudden step change at the analog input If you specify a moving average of 1 point that means no moving average will be used and the ADC n function will retum the most recently sampled data at the analog input n Ti Bae 8 35 INTERNATIONAL Chapter8 8 3 11 Auto Analog Calibration Auto Calibrate Analog Analog Inputs ADC Calibration Ch2 ch3 Ch A Expected ADC n 0 to 4094 chs ch Ch chs
240. n to send a test email via the SMTP server regardless of the state of the Debug checkbox The Debug checkbox is effective only when TLServer camies out the the email relay operations on behalf of the PLCs TR RESEARCH 4 16 INTERNATIONAL Chapter 4 Using TLServer 4 4 3 Setting Up TLServer As Email Master For Multiple PLCs on RS485 A PLC program raises an email request flag by setting the vanable emEVENT1 to a non negative value see explanation on Writing i TRILOG Programs that Can Send Emails whenever it needs to send an email The TLServer upon sensing that an email request flag has been raised will extract the sender recipient and message strings from the PLC s intemal variables and send them out using the pre defined SMTP outgoing mail server A single TLServer can service the email requests for one or more max 256 PLCsconnected to it via RS232 single PLC only orRS485 The second half of the Email Setup screen with the title Legacy EMail Feature from TLServer 1 0 are related to this email method The setup is as follow PLC ID column For you to select PLCs with ID from 00 FF 256 in total to set the email service penod Check Every seconds This allows you to define how often the TLServer should check the PLC the email service period forthe state of the outgoing email request flag Simply click on field next to the PLC ID of interest to open up a text entry field as shown in the figure
241. ne If you don t see this skip to the next step Otherwise click Yes to use the same installation folder Dal The directory CA TRILOGI already exists Would you like to install to that directory anyway 9 Now you will be asked to choose a name for the start menu group which is what you will see in the PCs start menu program listing Click Next to use the default option T v TRIANGLE 1 5 ire RESEARCH INTERNATIONAL Chapter1 I TRILOGI Setup Guide Setup will add the program s icons to the following Start Menu group f TRILOGI 6 Advanced Hash Calculator bada SDK 2 0 5 CorelDRAW Graphics Suite x6 64 Bit EB8000 FileZilla FTP Client FlaviS oft far TR PI Ce Click Next to continue or Cancel to exit Setup lt Back Cancel 10 Now the installation setup is complete and you just need to Click Install to start the installation process Setup is now ready to begin installing i TRILOGI 6 45 build 05 on your computer Click Install to continue with the installation or click Back if you want to review or change any settings Cancel 11 Installation istaking place Wait forthe Setup to complete automatically T v TRIANGLE 1 6 ire RESEARCH INTERNATIONAL Chapter1 I TRILOGI Setup Guide Extracting files C TRILOGISTL6 public Help D efine3 GIF WG amp 35Q8 12 Installation is nearly complete An information box will appear and after re
242. ng TRIANGLE RESEARCH INTERNATIONAL When this statement is executed the PLC will not propery resoond to any host link commands sent to it except the command PWxxxx xx which must contains the same string Xxxx xx not more than 19 characters as defined in the SETPASSWORD command All other commands will receive a PWER response indicating a password enor state Once the corect password has been accepted the PLC will work as normal and respond to all host link commands Execution of PW host link command without any string will put the password lock back in force to prevent unauthorized access SETPASSWORD I love TRILOGI When using TRILOGI the software will automatically prompt you to enter the password string if it encounters a PLC which has been password locked Note that the password is case sensitive Password locked PLC cannot be accessed by older version of TRILOGI 12 42 Comments Chapter 12 This feature is mainly used to protect an unattended PLC which is linked to an auto answer modem Without password protection anybody can dial in with a TLServer or TL41 exe and have full control of the PLC which may be a serous security problem Within the PLC software you may also use a timer to pernodically re arm the PLC with this command for maximum protection You can also use different passwords for different time of the day ora set of rotating passwords to provide greater sec unty
243. ng some computation 10 5 Simulation amp Examination of TBASIC Variables pi We 10 17 INTERNATIONAL Chapter 10 10 5 1 Simulation Run of CusFn I TRILOG fully supports simulation of all TBASIC commands After you have completed coding a CusFn test the effect of the function by connecting it to an unused input Run the simulator by pressing lt F9 gt or lt Ctr F9 gt key Execute the CusFn by tuming ON its control input If your CusFn executes a command that affects the logic state of any I O the effect can be viewed on the simulator screen immediately However if the computation affects only the variables than you may need to examine the intemal variables C es MV Control Timer Relay Output W sch EEDE Eai Pa Lg E ct Kai An UO or intemal relay bit that has been tumed ON is indicated by a RED color rectangular lamp that simulate a LED being tumed ON You can pause the logic simulator at any time by pressing the P gt key or clicking on the Pause button Likewise the simulator engine can be reset by clicking on the Reset button Simulation of ADC Inputs Along the top edge of the Programmable Logic Simulator screen you will find 8 text fields adjacent to the label ADC1 8 The programmer can enter the expected ADC values for ADC 1 to 8 in these text fields In effect these simulate the potential signal strength at their respective ADC input pins These values will be captu
244. ng the SIR function and concatenated to the rest of the text string for display using the SETLCD command Simulation of the display string to built in LCD is supported on TRILOGI Version 6 x When in Simulation mode press lt V gt key to view the Special Vanables and the messages will appearin an LCD Simulation window A2 2 2Setting Timer Counter Set Values S V Using LCD Display If you have an LCD display then you can use two push buttons inputs to change the Set Values SV of any selected timers or counters with visual feedback Assignment 1 Press push button Increase increment the SV of timer 1 by 0 5s The upper limit for timer 1 SV is 10s SV lt 100 2 Presspush button Decrease decrement the SV of timer 1 by 0 5s 3 Press test button tums ON output 1 for a duration given by timer 1 and then tums it OFF TR RESEARCH A2 6 INTERNATIONAL Appendix 2 Increase Fn_ 101 dCusf Decrease Fn_ 102 _ _ dCusf Test gie out1 OUT Timl TIM Custom Function 101 Z getTimerSv 1 IF Z gt 100 RETURN ENDIF MAXIMUM 10s setTimerSv 1 Z 5 Increase the current SV by 5 0 5s SETLCD 1 1 T1 SV STRS getTimerSV 1 4 Custom Function 102 setTimerSv 1 getTimerSv 1 5 Decrease SV by 5 SETLCD 1 1 T1 SV STRS getTimerSV 1 4 Comments The getlimerSV 1 function retums the current set value of the Timer 1 This value is read
245. nless you execute the REFRESH statement to refresh the physical I O before you examine the INPUT n vanable again pi We 10 1 INTERNATIONAL Chapter 10 3 Likewise any changes to the OUTPUT n variable using the SETBIT or CLRBIT statement will not be transferred to the physical outputs until the end of the Current ladder logic scan Hence do not wait for an event to happen immediately after executing a SETBIT or CLRBIT statement on an OUTPUT n because nothing will happen to the physical output until the current ladder logic scan iscompleted 4 If you want to force the output to change immediately you will need to execute the REFRESH statement Consideration must be given to how such an act may affect the other parts of the ladder program since not the entire ladder program hasbeen executed 5 Like all ladder circuits the relative position of the circuit which triggers the CusFn may affect the way the program works It is important to consider this fact carefully when wnting your ladder program and TBASIC CusFns Always remember that the CPU executes the ladder logic and CusFn sequentially even though the equivalent circuits in hard wired relay may seem to suggest that the different rungs of ladder circuits were to work simultaneously 6 In line with the typical LadderLogic programming rules a CusFn may appear only once within the ladder diagram regardless of whether it appears in the nomal or differentiated form A compi
246. nnection If the password is incorect the TLServer will disconnect the remote modem to prevent unauthorized access If the call in password is validated the TLServer will acknowledge this by sending a CR terminated string lt OK gt to the remote PLC via the modem It is the duty of the incoming caller to check the acknowledgement string to ensure that the connection isnot dropped by the TLServer 4 3 Configure Users _Configure Users _ By definition only the Administrator is Er les authonzed to add delete usersand change password Hence when you click on the Username Administrator Configure Users button you are assumed to be the Administrator and you will be asked to enter the Administrator s password to gain entry By default no password has been defined for the Administrator so you _Cancel should just press lt Enter gt key to gain entry the first time Password Once you get through the Administrator Login screen a dialog box will popup which allows you to add new users who are allowed access to the TLServer and the PLCs You can also change the password usemame or the access level of an existing user or delete an existing user A new user defined here will be given his her own exclusive subdirectory to store ladder programs For PCs this directory islocated at C TRILOG N TL6 ua lt usemame gt where lt usemame gt isthe same asthe Usemame defined here 4 3 1 Select Username o_O TRI
247. nsor ADC 1 0 gt 0 C ADC 1 4096 300 0 C Def PID Fn_ 5 Le jdcust C1k1 0s Fn_ 6 Le ist Custom Function 5 P 500 I 50 D PIDDEF 1 2048x100 P I D Use PID Engine 1 max limit 50 of full scale Custom Function 6 ADC 5 200 50 4096 50 Convert to C ADC 1 300 0 4096 PIDcompute 1 S T 100 2048 X can vary 50 setDAC 1 X Write to analog D A output 1 Comments 1 We use two decimal places to represent the gains Kp K and Kp Each integer unit represents 0 01 Proportional gain KP 5 is represented by variable P 500 Likewise Integral gains KI 0 5 is represented by 50 and Differential gains 0 means Differential term is not used P I only The integrator limits of 2048 for the PIDDEF statement must be multiplied by 100 to be put on the same scale asthe P l and D parameters Note that since TRILOGI does not support floating point anthmetic the multiplication must be camed out before the division Otherwise if you compute 150 4096 ADC 5 the result of the integer division of 150 4096 0 and the whole expression yieldsa 0 which iscleary wrong N The value retumed by PIDcompute function isthen divided by 100 to get the real value of controller output PIDcompute retums a signed value TRU RDE pene INTERNATIONAL Appendix 2 which can vary from limit to limit We choose the 50 D A output 4096 2 2048 as the mean con
248. nts The command automatically checks foran ACK sent from the Slave device and the user program can check the status of this operation by testing the STATUS 2 function STATUS 2 TRI DE aie INTERNATIONAL Chapter 12 retums a 1 if an ACK is received and 0 if no ACK is received after time out Parameters i2cslave The 7 bit Save address that the CPU is wnting to dmstart The starting index of the DM that contains the first data byte count number of byte data to send maximum is dependent on the Slave Example DM 5 12 DM 6 34 DM 7 56 I2C_WRITE amp H60 5 3 DC STOP Following the START bit the CPU will write the 7 bit slave address amp H60 110 0000 binary and a R W bit set to 0 followed by the byte data stored in DM 5 DM 6 and DM 7 Note This command doesnot automatically generate the I2C STOP bit this isto allow the CPU to perfom a I2C_READ following a I2C_WRITE LC READ after WRITE is commonly encountered in I2C protocol which requires using the I2C_WRITE to set the intemal pointer address in the save device and then followed by the I2C_READ command Therefore if your command involves only I2C_WRITE you must end the WRITE command by executing a DC STOP statement See Also I2C_READ DC STOP Note 1 This command is applicable only to Nano 10 and FMD PLC models with fimware gt 74 and DC interface 2 Thiscommand isignored by i TRILOGI simulator Ti DE as INTERNATIONA
249. o PLC with firmware r78 and above 12 64 17 Write to Flash 252 data 0 On Nano 10 and FMD PLC without the FRAM RIC this command is used to force save the emulated EEPROM content to the CPU Flash memory Important This command should be executed every time a SETTIMERSV SETC TRSV or SET IPADDR command is used so that the data is propeny backed up to PLC FLASH memory This must be done for all Nano 10 and FMD series PLCs with or without any FRAM RIC_ module installed 12 64 18 Control the RTC operation 253 0 data 0 Completely disable the RIC on the CPU 1 data 1 default Enable the RIC on the CPU 2 data 2 Disable houny auto update of RIC data from FRAM RIC useful on systems that rely on RIC update from Intemet Time Server You can also use this command to setup the date and time for an RIC alam interupt to occur The interupt handlercan be defined using TRI ease rs INTERNATIONAL Chapter 12 INTRDEF 19 n 1 where n is the custom function to handle the alam interrupt The time and date when the alam internupt occurs can be defined using SETSYSTEM 253 data as follow 253 hh mm ss data lhhmmss set system alarm to occur when the RIC reachesthe time hh mm ss E g SETSYSTEM 253 1130500 alarm at 13 05 00 When SETSYSTEM 253 1hhmmss is run the alarm is set on the day when the RIC next reaches hh mm ss so it could be the same day or the next day depending on current time Applicable only to PLC with firmw
250. o complete the server login process e Click Yes to continue when prompted with the program transfer confirmation window f Click Start Transfer to initiate the actual program transfer if L success is displayed which indicates program compilation was successful TR RESEARCH Al 7 INTERNATIONAL Appendix 1 Success Total Number of circuits Ladder Diagram words Custom Function words Total code Size g Waitwhile the program transfer takes place below left screenshot Target PLC Model NANO 74 Sending CusFn Addr Fn 128 256 Sending Program Word 45 aen bet 1 Se Note Reboot Power ON RESET h Click Reset when the program transfer is complete above rght screenshot The program transfer isnow complete and online monitoring can be performed 9 ONLINE MONITORING Select On Line Monitoring from the Controller menu or press CTRL M on the keyboard Tri BS d INTERNATIONAL Appendix 1 Transfer COS file to PLC Get PLC s Hardware Info Set PLC s Real Time Clock EEPROM FRAM Manager Seqi 1 Ethernet amp ADC Configuration Auto Calibrate Analog The online monitoring window should open immediately if you are still connected to the server If not then follow steps b d from the seral Program Transfer section above to login to TLServer or the Ethemet Program Transfer section below to login to FServer PLC The above
251. o longer need the high speed counter it should be disabled in order not to waste the CPU s time to service the interrupt generated by the change of state at the HSC input 12 18 HSTIMER n Purpose To define PLC Timer 1 to n as High Speed Timers HST A HST counts down every 0 01s instead of every 0 1s for normal timer and their other properties are identical to nomal timer Tri Boss 12 10 INTERNATIONAL Chapter 12 Those Timers whose number are above n are not affected and remain ordinary timers 12 19 DC READ i2cslave dmstart count Purpose Comments Parameters i2cslave dmstart count Example See Also Note CA v TRIANGLE Ir RESEARCH LAS INTERNATIONAL Special command to execute a I2C_READ out of the PLC s LC port requires I2C FRIC module to be installed The CPU will send a DC SIART bit followed by the slave address byte i2cslave with R W bit set to high and then send out the number of clock pulses required to read count number of data bytes from the the slave The data bytes received from the slave will be stored in the memory location DM dmstart to DM dmstart count 1 After receiving all the required data bytes the CPU will send the I2C STOP bit to the slave to end the communication Le there isno need execute the I2C_STOP command after an l2C_READ command The 7 bit Save address that the CPU is reading from The starting index of the DM that isto rece
252. o overwnte The default file extension for file saving is PC 6 which will save the file in Unicode format to the TLServer user folder However you may also save the file with an extension PC 5 in which case the TLServer 3 x will then save the i TRILOGI file in ASCII format Files saved with PC5 extension may be opened by older TL5 applications Important Notes Any non ASCII characters used in the program file will be lost when the file is saved in PC5 format and it is not recoverable So if you use O TRIANGLE TRY RESEARCH 8 3 INTERNATIONAL Chapter8 non English I O labels your program will most likely fail to compile when it is saved asa PC5 file since the I O labels are converted to ASCII and are partially trancated Thus it is important to keep the orginal copy of your PC6 program so that you can work on it to resolve the unicode conversion issues 8 1 5 Open Local Drive Save As Local Drive For TL6 Application not Applet you can open or save a file from to the local harddisk You will be presented with the typical file dialog provided by your O S This Command however is not available to the TL6 Applet since an applet does not have the right to accesslocal hard disk resources The default file extension for opening a i TRILOGI file is PC 6 This signals to the TL6 application that the file is in Unicode format and TL6 will then load it accordingly However TL6 is also able to read PC5 files crea
253. ock ILock The Intenock ILock and Interlock Off ILoff functions work together to control an entire section of ladder circuits If the execution condition of an Tock function is ON the program will be executed as nomal If the execution condition of ILock is OFF the program elements between the ILock and ILoff will behave as follow a alloutput coils are tumed OFF b alltimers are reset to inactive c allcounters retain their present values d Latched relays by Latch function are not affected e dDIFU and dDIFD functions are not executed f allotherfunctions are not executed An Interlock section is equivalent to a master control relay controlling a number of sub branchesas follow bei Bass 9 12 INTERNATIONAL Chapter9 Master L51 Chi 7 H RLY LS2 10min TIM overhe Out SAn oT Using Interlock Functions Equivalent Circuit Note that ILoff isthe only function that does not need to be energized by other program elements When you use one or more ILock functions there must be at least one ILoff function before the end of the program Otherwise the compiler will wam you forthe missing ILoff The logic simulator always clears the Intedock at the end of the scan if you omit the ILoff function You can program a second or third level Intenock within an Interlock section using a few ILock functions However you only need to program one ILoff function for the outermost In
254. ogram or you must reset the controller by tuming OFF the power and then ON again If you execute a SEIPROTOCOL using the 1ST Scan then you must tum on DIP switch 4 before powering up the PLC so that the SETPROTOCOL command will not be executed and you can regain control of the PLC using i TRILOGI TRIANGLE 2 44 RESEARCH INTERNATIONAL Chapter 12 12 63 SETPWM n x y Purpose To set channel n of the PLC s Pulse Width Modulation PWM output with duty cycle represented by x 100 and ata frequency in Hz given by parameter y Parameters n PWM channel Range 1to 8 Once set the PWM channel will latch the set value until the next SETPWM statement on the same channel is executed x Duty Cycle Range 0 to 10000 If x is more than 10000 the duty cycle will be set to 100 y Frequency Range O to 50000 If y is more than 50000 the frequency will be set to 50khz Examples SETPWM 1 4995 2000 Comments PWM channel 1 will be st to operate at 49 95 duty cycle for PWM that can resolve up to 0 01 The actual resolution will depend on the PLC s PWM resolution The PWM frequency is set to 2000 Hz or nearest Fora 10 bit PWM the best resolution is about 1 1024 0 1 This means that in the above example the PWM will be rounded to 50 Please check the target PLC s manual for the actual resolution 12 64 SETSYSTEM n data Purpose Allow changing of certain default system s parameters Currently only th
255. on baud rate is the default baud rate of that Comm port unless it has been changed by the SETBAUD command PLC Comm port number 1 to 3 using ModbusASClIl or1lito 13 using Modbus RTU device ID of the MODBUS device 1 to 255 zero offset address of the holding register in the MODBUS device relay 3 READMODBUS 3 5 101 The relay will contain the 16 bit data obtained from the MODBUS device with ID 05 and from register offset address 101 in MODBUS tem this refer to the 40102 holding register Reading it into the relay channel allows bit level manipulation by ladder logic It can of course also be read into any data memory 12 27 Special See Also Chapter 12 This command automatically checks the response string received from the slave device for the correct LRC and the Slave address The status of the operation can be checked by the user program by testing the SIATUS 2 function which will retum a O if there is any enor or if the slave device is not present This command by default uses MODBUS function 03 to perom the read which means that it is designed to read from holding register addresses 4 xxxx You can force it to change to using function 04 in order to read from addresses 3 xxxx by executing SETSYSTEM 6 4 only for CPU with finmware revision r47 and above READMB2 WRITEMB2 WRITEMO DBUS STATUS 2 NETCMD _ SETSYSTEM 12 42 READMB2 ch ID addr var count Note Purpose Param
256. on directly by choosing the function name from the Select Function To Edit drop box as shown below TR RESEARCH 10 7 INTERNATIONAL Chapter 10 X C2 call sendNetCmd IF DM 200 _ status 0 Failed to set PLC s ID Probably CO E RETURN ENDIF PRINT 4 lt gt Close Ethernet Connection CALL RdComm4 clear buffer Select Function to Edit CALL ConnEthernet Connect to UUT via Ethernet 1 xReady 2 xMDRdy Use Ethernet Port to transfer program 3 xMDprog IF STRCMP A lt CONNECTED gt lt gt 0 5 xE10Prog 6 xE10Ready 7 xFPLCProg Order Sales 1 877 TRI PLCS 1 877 874 7527 8 xFPLCRdy Inquiry 8 30am to 5 00pm PST Mon Fri 9 TestMX3224 10 TestMX4832 11 TestE10 12 TestT22 Altematively you can scroll from one custom function to the next one using the Fn Traverse2 jog 1104 bytes and Fn Traverse3 jog 1113 bytes keys However Clicking on the Fn Traversel jpg 1199 bytes and Fn Traverse4 jpg 1122 bytes buttons allows you to scroll to the previous or the next non empty CusFn All empty functions will be skipped This is useful if you need to browse through all the custom functions to locate something 10 2 5 View Other Custom Functions The View Other Functions choice box allows you to view another custom function via a read only popup window without leaving the curently edited custom function This is very convenient when you need to view the content of another custom function while edit
257. ort Most modems RESEARCH INTERNATIONAL TR TRIANGLE A4 2 Appendix A can automatically detect the RS232 speed of the device and can assume any speed from 1200 2400 all the way to 115 200 bps The first ASCII character they receive from the device will determine the DTE speed that the modem will use to communicate with the device e The modem to modem communication speed is what you read on the modem specifications such as 33 6Kbps 56Kbps etc When two modems are connected they automatically negotiate for the best speed to Communicate between the two of them based on the quality of the phone connection and the maximum speed that both modemsare able to achieve We usually have no control of what speed they choose to Communicate But one thing is for sure which is that the modem to modem speed is always lower than the DTE speed Since the default communication baud rate of the Super PLC s RS232 serial port is 38 400 bps the PLC should send a modem initialization string to the modem on the first scan pulse so that the modem can recognize its default DTE speed i e 38 400 bps in orderto talk to the PLC E g To reset the modem you just have to send an ASCII string ATZ to the modem using the following TBASIC command PRINT 1 ATZ If you want your modem to automatically answerto an incoming call e g using TLServer 2 x 3 x modem dialing capability then you should execute the following TBASIC statement PRINT
258. orted and the function willbe aborted TRILOGI software is able to support up to 16 channels of 16 bit bipolar ADC which may has a range between 32768 and 32767 The actual number of ADC channels and the resolution will depend on the target PLC Note On the Legacy TLOOMD and TLOOMX PLCs there are 8 or less ADCs and all the A D are nomalized to 12 bit with a range of between O and 4096 12 3 ASC x n Purpose l To retum the numeric value that is the ASCII code for the nth character of the string x If x isa null string ASC x n retums value 0 n may start from 1 up to the length of the string Examples B ASC Test String 6 TRI De bes INTERNATIONAL Comments See Also 12 4 CALL n Purpose Examples See Also 12 5 CHR n Purpose Examples Comments See Also Chapter 12 B should contain the value 83 which is ASCII value of S If n is less than 1 or greater than string length ASC x n retums a 0 CHRS n To call another Custom Function CusFn n as subroutine When the called function retums execution will continue from the following statement n must be either an integer constant between 1 and 256 or the label name of the Custom Function defined in the Custom Function table IF B gt 5 THEN CALL 8 ENDIF CALL Addition Addition must be a defined name RETURN To convert a number n into its comesponding ASCII character n must be a numeric constant Oto 255 C
259. ot yet been saved 8 2 Edit Menu 8 2 1 Abort Edit Circuit Changes made to the curent ladder circuit can be aborted if you execute this command before pressing lt Enter gt to accept changes made to the curent Circuit If changes have already been accepted by pressing the lt Enter gt key then this command will have no effect This command is useful if you wish to completely abandon changes you have made to a circuit without going through all the undo steps GC TRIANGLE T URA RESEARCH 8 9 INTERNATIONAL Chapter8 8 2 2 Undo lt Ctrl Z gt Undo the last changes made to a ladder circuit i TRILOG I automatically stores the last 10 edited steps so you could execute undo several times to restore the Circuit back to its original shape 8 2 3 Cut Circuit lt Ctrl X gt You can remove a number of circuits from the current ladder program and store them temporarily in the clipboard for pasting into another part of this ladder program or into another file altogther In other words it lets you move a block of Circuits from one part of the ladder program to another part or into another file Once you execute the Cut Circuit command a prompt box as shown below will appear You have to specify the range of the circuits you wish to cut and press the Yes button to remove them from the ladder program Cut Ladder Circuits to Clipboard x Please note that you can t UNDO a Cut Circuit operation 8 2 4 Copy Circuit Ctrl
260. ous ladder program has already started the timer with a value determined by the position of the potentiometer knob A2 2 4Motion Control of Stepper Motor The Super PLC can generate pulses to feed to stepper motor driver The maximum speed acceleration deceleration and total number of pulses to generate are definable using TBASIC Both absolute positioning commands and relative move commandsare supported Assignment 1 A DEFHOME input define the current location as home position 2 Press the START input to begin Indexing the stepper motor to position at 1500 2000 4500 and 9000 steps with respect to the HOME position Pause for 1 secondsat each position Retum to home at the end of the cycle 3 Maximum speed 5000 pps Acceleration L00 steps to full speed M Ieo A2 9 INTERNATIONAL Appendix 2 DEF HOME Fn_ 10 Ptr START Fn_ 11 PA ccs RLY5 Tlsec Pct Tilsec Fn_ 20 PA ccs Custom Function 10 STEPHOME 1 Define the HOME position for stepper 1 Custom Function 11 DM 1 1500 DM 2 2000 DM 3 4500 Store index position DM 4 9000 DM 5 0 N 1 STEPSPEED 1 5000 100 Stepperl Max 5000pps Acc 100 STEPMOVEABS 1 DM N 5 Move to position stored in DM 1 at the end turns ON relay 5 Custom Function 20 N N 1 IF N lt 5 STEPMOVEABS 1 DM N 5 Move to next position in DM N ENDIF at the end turns ON relay 5 Comments RLY5 is
261. p to your DIC nrmaram ta rhactl far tha LAK tan ta Antamina if Ti DE ES INTERNATIONAL 2 Append data to file Format lt APPEND filename gt data data data data lt gt 3 Email data to recipient Format lt EMAIL email address gt Sender sender amaill CA v TRIANGLE URA RESEARCH LAY INTERNATIONAL Chapter 4 Using TLServer the service it requested have been completed suc cessfully Eg To append thetime of an event to a file name testA ppend txt execute the following statements in a custom function when the event take place PRINT 1 lt APPEND testAppend txt gt Append data request PRINT 1 Event Time TIM E 1 TIM E 2 TM E 3 PRINT 1 A A PRINT 1 lt gt End of Service request e If the file does not exist a new file will be created Otherwise the PLC s real time clock data in the format hh mm ss and the value of A will be appended at the end of the file testAppend txt every time the above statements are executed e The TLServer will close the file after it receives the end of service tag lt gt from the PLC and it will in tum send a lt OK gt tag to the PLC to acknowledge that the APPEND request has been successfully completed It is up to your PLC program to check for the lt OK gt tag to determine if it the sernice it requested have been completed successfully E g To send data to an email address whoever yahoo
262. pleted It is up to your PLC program to check forthe lt OK gt tag to determine if it the service it requested has been processed This service allows the PLC to request the TLServer to open a text file and upload its content to the PLC This may be useful for loading some previously saved parameters Upon receiving this command and if the specified filename is successfully opened the TLServer will begin sending all the ASCII characters contained in the text file to the PLC Note that line breaks in a text file are sent to the PLC as CR character only and notasa CR HF pair As such ane PLC program can easily use tha INIDI Te 1 ta mar in all tha CD 4 22 Chapter 4 Using TLServer terminated text string one string at a time and then interpret or convert the data as necessary After sending out the last byte in the data file to the PLC the TLServer will send a CR terminated acknowledgement string lt OK gt to the PLC to signal that the READ command hasbeen propeny completed This service allows the PLC to get the Real Time Clock 5 Read Real Time data of the TLServer i e the PC in which the TLServer Clock From runson TLServer The type of data is indicated in the Date n and Time n parameter which cormespond to the DATE n Format and TIME n system variables in TBASIC lt READ RIC gt lt gt ie Date 1 year Date 2 nonth Date 3 day Date 4 Da yofWeek Reeg Time 1 hnour Time 2 minute Time 3 second
263. ply use the predefined port number 9080 However you may like to read the explanation box below regarding definition of a Port You can see that the default port for most public web serverss is port 80 You can define TLServerto listen at port 80 as well in that case there isno need to specify the port number in the URL However there are reasons why you may or may TR RESEARCH 4 10 INTERNATIONAL Chapter 4 Using TLServer not want to do that It depends on whether you are installing TLServer on a corporate intranet or on the public Intemet and whether the client TRILOGI is to access TLServer within the intranet environment or from the public Intemet Please read Appendix 2 PLC amp PC Hardware Setup and Configuration for an explanation of how to use the port number propery Ports or addresses within a computer are used to enable communication between programs Port addresses are 16 bit addresses that are usually associated with a particularapplication protocol An application server such as a Web server or an FIP server listens on a particular port for service requests performs whatever service is requested of it and retums information to the port used by the application program requesting the service Popular Intemet application protocols are associated with well known ports The server programs that implement these protocols listen on these ports for service requests The well known ports for so
264. practice for ladder logic programming to update physical I Osin the midst of a program execution The REFRESH command is meant more for forcing an immediate output to be tumed ON or OFF duning time critical situations Hence it isimportant to allow a ladder logic program to finish its scan so that the physical l Oscan be updated You should never hog the CPU within a particular custom function as this will mean the rest of the ladder program don t have a chance to be executed ina timely manner A2 1 2The Difference Between CusFn and dCusF It is very important to understand the difference between the two formats of the custom functions once you understand how the ladder logic scanning process works as described in the last section If you use the CusFn the custom function will be executed EVERY SCAN of the ladder logic program as long as its execution condition isON On the other hand the dCusF known as the differentiated or one shot format is executed only ONCE when its execution condition goes from OFF to ON The execution condition must go OFF and then ON again for the function to be executed again It is not difficult to see that the differentiated format is used far more frequently than the other one since most custom functions involve arithmetic and when a condition isON you most likely want the computation to be performed ONCE and not repeatedly in every scan of the ladderlogic You can easily understand the difference between the
265. qual sign is sufficient when assigning an expression to a vanable name The vanable type on both sides of the equal side must be the same i e string variable may not be assigned to a numeric expression and vice versa Important a When assigning a 16 bit variable to a 32 bit integer only the lower 16 bits of the 32 bit integer will be assigned Hence the programmer must take special care if the 32 bit number is out of the range of a 16 bit number which is between 32768 to 32767 b If a negative 16 bit number is assigned to 32 bit integer variable then the sign bit will be extended to 32 bits e g DM 1 123 A DM 1 The 16 bit hexadecimal value of 123 is amp HFF85 but A will be assigned the hexadecimal value amp HFFFFFF85 Their decimal representation are however the same TR RESEARCH 12 17 INTERNATIONAL Chapter 12 12 29 LOAD EEP addr LOAD EEPS addr8 LOAD_EEP16 addr16 LOAD_EEP32 addr32 Note Purpose gp ZE URA TRIANGLE RESEARCH INTERNATIONAL LOAD_EEP8 LOAD_EEP16 and LOAD_EEP32 are only available on PLCs with firmware gt r78 LOAD_EEP is equivalent to LOAD _EEP16 and is available on all firmware versions To retum a 16 bit integer data stored in the EEPROM FRAM by the SAVE EEP statement or 8 bit integer data stored in the FRAM by the SAVE_EEP8 statement or 32 bit integer data stored in the FRAM by the SAVE_EEP32 statement addrg Byte address of EEPROM FRAM add
266. r Logic Program In this tutorial we would like to create a simple program as Shown below e E i TRILOGI Version 6 45 C TRILOGNTL6 usr samples Demo PC6 Source gt aE File Edit Controller Simulate Circuit Help Circuit 1 BABE Gene sokmak FEE Start Stop Run il i2 ri RLY Run Duration ri ti IMi Run Step Manual Seq ri Il i3 cl AVseq Clk 0 5s Manual i3 Geo Ou oi OUT Outs 08 OUT Geo 3 Out2 o2 OUT Out oF OUT Seq1 3 Out3 o3 OUT Out6 06 OUT Geo A Out4 o4 OUT Outs 05 OUT EventCount O gt TRIANGLE E URI RESEARCH o INTERNATIONAL Chapter6 Simply follow the steps below to create your first ladder logic circuit e Open pull down File menu and select New e You should now be in the Browse mode of the logic editor The vertical line on the left end of the screen is the power line The cursor is at the position where you can key in your very first ladder logic You can also view a video version of this tutonal here 6 1 Ladder Logic Programming Tutorial STEP1 Before we commence the circuit creation let us define the I Os to be used for this program The following I Osare required Timers Duration 1 Click on the eTe button located on right hand side of the upper status barto open up the I O label editing Window You can also achieve the same with the lt F2 gt function key F LO Labels 2 Scroll
267. r as shown above Then left click on the icon to create a nomally open contact Scroll the I O table to the Special Bits table and select the item 0 5s Clock The parallel branch would have been completed by now Note The Special Bit table comprises some clock pulses and some other special purpose bits These include the eight built in clock pulses in the system with periods ranging from 0 01s to 1 minute Built in clock pulses are useful if you need a time base to create for example a flashing light A contact such as Clk 0 1s will automatically tum itself ON for 0 05s and then OFF for another 0 05s and then ON again resulting in a series of clock pulses of period 0 1 second 6 Next move the highlight bar to the right end junction of the parallel circuits as follow 5 i TRILOGI Version 6 45 Untitled o a File Edit Controller Simulate Circuit Help Ee AH Pf Fo of 9 a rl E a lr GS F Step Manual ri i4 j i3 Manual i3 7 Now click on the icon to insert a special function coil A popup menu will appear for you to select the desired special function Click on the item 4 AVseq Advance Sequencer to insert the Advance Sequencer function AVseq TR RESEARCH 1 1 INTERNATIONAL Chapter6 Select a Function DNCtr Decrement Rev Counter RSCtr Reset Counter UpCtr Increment Rev Counter AVseq Advance Sequencer RSseq Reset Sequencer StepN Set
268. re stored in comma delimited format described above with Integer data being save first then followed by the string data The comma delimited format makes it very easy fora spreadsheet program such as MSExcel to import the data into the spreadsheet for further processing You can also use MSExcel to generate data that are to be written to the EEPROM and then save the file as CSV file which can then be imported by EEPROM Managerusing the Load from File into Buffer button EEPROM Manager Applic atons RESEARCH INTERNATIONAL TRI TRIANGLE 8 90 Chapter8 a Using EEPROM Manager it is now possible to pre load the PLC s data EEPROM either as 16 bit integer or ASCII strings with pre defined content so that they can be used by the PLC program This is very convenient for implementing a lookup table or to define a large number of ASCII text string constants to be used for LCD display or communication without taking up too much program memory If you use the PLC s data EEPROM for data logging it is now possible to retrieved the saved data from the PLC and write it to the hard disk asa comma delimited text file which can then be imported into a spreadsheet or database program for further actions If you everneed to replace a PLC that logs data to itsdata EEPROM area you now can also use the EEPROM Manager to retrieve all the data EEPROM content from one PLC and transferthem to the replacement PLC so that
269. red by the TBASIC program when an ADC n command is executed in a custom function forADC n Note values entered at the ADC input text field will only be updated when the user press the lt Enter gt key or the lt IAB gt key to ensure that only finalized entries TR RESEARCH 10 18 INTERNATIONAL Chapter 10 are used by the TBASIC program otherwise imagine if you try to enter the value 123 at ADC 1 the program would first be receiving 1 then 12 and then 123 which wasnot the intention 10 5 2 Viewing TBASIC Variables The values of the intemal variables as a result of the simulation run can be viewed by pressing the lt V gt which stand for View key or by clicking on the View button while in the simulation screen A pop up window will appear with the values of all the variables as well as special peripheral devices supported by TBASIC The variables are organized into 4 screens You can move from screen to screen using the left right cursor keys or by clicking on the navigation buttons 2 View Variables Integers z Sim CO Te gtt oO OoOOO KA Vun A l ie ae vd r Oo b vunn u Jay foe TE J 4 lines LCD Display Date 2012 11 17 Time 17 18 24 Day Sat ei a Integer _ variables Screen The first screen comprises all 26 32 bit integer variables A Z the system DATE and TIME ADC DAC PWM and the resulting values of setLCD commands The initial DATE and TIME figures s
270. reen The physical I O number is now linked to the labelname All ladder logic contact symbols are nomally identified by their label names However you can also display an optional small eA TRIANGLE URA RESEARCH LAY INTERNATIONAL Chapter7 literal to indicate the I O types and number e g ilSinput 1 012 output 12 25 relay 25 tl timer 1 and c5 counter 5 5 lt 5 gt Refreshes the display If for some reason the screen is garbled by incomplete circuit display you can just press the lt F5 gt key to redraw the screen 6 lt 7 gt Opensany custom function If the currently selected circuit containsa custom function then it willbe opened for editing Otherwise i TRILOGI will ask you to selecta custom function froma menu 7 lt 8 gt Compiles the i TRILOGI program to show the compilation statistics 8 lt 9 gt Runsthe simulator without resetting any I O 9 lt Ctr F9 gt Resets all l Osand then runsthe simulator 10 lt Ctr F8 gt Resets all I Os except inputs and then runs the simulator 11 Up gt lt Dn gt lt PgUp gt and lt PgDn gt keys Use the up down cursor keys to move the marker to other circuits and the Circuit display at the upper status line will simultaneously reflect the change If you attempt to venture beyond the screen the logic editor screen will scroll The lt PgUp gt and lt PgDn gt keys can be used to scrollone page ata time 7 1 3 Navigating Circuits in Browse Mode
271. rement the counter beyond 0 it will underflow to become the Set Value All three counter functions DNctr UPctr and RSctr can operate on the same counter i e assigned to the same counter label on different circuits Although these circuits may be located anywhere within the ladder program it is recommended that the two or three functions which operate on the same counter be grouped together in the following order DNctr Upctr and RSctr Note that NOT all three functions need to be used to implement the reversible counter Decrement Counter DNctr ED TRIANGLE URA RESEARCH SE INTERNATIONAL Chapter9 OH Execution condition of DNctr function Gees SE MECH lr Er NEE 0002 Counter s Present Value P OH Counter s contact e O a Each time when the execution condition of a DNctr function changes from OFF to ON the present value of the designated counterischanged as follow a If the counters present value PV is inactive load the counter register with the Set Value SV defined in the Counter table minus 1 b If the counters present value PV is already 0 then load the counters PV with the SV defined in the counter table and tum on the counters contact also known asthe completion flag c Otherwise decrement the counter PV register by 1 Increment Counter Upctr Execution condition cema er ame of Upctr function Counter s Present sys VYalue PV ON Counter
272. rey color lamp represents an OFF state The I O number is indicated in the middle of the lamp The simulator requires the use of the mouse to work propery so it is important to rememberthe mouse button actions as follows Tum ON the I O when pressed Ler Mouse Button Tum OFF when button is released Toggle the I O when pressed once Right Mouse Button e OFF becomes ON and ON become OFF 4 Our ladder program requires us to push the Start button momentarily You can simulate this action by moving the mouse pointer to the Start label or the LED lamp and press the LEFT mouse button once and then release the button The action starts 5 Atthistime notice that the relay RUN is latched ON and the timer Duration begins to count down from the value of 1000 every 0 1sec and the Output 1 8 are tuming ON OFF sequentially in a running light pattem Sequencer Seq 1 in the Ctr Seq column begins to count upward from 1 to 3 and then overflowsto 0 and repeats continuously Foreach step of the Sequencer the corresponding Output will be tumed ON Our demo program will show a running light pattem starting from Outputs 1 amp 8 then2 amp 7 3 amp 6and4 amp 5 and then backto 1 amp 8 2 amp 7 6 Now you should verify that the logic works as intended by observing the ladder diagram You should notice that the Run labels in all circuits are highlighted asshown below bei Bass 6 17 INTERNATIONAL Chapter6
273. rl6 Word address of EEPROM FRAM addr32 Long Word addressof EEPROM FRAM Please refer to your PLC s reference manual for the upper limit of available FRAM EEPROM storage Byte Word and Long Word Addressing Note that the EEPROM space for 8 bit 16 bit and 32 bit SAVE_EEPXX and LOAD_EEPXX command are the same space and they are mapped as shown below LOAD_EEP32 LOAD _EEP16 LOAD _EEP8 1 23 amp 4 5 6 7 8 N O O 2NM amp N 4N 3 4N 2 4N 1 4N If you intend to use the EEPROM FRAM space to sore more than 1 type 8 16 or 32 bit of data then you must propery manage the EEPROM FRAM data space reserved for storing each type of data so that they don t overwrite each other address pace The easiest way is always to reserve enough space for 32 bit data followed by space reserved for 16 bit and or8 bit data 12 18 Examples See Also Chapter 12 E g If you have 6000 words 16 bit of FRAM space this means you have space for storing 6000 2 12000 bytes of 8 bit data and you only have 6000 2 3000 long words for storing 32 bit data Now assume that your program needs to store up to 500 x 32 bit data and the balance forstonng 8 bit data If you reserve 500 long words for 32 bit data that means you are using up 500 4 2000 bytes of the FRAM space This leaves you 12000 2000 10000 bytes of FRAM space for storing 8 bit data starting from byte address space 2001 to 12000 DM 1 LOAD_EEP8 10 A LOAD_EEP8 2
274. rmat and it is not recoverable So if you use non English I O labels your program will most likely fail to compile when it is saved asa PC5 file since the I O labels will be converted to ASCII and partially truncated Thus it is important to keep the o egen TRIANGLE 8 4 URA RESEARCH L SC INTERNATIONAL Chapter8 Orginal copy of your PC6 program so that you can work on it to resolve the Unicode conversion issues 8 1 6 View Protect Un Protect This feature allows you to prevent others from viewing a pre defined range of ladder logic and custom functions When you select View Protect command you will be asked to enter an unlocking password a range of ladder logic starting from circuit 1 as well asa range of custom functions whose content you wish to prevent others from viewing as follow Password Protection of TRILOGI File x Enter range of elements to protect from viewing View Protec The moment you click on the View Protect button you can no longer view or print the protected range of ladder circuits and custom functions When you save the view protected program it will be saved in an encrypted format and it Cannot be opened using older version of i TRILOGI software However you will sill be able to add new ladder circuits and custom functions to this program as well as modify those unprotected ladder circuits and custom functions Of course you will still be able to compile simulate and tran
275. rom the Controller menu in TRILOGI Only the IP address is necessary to configure for basic connection to the LAN a Please referto the Quick Connection guide in appendix 1 to connect the PLC to your PC via sral port Please refer to chapter 2 of the PLCs user manual for more detailed information on network configuration Network Wiring You will likely already have a network available that consists of an Intemet modem that provides Intemet to a wired or wireless router which has at least one PC connected to it In this case all that needs to be done is connect the PLC to the router with standard Ethemet cable The final network configuration will likely resemble the below simple network diagram f you are on a corporate network then you will need to consult the IT administratorto get the PLC connected to the network GC TRIANGLE _ URA RESEARCH 3 4 INTERNATIONAL Chapter3 Modem GE RJ4 inated straight through CAT5 Eth Cabl IP 192 168 1 1 5 terminated straight throug 5 Ethernet Cable Super PLC IP 192 168 1 5 IP 192 168 1 100 3 2 Software Interface The first section will describe TlServer setup which is used for seral port communication only If you will be connecting via Ethemet you can skip the TLServersection and go straight to TRILOGI Communication 3 2 1 TLServer Setup TLServer is the server program that provides serial connection to the PLC and TCP IP connection to the TRI
276. rst and then scanned as on in a following VO scan Input Sot Ex2 In the circuit below when Inputl goes from the off status to on status as described previously a single pulse will be sent to a Latch function that will latch Outputl to the on status The actual Latch function will only be activated fora single scan time just as Outputl was in the previous example but it will permanently latch Output to on until Outputl is unlatched using the Clear function This way Output will remain on even though Inputl has only sent a single pulse and Outputl will not be affected by any further rsing edge detections from Inputl can only be latched once until it is unlatched Ca TRIANGLE URA RESEARCH 9 3 LAS INTERNATIONAL Chapter9 inputi Fe uti The same principles can be applied to intemal bits and coils as were previously described for physical input contactsand output coils Once you understand these fundamental principles of interpretting a ladder diagram everything should become clearer and simpler Ladder diagram programming can be used to create a rather sophisticated control system However In i TRILOGI we augment its power further by allowing a ladder program to activate customized functionscreated in TBASIC 9 1 2 Relay Coils A contact can also be activated by the presence of an electrical current This makes it possible fora control system to control the tuming ON or OFF of a large load by using elec
277. rt a parallel special function coil to the current coil lt gt Invert the element from N O to N C or from N C to N O eis lt gt Convert the element to a rising edge triggered contact one shot gt Click to move the highlight bar to the right same effect as pressing the right arrow key This can be used to move the cursor to a junction which cannot be selected by mouse dick DEL Double dick to delete a highlighted element This acts as a safety against mistake When you click on an icon forexample the icon will change to a bright yellow colorto show you the element type that you are creating At the same time an I O table should appear on the screen with a light beige color background The I O table acts like a pop up menu for you to pick any of the pre defined label name for this contact This saves you a lot of typing and at the same time eliminates typo emm that could result in a compilation failure You should spend a few minutes to follow the Ladder Logic Programming Tutorial on the steps needed to create a ladder program As mentioned previously the ladder editor is intelligent and will only accept an action that can result in the creation of a corect ladder element Otherwise it will simply beep and ignore the command UNDO Circuit Editing If you have wrongly inserted or deleted an element and wish to undo the mistake you can either select Undo from the Edit menu or press lt Ctr Z gt key to undo the la
278. rt in ordernotto hold up the CPU Example For I 1 to 1000 loop 1000 times A INPUT 1 Read fom COMM1 IF LEN A lt gt 0 String isnot empty RETURN A contains data ENDIF NEXT SETLC D 1 1 Nothing received Comments A Camiage Retum CR or ASCII code 13 marks the end of a valid input string from the communication port The retumed string however will exclude the CR character In TRILOGI simulator the user will be prompted to enter the string in a pop up window See Also INCOMM PRINT ZS OUTCOMM 12 25 INTRDEF ch fn_num edge Purpose Enable Interrupt Input channel ch ch channel number 1 8 fn_num Custom Function number to execute when interupt pin changes according to the defined edge This is the Interupt Service Routine ISR edge Positive number means rising edge trggered 0 ornegative number means falling edge triggered See Also INTRO FF 12 26 INTROFF ch Purpose Disable Interupt Input channel ch See Also INTRDEF TS TRIANGLE 12 16 TRI RESEARCH INTERNATIONAL Chapter 12 12 27 LEN x Purpose To retum the numberof charactersin x Examples L LEN This is a test string C HR 13 Comments L 22 because blanks and non prnting characters are counted 12 28 LET Purpose To assign the value of an expression to a variable Synta x LET variable expression Examples LETD 11 A Welcome to TBASIC Comments LET statement is optional i e the e
279. rts These newer PLCs will NOT be forced to 9600 bps unlike that of the RS232 port on the M seres PLCs 4 2 3 Modem Support L Dial Modem TLServer 3 x incorporates support for dialing a modem connected to the PC s com port This is useful if the PLC has to be located ata remote location yet still has access to the public telephone line orto a cellular phone You can then connect the PLC to a standard analog modem such as the US Robotic 33 6Kbps or Hayes Acura smart modem The TLServer can then dial the phone number of the remote modem and make a connection Once a connection is established the remote PLC is immediately accessible to client applications such as i TRILOGI or TRi ExcelLink etc over the Intemet Intranet or localhost asif it were connected to the TLServer via the serial port directly fe gt TRIANGLE 7 TRY RESEARCH 4 6 INTERNATIONAL Chapter 4 Using TLServer Notes e Due to the time delay for modulation demodulation process as well as transmission delay two way communications via modem tends to be noticeably sowerthan connection made by direct cable connection This is quite normal and doesnot indicate a problem with the communication setup e The PC s modem must be able to emulate the COM port of the PC in order for the TLServer modem function to work Some of the newer computers employ win modem or soft modem which may only work with Windows dial up networking These kinds of modems are implemented in
280. rve the logic states of all Inputs while resetting all other data Note that the lt Ctr F8 gt key also works in the Simulator screen so that at any time you can reset the simulator without affecting the logic states of the inputs Ton Bakes Si INTERNATIONAL Chapter8 8 4 3 Continue Run no reset lt F9 gt Use this command to continue simulating the program since you last closed the simulator All previous data are kept intact and will be used by the simulator to continue execution of the ladder program If you have made changes to the ladder program or custom functions the whole program will be recompiled before running Note that first scan pulse 1st Scan will not be activated when this command is executed since this is supposedly a continuation from the previous simulation run This command can be useful if you have discovered a simple bug in your software during simulation you can fix it immediately and test the effect of the change on the simulator instantly without restarting the entire simulation session from the beginning again 8 4 4 Compile Only lt F8 gt Allows you to compile the i TRILOGI file only in order to view the compilation sta tistic s Compilation Ss Success Total Number of circuits Ladder Diagram words Custom Function words Total code Size Checksum 00001036 DIFU DIFD One shot contact 0 max 256 OK 8 4 5 Reset All I Os lt Ctrl R gt Clears all
281. s i TRiLOGl Version 6 4 SS LocalHost Applet htm re TLServer Version 3 1 i Uninstall 1 TRiLOGI 6 45 build 01 4 Back You can also open My Computer and open the folder CA TRILOGN TL6 then double click on the file TL6 bat to start i TRILOGI Application Note that during the installation of the language pack the TL6 bat file will be replaced by the TL6 bat specific to that installed language E g For running TL6 with Chinese language support the TL6 bat will contain the following command line java Duser language zh jar TL64 jar The command line above forces the i TRILOGI to run with the Chinese language Zh encoding Assuch do not start the i TRILOGI application by double clicking on the TL64 jar file directly since that will only run i TRILOGI in the US English language instead of the language of choice The third altemative is to run the program from DOS command line First run the MS DOS prompt aka Command Prompt in Windows XP and then navigate to the directory CA TRILOGI TL6 assuming that is the folder TR RESEARCH 2 INTERNATIONAL Chapter5 where you ve installed i TRILOGI At the directory enter the following command line C TRILOGN TL6 gt java_ jar Duser language xx TL64 jar where xx is the ISO defined two characters definition of the language code Eg es for Spanish ko for Korean and zh for Chinese NOTE The main window window size is memonzed in the config tl
282. s contact ee Each time when the execution condition of an Upctr function changes from OFF to ON the present value of the designated counter is affected as follow a If the counter is inactive load the counter register with the number 0001 TR RESEARCH 9 10 INTERNATIONAL Chapter9 b If the counters present value PV is equal to the Set Value SV defined in the Counter table load the counter register with number 0000 and tum on the counters contact also Known asthe completion flag c Otherwise increment the counter PV register by 1 Reset Counter RSctr When the execution condition of this function changes from OFF to ON the counter will reset to its inactive state This function is used to reset both a reversible counter and an ordinary down c ounter coil 9 3 2 Sequencer Functions AVseq RSseq and StepN Please referto the documentation on Using i TRILOGI Sequencers 9 3 3 Latch Relay Function Latch Latching relay is convenient for keeping the status of an execution condition even if the condition is subsequently removed The program elements that are assigned as Latching Relays will remain ON once they are energized Only Relays and Outputs may be assigned as Latching Relays On selecting Latch function you can use the left nght cursor keys or click on the left right arrow keys to move between the Relay and Output tables The selected relay or output will now be assigned asa Latching Relay
283. s is then used to compute the calibration parameters and the program will store the calibration parameters into the PLC and reboot it again The analog inputs are thus completed ina single step You may also use different voltage references to calibrate different analog channels Simply leave the channel s that you do not want to calibrate with the currently selected voltage source BLANK Note The calibration tool will NOT calibrate any channels whose field are left blank RESEARCH INTERNATIONAL TR TRIANGLE 8 37 Chapter8 2 Analog Outputs DAC Calibration In order to calibrate an analog output you need to set the DAC to a certain value and then use a measuring instrument to measure the resulting output voltage orcurent if an AN20MA 2 interface board is used The difference between the expected DAC output and measured DAC output is used to compute the calibration parameters for the PLC s analog output Analog Outputs DAC Calibration Ch Ch 2 Ch3 Ch A SETDAC 0 4095 2048 _ 2048 _ Chi Ch 2 Ch3 Ch A Measured DAC 2056 2039 0 to 4095 SETDAC amp Read DM 1 to DM 4 Calibrate Analog Outputs Close For example if you wish to calibrate analog output 1 and 2 and using an analog output value of 2048 you first must clear the old analog calibration paramters using the Ethemet amp ADC Configuration Tool gt Advanced Config then write a program into your PLC to
284. s up scroll to the Special Bit table and select the TR RESEARCH 6 12 INTERNATIONAL Chapter6 item 1 SeqN x When prompted to select a sequencer choose Sequencer 1 and another dialog box will open up for you to enter the specific step number for this sequencer At this point you should enter the number 1 since we are using Step 1 3 We have thus far been creating ladder circuits only by clicking on the ladder icons A short cut method of choosing elements to be created without using the mouse does exist Observe the icon carefully and you will notice a small numeral at the lower right hand comer of each icon which cormespond to the shortcut key You may wish to try this short cut for the remaining part of Circuit 3 Press the lt gt key and the Output table will immediately pop up for selection of a coil Pick Out1 from the Output table and the Out1 coil willbe connected 4 Circuits 4 5 and 6 are very similar to Circuit 3 and you shouldn t have problem creating them Complete these circuits and we are ready for some interesting simulation exercises When you have created all the circuits press lt Enter gt key or lt ESC gt key at the last blank circuit to end Ladder Edit mode 5 Next we want Seql 4 contact to execute a Custom Function the abbreviation is CusF A custom function is one that you can create to perom very sophiscated control actions using the TBASIC language The Custom function ca
285. s used Like READMODBUS command the status of this operation can be checked by the user program by testing the STATUS 2 function This command by default uses MODBUS function 03 to perform the read which means that it is designed to read from holding register addresses 4 xxxx You can force it to change to using function 04 in order to read from addresses 3 xxxx by executing SETSYSTEM 6 4 only for CPU with finmware revision r47 and above READMODBUS WRITEMODBUS WRITEMB2 STATUS 2 SETSYSTEM 12 43 REFRESH Purpose gp ZE TRI TRIANGLE RESEARCH INTERNATIONAL To Force immediate refresh of the physical inputs and outputs This can be used after executing a SETBIT or CLRBIT command on an output n vanable and to force the physical output to change immediately subject to I O refresh time delay Otherwise the physical output will only be updated during the nomal refresh cycle which will occur only at the end of every ladder logic scan This is useful for situations that require immediately action such as shutting down a load during an emergency This command is likely to be used mainly by an Interupt CusFn 12 29 Comments 12 44 Purpose REM Examples 12 45 Purpose RESET Comments gp ZE URA TRIANGLE RESEARCH INTERNATIONAL Chapter 12 The REFRESH command takes approximately 0 5ms to complete on the Nano 10 and F series PLCs 1ms on the FMD series PLCs and up to 2
286. sa masterto a bunch of PLCsconnected together via their RS485 port TLServer can be configured to scan the intemal vanables of any of the up to 256 PLCs ID connected to it to determine if any of these PLCs hasa request for the TLServer to send out email If so the TLServer will then retrieve the email data from the relevant PLC constructs a complete email and send it out Click here for more details Email Method 2 Using TLServer as Email Slave In this setup the TLServer will monitor the data it receives via its seral port fora special EMAIL tag which triggers a sequence of actions where it receive the sender recipient subject and mail content via the serial port When all the data have been received the TLServer will connect to the SMTP server and send out the email In this setup only 1 PLC may be connected to the TLServer to send out emails since it is a one to one interaction between the PLC and the TLServer program For more details on this email method please view the File and Email Services section Email Method 3 Using TLServer as Email Relay Server NEW As you will see shortly since version 3 16 the TLServer can be setup to work with both SMTP servers that require authentication and those that don t However the default email function on the Nano 10 FMD and F series PLCs does not support account authentication to communicate with the extemal SMTP server If the PLC is connecting to the SMTP server provided by the ISP then
287. said timer contact This allows those ladder rungs which use the timer contact to have a chance of being executed before the self resetting rung clearsthe timer mes A2 3 INTERNATIONAL Appendix 2 A pulse will be sent to Out 5 periodically determined by the Set Value of timer T1 Out5 Out TI TIM A2 2 TRILOGI Sample programs There are many well documented demos as well as practical TRILOGI program examples included in the following TRILOGI installation folder lt TRILOGI installation folde rA ua samples When you click on TRILOGI s File gt Open Local Drive command you will be able select the usr s folders where program files are stored By default only two usersare defined Administrator and samples as follow Loading Local File Look In C usr e co le ca BRY B CT Administrator c3 samples File Name Files of Type TRILOGI Version 6 Files Open Cancel TR RESEARCH A2 4 INTERNATIONAL Appendix 2 You should open the samples folder and select any files with PC6 extension for viewing Loading Local File Look In C samples D EI fel ca P FileService_Modem J Server IN Call pc6 C aDC pc6 C clock zh PC6 Analog Timer PC6 C Clock PCc B Blank pc6 IN ClockPulses pc6 File Name Files of Type TRILOGI Version 6 Files There are al
288. sert a N O parallel contact to endose one or more elements lt 6 gt Right dick to insert a N C parallel contact to endiose one or more elements lt 7 gt Insert a normal coil which may be an output relay timer or counter dl ell 2 JI E Stile di Wa lt 8 gt Insert a parallel output coil not an entire branch to the current coil Fn a lt 9 gt Insert a special function coil which indudes execution of CusFn Anel lt 0 gt Insert a parallel special function coil to the current coil lt gt Invert the element from N O to N C or from N C to N O P a a lt gt Convert the element to a rising edge triggered contact one shot Click to move the highlight bar to the right same effect as pressing the right arrow key This can be used to move the cursor to a junction which cannot be selected by mouse dick H Double dick to delete a highlighted element This acts as a safety against mistake DEL 2 Now insert the first element by left clicking on the icon The icon will change to a bright yellow color to show you the element type that you are creating At the same time an I O table should appear on the screen with a light beige color background instead of the nomal light blue background The I O table now acts like a pop up menu for you to pick any of the pre defined label names for this contact Note In i TRILOGI version 6 x if you p
289. sfer the protected program to the PLC asusual A view protected file can be unprotected by selecting the Un protect command from the File menu and supplying the unlocking password Note that this unlocking password is strictly for un locking the viewing restriction and it has nothing to do with other usemame and or password required for interacting with the PLC This View Protection command is extremely useful for OEMs who wish to allow end users of their equipment to modify orappend to the PLC s program for ease eD TRIANGLE _ Da RESEARCH 8 5 INTERNATIONAL Chapter8 of interfacing to other equipment but without revealing the core content of the PLC program to the end user Besides being able to protect the OEM s intellectual property it will also help to prevent the end users from mistakenly modifying the core program which can lead to disastrous result 8 1 7 Write Compiled Code to Disk This new feature is added since i TRILOGI version 5 32 You can now write the compiled program code to a disk file so that you can send the compiled code with a CO5 extension to your end customer to upload to the PLC using a standalone IL Uploader program This allows you to protect your source program file content while giving the end users of your equipment the ability to upgrade the PLC program The end users DO NOT need to install the i TRILOGI or the Java JRE in order to use the TL5 Uploader program so that makes it more fl
290. sing Latch function Step 2 tums ON and latch Output B Step 4 tums OFF Output A using the Clear function and Step 6 tums OFF Output B All other steps 3 5 7 0 have no connection 9 4 3 Program Example Assume that we wish to create a running light pattem which tums on the LED of Outputs 1 to 4 one ata time every second in the following order LED1 LED2 TR RESEARCH 7 18 INTERNATIONAL Chapter9 LED3 LED4 LED4 LED3 LED2 LED1 all LED OFF and then restart the cycle again This can be easily accomplished with the program shown below Oli Us meg AY seg end LEI OUT Gen Sege LED QUT DGend d end 3 LEDS QUT Gen b Gen A LED4 OUT Beqe 5 Stop SE e cre The 1 0s clock pulse bit will advance increment Sequencer 2 by one step every second Sequencer 2 should be defined with Set Value 8 Each step of the sequencer is used asa nomally open contact to tum on the desired LED for the step A Stop input resets the sequencer asynchronously When the sequencer counts to eight it will become Step 0 Since none of the LED is tumed ON by Step O all LEDs will be OFF bei Wegen 9 19 INTERNATIONAL Chapter 10 Chapter 10 Introduction to TBASIC Custom Functions GC TRIANGLE URA RESEARCH L N INTERNATIONAL Chapter 10 10 INTRODUCTION TO TBASIC CUSTOM FUNCTIONS 10 1 Overview i TRILOGI Version Dax supports user created special functions known as Custom Functions the symbol
291. snot support floating point computation in order to handle decimal value 1 5 C in this application we use a unit integer to represent 0 1 quantity All temperature readings are x10 times Hence 16 0 C is RESEARCH INTERNATIONAL TR TRIANGLE A2 12 Appendix 2 represented by 160 10 0 C is represented by 100 This method known as fixed point computation is quite commonly used in industrial control program A2 2 7Closed Loop PID Control of Heating Process PID Controller A D 1 E g Implementing Closed loop Digital Control with PID computation function PID Controller Transfer Function K G s KP KD s 1 Proportional Band 1 Kp Proportional Gain Ki Integral Gain Integral Time Constant Assignment 1 Read desired set point temperature froma potentiometer connected to A D 5 S with temperature range between 50 0C 200 oC 2 Measure the process temperature from a thermocouple signal conditioner attached to A D 1 T 3 Compute the Eror S T Apply Proportional Integral Derivative P I D algorithm to compute output X 4 Apply output X to Digital to Analog converter D A 1 to control a vanable position valve that feed fuel to the flame 5 Sample and compute every 1 second Full scale A D range is 4096 Range of Set Point A D 5 0 gt 450 0 C RESEARCH INTERNATIONAL Tri TRIANGLE A2 13 Appendix 2 A D 5 4096 gt 4200 0 C Range of Se
292. so known asthe Intranet IP address The intranet IP address is assigned by either the System Adminstrator or the router known as DHCP server You can access this computer from other computers in the same LAN but the intranet IP addressis not accessible from outside of the LAN To access the TLServer from outside of the LAN You will need to configure your router s intemal settings to define the PC that runs the TLServer as a Virtual Server You can then access the TLServer using the router s public IP address and the router will does the job of translating the public IP address to the intranet IP address and route the messages to from the PC that has been defined as the virtual server This process is known as Network Address Translation NAT 4 Dial Up Users If you are testing the intemet capability of TLServer using dial up connection you must connect to the Intemet first before starting TLServer so that TLServer can report the correct Intemet IP address to you You will not see the local host IP address 127 0 0 1 only the Intemet IP address will be shown The moment TLServer is running it is ready to accept connection from the i TRILOGI client You can also configure TLServers communication port setting add remove users from the system and set up TLServer to query the PLC for outgoing email requests and process them accordingly For explanation of the function of each button click the image link of respective buttons below You
293. so sub folders within the samples folder where sample programs that relate to a particular topic or device are stored such as those relates to using the MD HMI We strongly encourage you to open these example programs to see how these programsare structured Most of these programscan be run in the simulator except those that involve communication with other devices or high speed counters A2 2 1 Display Alphanumeric Messages on built in LCD Display FMD series and F series PLCs all come with a built in LCD display port that allows low cost connection to industry standard LCD display module For such PLCs programming of the LCD display is via the SETLCD statement supported by TBASIC language Assignment Every 1 second display a message as follow Temp Check Sitting Rm xx C Where xxdependson reading of A D 1 which is retumed by function ADC 1 TRI RESEARCH A2 5 INTERNATIONAL Appendix 2 Full scale A D is 4096 A D range 0 to 4096 gt Temperature 0 to 50 C En zl 8 WA Cus Custom Function 1 setLCD 1 1 Temp Check Display at at Column 1 Linel setLCD 2 1 Sitting Rm STRS ADC 1 50 4096 2 CHRS 223 4 C Comment Every one second the special bit Clk 1 0s closes and activates Function 1 Within the Custom Function 1 ADC 1 reads the A D converter 1 and converts it into degrees The integer value is then converted into a two digit string usi
294. ssenandanwnnnntisunsnsiansenecssewssasnnsa 12 41 12 59 SETO aD CUA isvsessessstcncsescsssacsssensissansastutasteasnsnssasansanunsascaisususeseunadennae 12 41 12 60 All ee BE 12 41 12 61 SE TPA SIV RD SN ssiics cssissistsssscai snciesssdinsnativcastecandscacsidenandieacasaseassanssaenn 12 42 12 62 SETPROTOCOL ch MOE secesscsscccscenscecscccsccessccescesscesscessccsnnecsnesnnessnesssnss 12 43 12 63 SETPVM N AA sscnsecansncsssanssanssansnasssvanswasttsnsusawasssavsesendanewscsasendenns 12 45 12 64 SEESYSTEM NC 12 45 12 64 1 COM RESPONSE Wait Time oo EEN 12 46 12 64 2 Numbe rof Com ReneS ssc wen eee einen iin Minna 12 47 12 64 3 Hostlink Command RESPONSE THING 1 00 ceeeseeteeeeeeeee eee cess eaeeeeesaeeeessaeeeetaeseeeeaeeaes 12 48 12 64 4 Configure Quadrature ENC odimg 12 48 12 64 5 DM s Cleared During Reser 12 49 12 64 6 Modbus FUnCHON Select ege geeggte deene anaa 12 49 12 64 7 Change ID a AE A wine 12 49 12 64 8 FASE Reie SI EE 12 50 12 64 9 Calibrate e 12 51 12 64 10 Number of I O to Support 12 51 12 64 11 Enable IRSREMO keeten aa a a 12 51 12 64 12 Pulse Measurement RBesolution 12 52 12 64 13 Dimmer Intenupt Enable sssssssssssssssssssssnsrnsnssnssnsnsistnsnssnrentnstntnonsrusnntnnentastnsnennnnnentns 12 52 12 64 14 Quadrature Encoder Config s sssssssssssssssssissrsnsersnstnsiernrnntntentnstntnonenunentnsnnennnennt 12 52 12 64 15 Analog Output RANGG u cccicccsecesvenscciecectcedteccebecestesagentestdiededbensdeuiedieseseatedhies
295. ssssssssessssssssnnnssiesnsessssssnccsessssscsessisessdssssssessasassasana 12 66 12 78 UC BAe E 12 66 12 79 TESTO labelname ssssssnssunnsennnnunnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn annnm nnnm nananana 12 67 12 80 TOGGLEIO labelname sssssensssunnnnnnnonnnnonnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nannamamma 12 67 12 81 WLS E E E E 12 67 12 82 WHILE expression ENDWHILE nsssss1sss1nnnnunnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nna 12 67 12 83 WRITEMO DBUS ch DevicelD address data ssnsnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 12 68 12 84 WRITEMB2 ch ID addr var COUNt nssnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 12 69 A 1 QUICK START PLC TO PC COMMUNICATION GUIDE 1 1 A11 Part 1 Serial Communication Setup Guide ss s sssensssunnnennnnunnnnnnnnnnnnnnnnnnnnn 1 1 A1 2 Part 2 Ehemet Communication Setup Guide ssssssnsssennssunnnnnnnunnnnnnnnnnnn 1 9 A 2 APPENDIX 2 APPLICATION NOTES amp PROGRAMMING EXAMPLES 2 1 A2 1 Important Notes to Programmers of TRILOGI Version 6 X eeeeeee 2 1 A2 1 1 Understanding Ladder Logic Execution bmcese AA 2 1 A2 1 2 The Difference Between CusFn and HCuoftk 2 2 A2 1 3 Timers Contact Updating Pmcess A 2 3 A2 2 TRILOGI Sample prograiie seesccsee eee eee 2 4 A2 2 1 Display Alphanumeric Messages on built in LCD Display A 2 5 A2 2 2 Setting Timer C ounter Set Values S V Using LCD Display sses 2 6 A2 2 3 Using a Potentiometer As An Analog Tmmer 2 7 A2 2 4 Motion Control of Stepper Motor
296. ssunnnunnnnunnnnnnnnnnnnnnnnnnnnn 5 2 6 LADDER LOGIC PROGRAMMING TUTORIAL 6 1 6 1 Ladder Logic Programming Tutorial STEPL ccsssssssesseecesneeeeeeeees 6 2 6 2 Ladder Logic Programming Tutorial STEP 2 s ssssssnusnnunnnnnnnnnnnnnnnnnnnnnnnnnnnnn 6 4 6 3 Ladder Logic Programming Tutorial STEP 3 eekrEREEEEEEEEEEEREEEEEEEEEEEEEEEEEuER 6 5 6 4 Ladder Logic Programming Tutorial STEP 4 sssssssnnsnnunnnunnnnnnnnnnnnnnnnnnnnnnnnn 6 9 6 5 Ladder Logic Programming Tutorial STEP 5 ssssssenusnnunnnnnnnnnnnnnnnnnnnnnnnnn nn 6 12 6 6 Ladder Logic Programming Tutorial STEP 6 0s scessee essence 6 16 7 I TRILOGI LADDER LOGIC EDITOR 7 1 7 1 The Browse Mode siissssisessisssssssssssnscsscssssssessssssnsssssassecsesesnscnnsssssncesansssanessanss 7 1 7 1 1 MOUSE ACON E 7 1 7 1 2 Keyboard Ac Dons ege onenari aai ekia a eai eaa aE AEEA EE 7 1 7 1 3 Navigating Circuits in Browse Mode AA 7 2 7 2 The Circuit E TE 7 4 7 2 1 JET deu ul 7 4 7 2 2 WSS EECHER Leesberg feet ee stiies cnn dvs ccidenatebeca AA N 7 5 7 2 3 Move el 7 5 7 2 4 Append C ire EE 7 5 7 2 5 Delete C reut geet eege deed ee linn aa ee 7 5 7 3 UCNE TE 7 6 7 3 1 CUC MEUG EE 7 6 7 3 2 Copy el Lt e E EE 7 6 7 3 3 Page ire uit e EE 7 7 7 3 4 FING CUE VE 7 7 7 3 5 GOO CG EE 7 7 7 4 The Circ uit Editing Mode ssessssenssennnnnnnnunnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnmnnn nnmnnn 7 7 7 4 1 MOUSE ee e Le EE 7 8 74 2 Create Ladder Circuit Using The Keyboar AA 7 9 8 TRILOG
297. st step The undo buffer stores the last 10 editing steps You can also choose to abort all the operations on the curent circuit by selecting Abort Edit Circuit to abort all changes made to the curent circ uit 7 4 2 Create Ladder Circuit Using The Keyboard Users of existing TRILOGI version 3 x or 4 x who are familiar with creating ladder programs using the keyboard will be delighted to know that they can still create INTERNATIONAL TR RESEARCH 7 9 Chapter 7 their ladder programs using the keyboard The keyboard actions are described below Left Right Up Down cursor keys The cursor keys are for moving the highlight barfrom one element to anotherin their four respective directions You can only move in a direction which will end up with an element lt ESC gt Press lt ESC gt key to end the circuit editing mode and retum to the browse mode of the logic editor lt Enter gt When you are done with editing the current circuit hit lt Enter gt to proceed to the next circuit lt SHIFT gt or lt IAB gt If you observe the highlight bar carefully you will notice a dark green color square at the right end of the highlight This indicates the insertion location where a seres contact will be attached You can change the insertion location to the left orthe right of the highlight bar by pressing the lt SHIFT gt key Note prior to Version 5 32 only the lt IAB gt key was used for this purpose but lt IAB gt k
298. statement to mark the end of the loop WHILE ENDWHILE CONTINUE 12 13 GetCtrSV n GetTimerSV n Purpose Note See Also pn A TRI TRIANGLE RESEARCH INTERNATIONAL Retum the SetValue SV of the Counter n or Timer n n should be between 1 and the maximum number of timers and countersin your PLC Although the present values P V of timers and counters n can be accessed directly as vanables TimerPV n amp CtrPV n the Set Values however can only be obtained by these two functions SetC trSV SetTimerSV 12 7 Chapter 12 12 14 GETHIGH16 v Purpose This function retums the upper 16 bit of a 32 bit integer varable v Thiscan be used to break the value of a 32 bit integer data or varable into two 16 bit values so that they can be saved to the EEPROM orto the DM n Examples DM 1 GetHIGH16 A save EEP GetHIGH16 amp H12345678 10 See Also SETHIG H16 GOTO n Purpose To branch unconditionaly out of the nomal program sequence to a specified line with label n within the present Custom Function The destination line must have a corresponding line label marked as n where n must be a constant within 0 255 Note that the label is local only to the present CusFn i e another CusFn may have a label with the same n but the GOTO n will only branch to the line label within the same CusFn Examples 156 SETBIT 0 3 GOTO 156 Comments An emor message will appear during
299. string in TBASIC and will be ignored if you use PRINT n statement to send out CHR 0 OUICOMM 2 225 To set a breakpoint for executing the CusFn This is used mainly for debugging a CusFn By Inserting a PAUSE statement at the place of interest you can suspend the program execution when PAUSE is encountered after which you may examine the values of the relevant variables You can continue to perform on line monitoring of the PLC that has been paused Program execution can also be continued by pressing the lt P gt key during Simulation or On line Monitoring 12 36 PliDcompute ch E Purpose gp ZE URA TRIANGLE RESEARCH INTERNATIONAL This function computes the output for the PID compensator controller using the P I and D Gains defined in the PIDdef statement for the same channel ch The integral and differential values are stored within the channel s intemal data space and will be automatically used by the PID computation routine The PIDcompute function uses the mt max limit tem of PIDdef statement to limit the results of its computation If the absolute value of the computed result is greater then Imt then the result will be set equal to Imt for e number and to mt for negative value When this happens the integral term will not accumulate the current 12 22 Chapter 12 emor to prevent an integrator windup which is very undesirable forthe system channel number 1 16 Closed loop Eror i
300. t 4 DNS Server IP Address DNS Server 0 0 0 0 DNS Domain Name Server allows the FServer to contacta remote location by means of domain name instead of IP Address The DNS takes in the given C TRIANGLE LIFPQN RESEARCH 8 26 LA INTERNATIONAL Chapter8 domain name such as yahoo com and retums the IP address of the target server You only need to fill in the DNS IP Address if you are asking the FServer to contact a remote server by domain name instead of by IP Address However currently this feature is not supported on the FServer and hence it may be left as the default value of 0 0 0 0 5 No of Connections FServer Modbus TCP Number of iy i a Connections Fserver MBTCP The F series CPU assigns sufficient memory to support up to a maximum of 6 simultaneous TCP IP connections to the FServer and Modbus TCP server By default each serverisassigned a maximum of 3 connections each However to improve flexibility you can re assign the mix of maximum connections between the two serversasSlong asthe no of Modbus TCP connections does not exceed 5 and the no of FServer connections does not exceed 4 This means that you can define 1 to 4 FServer connections and 2 to 5 Modbus TCP connections When you change the number in one box the other box will change automatically so that the total number of possible connections remains at 6 6 FServer Port No FServer Port 9080 i The Port numberisa 16 bit integer range 0 to
301. t Step to highlight it Then right click on the icon to create a N C parallel circuit that encloses both the Step and the Manual contacts A cross will appear at the left hand end of the Step contact indicating that this is the starting location of the parallel circuit You should now click on the Manual contact to select the ending location for the parallel circuit The yellow highlight bar will be positioned at Manual contact now 4 You will notice that the icon has now changed into a yellow color N C contact Eis with an opposite connection am You should now click on the H symbol to close the parallel branch One possible short cut method isto double click atthe ending location to close the branch As usual an I O table will be opened for you to select the I O For now select the Manual label from the input table to create the following circuit e s i TRILOGI Version 6 45 Untitled Co Jee File Edit Controller Simulate Circuit Help EE PA lA d E el nid ad oe lr E SegN x H Normally ON 0 01s Clock 0 02s Clock 0 05s Clock 1s Clock Os Clock min Clock SEI II Em EW 7 o EW o ER 0 5s Clock 10 i 11 i 12 CG TRI RESEARCH 6 10 INTERNATIONAL Chapter6 5 Next we want to insert the special bit Clk 0 5s to the left of the Manual contact Press the lt SHIFT gt key to move the insertion point to the left end of the highlight ba
302. t we want to tum ON the Manual input Move the mouse pointer to the Manual input and then press the right mouse button Manual input will be TR RESEARCH 6 18 INTERNATIONAL 10 11 12 13 Chapter6 tuck at ON state even after you have released the right mouse button Click on Manual button using the right mouse button again and it will be tumed to OFF When Manual input has been tumed ON the running lights should stop This is because the nomally closed contact of the Manual input in Circuit 2 is now tumed OFF and the 0 5s clock pulse could not trigger the AVseq function anymore If you now left click on the Step input the running lights will move one step ata time in response to your mouse click Observe the Seq1 x contact with respect to the counter value of Seql and the logic of this circuit become very Clear instantly Observe that the timer Duration continues to count down every 0 1 second and when it reaches 0 the Duration output coil label will be highlighted You can use this timer to stop the program by connecting a N C Duration contact to Circuit 1 This is left asan exercise for you You can also observe the execution of the Custom Function 1 by clicking on the View button on the Programmable Logic Simulator screen and the following window will appear ViewVariable Integers qoragat G8 8 88 TIR Hen A m Gh Mee ar D DO E Ba De a m ek nm 2
303. t sensitive Helps 4 m Forthe purposes of this tutorial the Demo PC6 program will be referenced This is a sample program that is included in the i TRILOGI installation This sample program aswell asall the other included sample programs are accessible from the CA TRILOGI TL6 us samples folder Below isthe Demo PC6 program Oo gt TRIANGLE URI RESEARCH 3 8 INTERNATIONAL Chapter3 File Edit Controller Simulate Circuit Help QaagA r eoma MER Circuit 1 Run ri it Step Manual Seq D j i3 el Avseg CIk 0 5s Manual i3 Program Transfer All teps are the same whether the PLC is connected via serial port or Ethemet unless otherwise specified 1 Select Program Transfer to PLC from the Controller menu or press CRL T on the keyboard File Edit Contro Circuit Simulate Circuit Help Select Controller Disconnect from Server On Line Monitoring Transfer COS file to PLC Open Matching Source File Get PLC s Hardware Info Set PLC s Real Time Clock EEPROM FRAM Manager Ethernet amp ADC Configuration Auto Calibrate Analog 2 The Login to TlServer window will open as shown below Although it mentions TLServer it is actually used to login to either server TLServer or INTERNATIONAL O TRIANGLE TRY RESEARCH 3 9 Chapter3 FServen Connect via serial port to TLServer Connect via Ethemet to FServer Login To TLSever
304. tangular box around the line asshown below pi We 10 23 INTERNATIONAL Chapter 10 SETLCD 0 0 CHR4 DM 1000 8 _ Clear LOD screen f This is used to store the timezone PST SETLCD 1 1 Resolving DNS lt DNS time nist qov gt make a connection te NIST t a OC S STATUS 3 SETLCD 2 1 A A contains the response from DNS service PRINT n x5 y z Statement Purpose To send a string of ASCII characters formed by its parameter list x5 y z out ofthe PLC to other devices via the communication channel n Parameters n must be an integer constant of between 1 and 8 Integer value in the parameter list y 2 will be converted into the ASCII representation Each parameter must be separated Find Find AIl d 15 fnGetDNS EE Rename CusFn 1 iew Other CusFn PRINT Undo Define Toggle Breakpoint C Send Brk Pts to PLC View Var If you click on the Toggle Breakpoint button again the blue box will disappear which means the breakpoint has been cleared Note 1 You can define up to a maximum of 8 breakpointsin a program 2 Comment Remark lines and blank lines are not compiled and breakpoint should not be set on any of these lines 3 The breakpoints that you ve defined are saved along with the program Each breakpoint can be cleared individua
305. ted by older TL5 applications TL6 assumes that all PC5 files are stored in ASCII format and will load it accordingly To display PC5 files in the file dialog simply enter the string PC5 in the File Name text field and press lt Enter gt The window will now display only files with PC5 extension You can then navigate to the folder that containsthe PC5 files to pick the file you want to open The default file extension for saving a i TRILOGI file in TL6 is PC 6 This signals to the TL6 application to save the data in Unicode format Unicode is required to store intemational characters which cannot be propery saved in the ASCII format used by TL5 However you may still save the currently opened i TRILOGI file in TL6 to a file with an extension PC5 which will then instructs TL6 application to save the file in ASCII format Files saved with PC 5 extension may then be opened using older TL5 applications Import Notes 1 Since PC6 files are saved in Unicode while PC5 files are saved in ASCII code format the two files type are NOT interchangeable Therefore you must not simply change a file name extension from PC5 to PC6 via Windows File manager and then attempt to open it from TL6 Doing so will cause TL6 to complain that it isnota valid i TRILOGI file 2 Any Unicode characters used in the program that cannot be represent by 8 bit ASCII code will be lost when the file is saved in PC 5 fo
306. teger vanables e Special Vanables Used by EMIT 4x special 16 bit integer variables EMEVENT1 to EMEVENT4 emEvent 1 is also used for email purpose 16x 16 bitintegervarables EMINT 1 to EMINT 16 16x 32 bitintegervanables EMUNT 1 to EM UNT 16 11 2 4 Integer operators Operators perform mathematical or logical operations on data TBASIC supports the following integer operators a Assignment Operator An integer variable A to Z DM and system vanables etc may be assigned a value using the assignment statement A 1000 X H4 H len A b Arithmetic Operators Symbol Operation _ Example A B4C 425 Subtraction Z TIME3 10 Multiplication PRINT 1 X Y X A 10048 Y Y MOD 10 c Bitwise Logical Operators logical operations is perfom bit for bit between two 16 bit integerdata Symbol Operation 1 Example logical AND IF input 1 amp amp HO2 a logicalOR output 1 A amp H08 Exclusive OR A RELAY 2 B logical NOT A timerPV 1 bei Bass 11 6 INTERNATIONAL Chapter11 d Relational Operators Used exclusively for decision making expression in statement such asIF expression THEN and WHILE expression Symbol Operation Example fequalto EA O Netto WUER PVIDISO Op RelationalOR IFASOORB 1000 e Functional Operators TBASIC supports a number of built in functions which operate on integer parameters as shown below
307. terlock section i e ILoff need not be a matching pair for an ILock function 9 3 6 Differentiate Up and Down d DIFU and d DIFD When the execution condition for ADIFU goes from OFF to ON the designated output or relay will be tumed ON for one scan time only After that it will be tumed OFF This means that the function generates a single pulse for one scan time in response to the rising edge of its execution condition When its execution condition goes from ON to OFF nothing happens to the output or relay that it controls On the other hand when the execution condition for d DIFD goes from ON to OFF the designated output or relay will be tumed ON for one scan time only After that it will be tumed OFF This means that the function generates a single pulse for one scan time in response to the trailing edge of its execution condition When its execution condition goes from ON to OFF nothing happens to the output or relay that it controls CO V TRIANGLE 9 13 UR RESEARCH INTERNATIONAL Chapter9 Execution oy Condition oer DIFU function ow output or SE 1 scan time NOTE The dDIFU function can now be implemented asa single contact with the Rising Edge contact that is triggered once every time a rising edge is sensed More information on this new contact can be found in the Contacts section of the Contactsand Coils help page 9 3 7 Custom Functions CusFn and dCusF These two functions
308. the PLC Typically a straight through DB9 cable will need to be added to the adapterto extend the connection since USB to RS232 adapters are fairy short Here isa link to a known compatible USB to RS232 adapter supplied by Triangle Research http www tn plc com USB RS232 htm Super PLC Straight Thru Connect USB RS232 DB9 Cable to PC USB Port e RS485 All TRi Super PLCs have a two wire RS485 serial port screw terminal connector and can only interface to a PC via RS485 indirectly through a USB port For USB connection you will need a USB to RS485 adapter that plugs into the USB port of a PC and hasa two wire connection to the PLC usually labeled A amp Bor D amp D Twisted pair cabling shielded for noisy environments should be added to the adapter to make a connection since USB to RS485 adapters would not typically provide wire connection ED TRIANGLE _ URA RESEARCH 3 2 INTERNATIONAL Chapter3 Here isa link to a known compatible USB to R485 adapter supplied by Triangle Research http www tri pIc c om U 485 htm Te O ee BR to oe P o He i i Wess 000000000 o Miir t09 qe CB ooooooo0o 3 1 2 Ethernet Introduction All TRi Nano 10 FMD series F series and newer PLCs have an Ethemet port built in which can be used for programming and monitoring with the TRILOGI software aswellascommunication with other Ethemet devices and software These PLCscan connect to the PC runnin
309. the TLServer will setup the modem to automatically answer the incoming call on the first ring There are many uses of this capability e Any number of PLCs in the field can periodically dial in to a single TLServer and write or append the values of their intemal vanables to data files on the PC s hard disk using the PLC File Service commands This is extremely useful for deploying the PLC for data acquisition purposes You can format the data using CSV format so that the file can be readily imported into an MS Excel or Lotus 123 spreadsheet e The remote PLC can dial in and ask TLServer to send out its data to any email address immediately e The remote PLC can dial in and synchronize its real time clock with the TLServer e The TLServercan play the role of an ISP where the PLC can dial in and be accessible to the Intemet fe gt TRIANGLE 2 TRY RESEARCH 4 8 INTERNATIONAL Chapter 4 Using TLServer Some sample PC6 programs that enable a PLC to dial in to the TLServer and request forfile or email services are provided in the following folder C A TRILO G N TL6 usA samples FileService_Modem To prevent unauthonzed incoming call you can specify a Call ln Password string as described above If the Call ln Password contains any text other than an empty string then the incoming caller upon connection must immediately send a CR terminated string that matches the Call ln Password string in order to maintain the co
310. the input pulses a miving at channel ch of the pulse measurement pin Parameters ch channel 1 8 Comments The pulse measurement channel ch must have been CA v TRIANGLE URA RESEARCH LAS INTERNATIONAL enabled by the PMON statement already However if you need to use the HSC and the Pulse Measurement on the same channel then you don t need to execute both the HSC DEF and PMON so you should only need to execute the 12 26 Example See Also Chapter 12 HSC DEF The HSC DEF function will automatically configure the Pulse Measurement function so it is not necessary to use the PMON function in fact If you run the PMON command after HSC DEF it actually disables the HSC However if you use only the PMON function it would not enable the HSC function If the pulses stop coming in then PULSEFREQUENCY will retum a zero while the other two functions will saturate at a certain maximum value for Nano 10 FMD senes and F senes PLCs it is equivalent to about 3 28 seconds The SETSYSTIEM 20 command can be used to switch the resolution between lus default and 0O 1us A PULSEWIDTH 1 PMON PMOFF 12 41 READMODBUS ch ID addr Purpose Parameters ch ID addr Example Comments eD TRIANGLE URA RESEARCH L SC INTERNATIONAL Use the MO DBUS ASCII or RTU protocol to automatically query a MODBUS ASCII or RTU slave device and obtain the desired 16 bit register data The Communicati
311. the label for intemal relay 5 Tlsec isa timer with preset value of 10 At the end of the pulse generation RLY5 will be activated Ladder logic senses RLY5 and executes the Tlsec timer to cause a 1 second delay after which custom function 20 is executed which triggers another STEPMOVEABS command and the process repeats for the other four indexing positions A2 2 5Activate Events at Scheduled Date and Time All Super PLCs have built in Real Time Clock which keeps track of Date and Time and can be used to activate events at scheduled time Assignment 1 Every day tum on output 1 label name Out1 at 19 00 2 Tum OFF output 1 at 7 00 P p E A2 10 INTERNATIONAL Appendix 2 3 On 1st an 2000 at 12 00 tum ON output 5 4 Onthe same day at 18 00 tum OFF output 5 Tim3 Os En 1 Pe _ _ _ _ dCusf Tim30s Tim30s TIM Custom Function 1 IF TIME 1 19 AND TIME 2 0 Hour hand at 19 SETIO OUT1 Minute hand at 00 ELSE IF TIME 1 7 AND TIME 2 0 CLRIO OUT1 ENDIF ENDIF IF DATE 1 2000 AND DATE 2 1 Jan yr 2000 IF DATE 3 1 IF TIME 1 12 SETBIT OUTPUT 1 4 ENDIF IF TIME 1 18 CLRBIT OUTPUT 1 4 ENDIF ENDIF ENDIF Comments 1 Tim30s should have a Set Value 300 and it activates Function 1 every 30 seconds It is not necessary to check the clock too often as checking consume CPU execution cycles 2 We used SETIO to contro Output 1 but asa demonstration we use SETBIT to
312. these clock pulse bits are therefore 50 as follow Clk 0 1s 0 1 second Clock Pulse E EZ i 0 05s Life i i a ka kk i The clock pulse bits are often used with counter instructions to create timers Additionally they can be used as timing source for Flasher circuit A reversible countercan also work with a clock pulse bit to create secondary clock pulses of penodsthat are multiples of the basic clock pulse rate 9 2 2 SeqN X These are special Sequencer contacts which are activated only when the step counter of a Sequencer N reaches step X E g a Normally Open contact Seq2 6 is closed only when Sequencer 2 reaches Step 6 At any other step this contact is opened Click this link for detailed explanation and working examples on how to use a Sequencer 9 2 3 Normally ON Flag Norm ON You can make use of this flag if you need to keep something permanently ON regardless of any input conditions This is because with the exception of Interlock Off function ILoff a coil ora special function is not allowed to connect directly to the power line the vertical line on the left end of the ladder diagram If you need to permanently enable a coil consider using the No mally O N bit from the Special Bits menu as follow Light OUT 9 2 4 First Scan Pulse 1st Scan Ca TRIANGLE URA RESEARCH at LAS INTERNATIONAL Chapter9 This special bit will only be tumed ON in the very first scan time of th
313. ting systems Download the Latest Version of I TRiLOGI If this is the first time you are installing I TRILOGI you should locate and open the upgrade htm document in the I TRILOGI CD ROM which provides the web link uuemame and password to login to the TRi website to download the latest version If you already have a curent version of I TRILOGI you can click on the Helo menu on ITRILOGI and select the Upgrade TRILOGI command which will also open up the Upgrade htm document Either case please login to the upgrade website and download the latest version of Setup TL6xx exe Then proceed to Section 1 3 to install the J RE first BEFORE insta lling the I TRILOGI Install Java Run Time Enviroment JRE 1 4 2 19 1 In the root directory on the Intemet TRILOGI 6 x CD ROM you should find a folder x86 Windows which is where all the setup files for PCs running MS Windowsare located i TRILOGI is written in Java and requires a Java Run Time Environment J RE installed on the PC in order to run propery The i TRILOGI 6 xx CD ROM includesa copy of the J RE 1 4 2 19 setup program with the filename Co O Geen ki INTERNATIONAL Chapter1 I TRILOGI Setup Guide j2re 1 A 2 19 windowsi586 p exe Although your PC may already have a later version of J RE in 2012 the latest J RE is version 7 it was discovered the JRE 1 4 2 19 is proven to work best with i TRILOGI software This is especially so if your
314. tisON and a Oif the bit is OFF Examples SETBIT alarm IF TESTBIM alarm THEN ELSE ENDIF Comments This function offers a more efficient way of manipulating the UO bits compared to the SEBIT and CLRBIT function However SETBIT and CLRBIT functions have the advantage that they can use vanables to indicate the index and bit position of the bit to be affected whereas the I O bit that affected by the commands here are fixed during compile time Note that output bit changed in custom function will only be updated at the physical output at the end of the ladder logic scan unless a REFRESH command is being executed See Also SETBIT C LRBIT bei Bass 12 3 INTERNATIONAL Chapter 12 12 8 CONTINUE Purpose Synta x Comments Example See Also To command the CPU to jump to the next iteration of the WHILE ENDWHILE orFOR NEXTloop CONTINUE This new command is available to all Super PLCs since firmware version r30 Upon executing the CONTINUE command the CPU will jump to the next iteration in the WHILE ENDWHILE or FOR NEXT loop FOR I 1 to 10000 X X 1 IF INCOMM 1 lt 0 CONTINUE ENDIF Y Y 2 NEXT f INCOMM 1 retums a 1 as in the second line of the FOR loop the CPU will not execute the Y Y 2 statement but will instead jump to the next iteration which is to increment index by land start executing the statement X X 1 WHILE ENDWHILE FOR NEXT EXIT 12 9 CRC16 var count
315. to the Inputs window by using the left nght cursor keys or by clicking on the red color left right arrow buttons or simply select it from the choice box between the left right arrow buttons 3 Move the deep blue color highlight bar to Input 1 postion by clicking on it Click again to open up a text field for entering the name for Input 1 Ti Bae 6 2 INTERNATIONAL Chapter6 4 Press lt Enter gt key again and the highlight bar will be moved to Input 2 5 Without using the mouse button simply start typing the name Stop at Input 2 The text field will be automatically opened up at Input 2 for entry Press lt Enter gt after typing in the name for Stop input 6 Complete entry of the other two input label names Manual and Step as above Note that i TRILOGI Version 6 2 and up allows I O label names of up to 16 characters However if you wish to keep compatibility with Version 5 x to 6 1x you should use no more than 10 characters to define the I O names Also white spaces between names are not acceptable and will be automatically converted to the underscore character e g If you enter the name F series PLC foran I O it willbe accepted as F_series P 7 After entering label names for Inputs 1 to 4 move to the Output table by pressing the right cursor key or by clicking on the right arow button Enter all the output and relay label names in their respective I O tables We will discuss the
316. tor Version 4 5 or later or Mozilla Firefox version 1 5 or later Ti Bei 5 2 INTERNATIONAL Chapter5 3 Next check the TLServer front panel for its IP Address If you are running TLServer on a PC without network connection it will probably show IP Address 127 0 0 1 9080 If you have an Intemet connection before you start up TLServer then you will see the Intemet IP address of your PC If your PC has both a local area network connection as well as a direct Intemet connection you will see two IP addresses being reported Although localhost address 127 0 0 1 may not be reported but it is always there as long as both the Client and the Server reside on the same computer Always use the localhost IP address 127 0 0 1 if both the Client and the TLServer are running on the same computer 4 Now simply key in the IP Address including the port number in your browsers Address for IE5 or URL for Netscape text entry area For localhost connection enter http 127 0 0 1 9080 i TRiILOGI Version 6 Copyright c 2001 2009 Triangle Research Intemational Inc Menu Item Description Run the j TRiLOGI directly off your browser No Local Installation Run Ladder Editor a Required You need your Username and Password defined in TLServer View On Line Helps to gain access to your PLCs Current Promotional Offer Language English X Goto Option 5 The browser will now issue a HTIP request to th
317. trical current to activate a switch that can conduct high Current The simplest form of thistype of contactisa relay In traditional electromagnetic relay a coil of wire is wound around an iron core which tums it into an electromagnet When current passes through the coil the magnet is energized and the force is used to either close a contact that makes ita normally open contact closed only when energized or open it that willbe a normally closed contact since it isclosed when not energized Ladder Logic programming language bormows some of those terms used to describe the electromagnetic relay for its own use You connect a relay coil to the right end of the ladder diagram just like an output as follows Start Stop Active i i RLY Active Active Lamp e o In a PLC there are hundreds of intemal relays which are supposed to behave like the typical electromagnetic relay Unlike an output e g the Lamp output ema D TRIANGLE 7 URA RESEARCH SS LAY INTERNATIONAL Chapter9 which hasa physical connection out of the PLC when an intemal relay is tumed ON it is said to be energized but you will not see any changes in the PLC s physical l Os The logic state is kept intemally in the PLC The contact of the relay can then be used in the ladder diagram for tuming ON or OFF of other relays or outputs A relay contact in the ladder diagram can be Nomnally Open or Nomally Closed and there is no limit to the number of
318. trol point so that negative values from PiIDcompute means D A output will be lt 2048 positive values means D A output willbe gt 2048 9 DA r TRIANGLE RESEARCH A2 15 INTERNATIONAL Appendix 3 Appendix 3 A 3 Troubleshooting Serial Communication M CA v TRIANGLE DA RESEARCH INTERNATIONAL Appendix 3 A 3 Troubleshooting Serial Communication If you are unable to communicate with the PLC from TRILOGI first check the following 1 TLServer is Running This is required for seral communication to work Refer to chapter 1 5 Run TRILOGI and TLServer for instructions on starting TLServer 2 The PLC is powered on and propery connected to the PC Refer to Al Part 1 Serial Communication Setup Guide for serial port connection info Refer to your PLCs installation guide chapter 1 of the respective user manual for instructions on powering the PLC 3 The Conect COM port is selected in TlServer Refer to section 4 TLSERVER COMMUNICATION SETUP in the Al 1 Part 1 Serial Communication Setup Guide for instructions on selecting the corect com port 4 The USB to serial converter is propery installed If the adapter is not listed in your PCs device manager as shown in the TLSERVER COMMUNICATION SETUP section referenced above then the adapter driver may still need to be installed Refer to the CD installation instructions provided with the USB adapter Once installed make sure to restart TLServer if it
319. ts Following digital electronics convention bit O refers to the least significant bit nghtmost bit and bit 15 the most significant bit leftmost bit of the 16 bit integer variable Please refer to page 10 4 in Chapter 10 TBASIC Statements Functions Operators and Varables for the mapping between I O bits and the variables Examples TESTBIT Input 2 3 Tri Boss 12 66 INTERNATIONAL Chapter 12 To test whether input 20 isON Input channel 2 bit 3 Input 17 3 20 See Also SETBIT C LRBIT 12 79 TESTIO labelname Note Please refer to the definition of CLRIO command 12 80 TOGGLEIO labelname Note Please referto the definition of CLRIO command 12 81 VAL x Purpose To retum a value of a decimal number contained in the argument x Examples B VAL 123 100 Comments B should contain the value 12300 12 82 WHILE expression ENDWHILE Purpose To execute a series of statementsin a loop aslong asa given condition is true Synta x WHILE expression ENDWHILE Comments When a WHILE statement is encountered the expression will be evaluated and if the result is true the statements following the expression will be executed until the ENDWHILE statement Thereafter execution branches back to the WHILE statement and the expression is evaluated again The loop statements Tri Boss 12 67 INTERNATIONAL Wa ming Examples Chapter 12 will be executed repeatedly until th
320. tum Time as Integer Retum current Real Time Clock value asa 6 digit integer from 000000 to 235959 Must be retumed to a 32 bit vanable Example At 00 12 05 gt A STATUS 18 retums 001205 to A At 12 00 05 gt A STATUS 18 retums 120005 to A Note Only for PLCs with finmware r72 and above Retum File Length Retum the file length of the currently opened file Example The currently open is 50kb gt A STATUS 19 retums 50000 to A See the Extended File System chapter in the PLC user manual for more information Note only for PLCs with firmware r77 orabove FIP transfer status v gt 0 Number of bytes uploaded to FIP Server Transfer is in progress 12 59 Chapter 12 v lt O_ Total number of bytes uploaded Transfer completed Example If 2 345 bytes have been uploaded to the serverand the transferhasended gt A STATUS 20 retums 2345 to A See the Extended File System chapter in the PLC user manual for more information Note only for PLCs with fimware r77 orabove Retum CPU Counter Value Can be used to measure execution time This function retums the 32 bit value of a 10M Hz free running counterin the CPU The difference between the values from two STIATUS 21 gives the elapse time of a processin 0 1us E g A STA TUS 21 CALL somefunction B SIATUS 21 A B isthe execution time of somefunction in 0 1 microseconds i e if B 10000 gt 1 ms Note only for PLCs with f
321. u can move it around copy it to another destination or delete it entirely using commandsin the Circ uit menu Note Since TL6 is Unicode aware you can now enter comments text in any intemational language and as long as the file is saved with a PC6 the comments will be propery saved into the data file and will be propery reloaded when the file isnext open 8 5 2 Insert Circuits This command enables you to insert a new circuit just before the curently selected circuit The current circuit number will be increased by one while the new circuit will assume the curent circuit number You will be placed in the circuit editing mode for immediate circuit creation 8 5 3 Move Circuit You can rearange the order of the circuits by using this command Select the circuit you wish to move and execute the Move Circuit command then bei Bass 8 43 INTERNATIONAL Chapter8 select a destination circuit location and press lt Enter gt The selected circuit will be moved to the new location before the destination circ uit Note that if you wish to move a block of circuits to a new location you may find it more productive to use the Cut Circuit and Paste Circuit commands in the Edit menu 8 5 4 Append Circuit Execute thisto add a new circuit to the ladder logic program This new addition willbe positioned immediately after the last circuit in the entire program 8 5 5 Delete Circuit This command allows you to delete the on
322. ual Seq ri jt i3 cl Avseg Clk 0 5s Manual 3 E Iden Ej The main body of the program window is for displaying and editing your ladder logic program A ladder logic program is made up of many ladder rungs In TRILOGI we call each ladder rung a circuit with an associated circuit number The curently selected circuit is marked by a little red triangle pointed to the circuit s intersection with the left vertical line a k a the power rail in ladderlogic terminology The circuit number of the selected circuit is displayed on a button located just above the top left comer of the ladder editor window If you happen to click on this button a dialog box will popup that prompts you to enter the circuit number you wish to go to and the editor will bring you there immediately The five blue buttons fi 2 3f4 5 next to the Circuit button are called Bookmarks and their usage has been covered in details in Chapter 6 8 1 File Menu The File menu providescommands forthe opening saving of i TRILOGI files either on the local harddisk or on the TLServers storage space ED TRIANGLE _ D V RESEARCH eh INTERNATIONAL Chapter8 8 1 1 New lt Ctrl N gt Activate thiscommand when you want to create a new ladder logic program All current ladder circuits and custom functions will be cleared from the screen and the default filename is Untitled pc 6 8 1 2 Save lt Ctrl S gt This command saves the
323. v Heip Retrieve Parameters from PLC Reboot PLC after Save Close 1 IP Address IP Address 192 168 1 5 One of the most important parameters that you must define here is the IP Address field as shown above By default every F series PLC is shipped with the static IP address 192 168 1 5 You will need to assign the PLC s with an IP address that is unique on your network and yet is accessible from your PC If you are on a company network then you must consult your company s system administrator to assign you a useable IP address However if your PC is connected to a small local area network then most likely you will have a LAN IP address of 192 168 XXX YYY For proper networking you TRI RESEARCH 8 24 INTERNATIONAL Chapter8 should set the PLC s IP address to 192 168 XXX ZZZ i e The first three numbers should match each other The fourth number ZZZ should be an IP address that isnot used by any otherdeviceson your network Note that majonty of small LANs are built using a network router that assigns dynamic IP addresses called DHCP server to the PC You should enter the administrator page of the router and define the range of DHCP for use by the PCs and then you may assign the PLC with any IP address that is outside of the DHCP range E g If you define the DHCP address range to be 192 168 1 100 to 192 168 1 150 then you may assign the PLC with any IP address between 192 168
324. values to the PLC 8 3 9 EEPROM Manager This command allows you to read write the EEPROM data content from and to a Nano 10 FMD seres or F series PLC as well as the legacy M senes PLC with TRI RESEARCH 8 17 INTERNATIONAL Chapter8 firmware r47 and above Note that the data memory type may not actually be EEPROM could be Ferno Magnetic RAM FRAM or FLASH but the EEPROM manager will work the same way The EEPROM manager also allows you to save or load the data to and from the PC s hard disk When the EEPROM Manager is selected you will see the following screen PLC Data EEPROM Manager DER Get INTEGER EEP data from PLC Get STRING EEPdata from PLC TT Write EEP Buffers to PLC Integer EEP Buffer String EEP Buffer 1 ABC Machine Tool 2 Temperature 3 Start and Stop Buttons 4 Color of the Wall 5 Alarm is activated 6 FF FF FF FF FFAFF FFIFFAFF FF FFFFIFFIFP 7 FF FFAFF FF FFAFFAFF FFAFFAFF FFAFFIFFIFP Load from File into Buffer Save Buffer to File Help There are two buffer areas The left dark blue text area isa buffer to hold 16 bit Integer EEPROM data the right text area isto hold the String EEPROM data You can manually enter data in the buffer areas that are to be written to the data EEPROM orif you retrieve data EEPROM integer or sring from the PLC the data TR RESEARCH 8 18 INTERNATIONAL Chapter8 will be captured into these two buffer areas The d
325. ve orappend data to hard disk files send email to anyone via the Intemet or even synchronize its real time clock with the host PC A number of examples have been included in the C A TRILO G N TL6 us samples FileService Modem folder when you installed TRILOGI version 6 x All these examples make use of a powerful yet easy to use custom function that was written entirely using the standard TBASIC commands see source code listing in the text box below You only need to create the following simple ladder circuit to use this function assuming it is function 10 D ATDF 802 store the phone number IF TESTO Connected THEN already connected IF TESNO DialModem 0 connection no longer needed IF DM 3991 0 used as timer for modem attention PRINT 1 clear serial out buffer WHILE INCOMM 1 lt 1 clear whatever data in senal in buffer ENDVWHILE ELSE IF DM 3991 5 PRINT 1 getmodem attention ELSE IF DM 3991 gt 10 Wait 5 second to gain attention PRINT 1 ATH hang up modem command CLRIO CONNECTED DM 3991 0 ENDIF ENDIF ENDIF TR RESEARCH S INTERNATIONAL Appendix A DMLZOOLEOMIZOOLLL increment the timer ENDIF RETURN ENDIF IF TESNO dialModem 0 RETURN ENDIF If DM 3990 gt 0 it means a dialing action has started If DM 3990 gt 30 it means more than 30 seconds has passed and connection s ll not established then rety IF DM 3990 0 Use this DM asa flag WHILE INCOMM 1
326. will send email since email will only be sent when the email request flag is set even if you had set a very short email service penod It only affects how quickly the email will be sent whenever a PLC raises its email flag You should set a short service period say every 10 seconds for urgent email such as alarm condition For non urgent email such as houny or daily production report you can set a much longerservicing period to reduce the communication loadson the PLCs 4 4 4 Writing i TRiLOGI Programs that Can Send Emails via TLServer as Email Master In orderto send an email the i TRILOGI program needs to use the string variables A B C to store the headers and D to Z to store the messages not all strings need to be used unused strings are still available for normal program use The special variable emEVENT 1 is used as an email request flag which should be initialized to 1 when the program is not requesting email service When the i TRILOGI program wants to send an email it first stores the sender recipient and subject into the following vanables Sender email address which can be used to identify the source of the email Recipient email address thisone must be accurate Subject of the message First line of Message Second line of email message we The 23rd line of the email message emEvent 1 1 NOTsending any email 0 to 23 number of lines in the email message body which are contained in D to Z
327. x on Line n on built in alphanumeric Liquid Crystal Display LCD or compatible Vacuum Fluorescent Display VFD x may be formed by concatenation of various strings using the operator e g Temp SIR A 3 C HR 223 C Integers must be converted to string using the STR or HEX function to be accepted by this function Special case if n 0 the string x will be sent to the LCD s Instruction Register which allows hardware specific LCD 12 4 Example 12 61 Purpose Example gp ZE URA S Chapter 12 configuration such as clear screen set cursor ON OFF etc please referto LCD s manual for details The parameter offset 1 to 40 allows you to send the string x beginning from the offsetth position Only the characters position to be occupied by x will be written to the display other characters of the display remain unaffected The PLC may support LCD display modules capable of displaying up to 4 lines x 40 characters per line of alphanumeric characters If the display has fewer lines or fewer characters per line the unavailable lines or characters will be ignored by the PLC Once set the LCD display will latch the set value until the next SETLCD statement on the same line and same offset is executed On the TRILOGI simulator the result of the SETLCD is displayed together with the Special Vanables view screen SETLC D 1 1 This isa 1x20 LCD Display SETPASSWORD stri
328. x enor tracking system When a syntax enor is encountered the compilation will be aborted immediately and the CusFn which contains the eror is automatically opened in the text editor The location of the offending word is also highlighted and a pop up message window reports to you the cause of the eror You can then immediately fix the emor and re compile until all the emors have been corrected Ei We 10 26 INTERNATIONAL Chapter 10 namesare allowed See Chapter 3 Compiler intemal eror Serious trouble please email to the ee manufacturer support tn plc com to inform us integer constant range of values forthe command same CusFn GOTO statement is supposed to go Invalid GOTO label must be in the range 0 255 Type mismatch In an expression strings and integers may not numernc and string types may be mixed unless converted using the not mix conversion function e g SIR VAL etc labels within the same CusFn a likely wrong spelling for TBASIC statement or function WHILE without ENDWHILE Every WHILE statement must be ended with a matching ENDWHILE statement Nested WHILE loop must have proper matching ENDWHILE foreach WHILE IF without ENDIF Every IF statement must be ended with a matching ENDIF statement to define the boundaries for the block controlled by the IF statement For multiple IF THEN statement each IF must be matched by a coresponding ENDIF FOR without NEXT Every FOR statement must be en
329. y would select COM6 from the Port Name field for the Silicon Labs USB adapter RS485 r RESEARCH INTERNATIONAL TRI TRIANGLE Al 3 Appendix 1 re el gt Control Panel Hardware Devices and Printers 4 Unspecified 2 3 8 Prolific Silicon Labs USB to Serial CP210x USB to Comm Port UART Bridge COM6 COM3 5 TESTCOMMUNIC ATION FROM TLSERVER In the same Seral Port Setup screen type the following command in the Command String field to read the PLCsID default ID is 01 Command String IR Response String IROI If you get the message Waming No Response From PLC then communication is not setup propery First repeat the steps from PLC connection to TLServer Tri Be Al d INTERNATIONAL Appendix 1 setup and if there is still no response refer to the Communication Troubleshooting Appendix at the end of this document 6 STARTTRILOGI Start TRILOGI by selecting i TRILOGI Version 6 4 from i TRILOGI 6 in your PCs start menu below left screenshot Once opened you will see the TRILOGI programming environment window below right screenshot Start Menu 5 45 Us File Edit Controller Simulate Circuit Help Ji i TRILOGI 6 cruit PAAA eine Bookmark wei i TRILOGI Helps aal i TRILOGI Version 6 4 D LocalHost Applet htm ra TLServer Version 3 1 gf Uninstall i TRILOGI 6 45 build 01 v Press F1 for context sensitive Helps d et 7
330. y if you have no intention to perfom other controller commands You may find that you seldom need to use this command since running the On Line Monitoring or Program Transfer commands will also let you log in to the TLServer if you have not yet done so However once you are connected this command changes into Disconnect from Server and this is the only way for you to log out of the curently connected TLServer so that you can use the Usemame Password dialog box to log in as a different user or to log in to another TLServer of a different IP Address port number 8 3 3 On Line Monitoring lt Ctrl M gt Referto the On Line Monitoring section for details 8 3 4 Program Transfer to PLC lt Ctrl T gt This Command is only available if your log in usemame is assigned the access level of a Programmer If you log in as a User or Visitor this command is disabled from the Controllers menu It will be enabled again after you disconnect from the server You can use this command to transfer your i TRILOGI ladder TBASIC program into the PLC You will be prompted to confirm your action to prevent accidentally affecting the target PLC The ladder program must be compiled suc cessfully before the program transfer processcan take place The progress of the transfer process will be cleanly shown on the program transfer dialog box NOTE When doing a program transfer it is now possible to abort a transfer even after the transfer has started However
331. you ll send a 4 gt tag to end the connection gracefully Note similar to local RS485 communication the source PLC that talks across the network using the lt CONNECT service should have a different ID 00 to FF from the target PLC that it is trying to talk to E g A PLC with ID 01 should not talk to another PLC with ID 01 even though the other PLC is connected to a remote server By changing the ID of one of them you will avoid the problem of a response string from the other PLC being misinterpreted by the sending PLC as an incoming host link command Examples of using the lt CONNECT gt tags with TLServer can be found in the TestEthemet PC 6 sample program in the following folder CA TRILOGN TL6 us samples TLServer Note Your version of TRILOGI may have the previous folder address as shown below but the PLC program isthe same CA TRILOGN TL6 usA samples XServer bei Bass 4 25 INTERNATIONAL Chapter5 Chapter 5 Running The Internet TRILOGI Client CA TRIANGLE URA RESEARCH UNG INTERNATIONAL 5 5 1 Chapter5 RUNNING THE INTERNET TRILOGI CLIENT Starting The i TRiLOGI Application Basically there are 3 methodsin which you can start the i TRILOGI application as follow 1 2 E If the i TRiLOGI and J RE has been propery installed on your PC you can just click on the Start button and select i TRILOGI 6 x in the i TRILOGI 6 as follow J i TRILOGI6 e i TRILOGI Help
Download Pdf Manuals
Related Search
Related Contents
Matrox EPI-TC2P32LPAF graphics card Balljoint Installation Instructions Jeep Benutzerhandbuch SRP5004/86 Phonix Crystal Case C:\CLEMSA\Manuales Técnicos\ELECTRÓNICA\CUADROS DE KD-AV7001 - Aerne Menu Mode d'emploi プログラマブルコントロ一ラを" - JEMA 一般社団法人 日本電機工業会 operation manual Copyright © All rights reserved.
Failed to retrieve file