Home

User`s Manual Template - Electrathon of Tampa Bay

image

Contents

1. 2 19 2 6 Web Service Accessing PLC s data from MS Excel rin 2 20 2 7 Accessing The PLC from Internet ranrnnnnvnnnnnvnnnnvvnnnnvnnnnnnnnnnnnnnnvennnnnnnnnnnnnnnvennnnnnnnnnnnnnennnnnn 2 22 2 7 1 Small Local Area Network Using Consumer Grade Network Router 2 22 2 7 2 Large Corporate Local Area Network 2 23 2 8 Setting up Ethernet Communication Directly Between a PC and Nano 10 PLC 2 24 2 9 Installing a Web Page or Web Applet into the Nano 10 PLC using FileZilla 2 28 2 9 1 Installing the FileZilla program u ii 2 28 2 9 2 Configuring FileZilla to Communicate with the Nan0 10 i 2 28 2 9 3 Transferring and Retrieving Files from the Nano 10 Server i 2 30 2 9 4 Download the Web Page FilesS 2 31 2 10 Accessing and Customizing the HTML Web Interface for Control and Monitoring 2 32 2 10 1 Accessing the HTML Files from a Standard Browser 2 32 2 10 2 Control and Monitoring Components in the Default HTML Files 2 33 2 10 3 Customizing the HTML FileS i 2 34 2 10 4 Level 2 User Mocdhtcatons iii 2 38 3 DIGITAL UO AND INTERNAL RELAYS PROGRAMMING 3 1 3 1 Introduction lalla lana iii 3 1 3 2 Programming DIO with Ladder Logic revrnnnvnnnnnvnnnnnnnnnvnnnnnnvnnnnnnnnnvnnnnnnnnnnnnnnnnnnnnnvennnnnnnnnnnnnnn 3 1 3 21 For Physical
2. ii 5 3 3 Using Thermocouple AA 5 3 4 Using PT100 Temperature Sensor i 5 4 Calibration of ADC amp Moving Average Definition 5 41 ADG Galibi asian a a II nie 54 2 sADG Zero Offset ua lia ine la dha ali a area 5 4 3 A D MOVING AVG iets cn iaia se iaia prata aaa 6 SPECIAL DIGITAL I OS 7 HIGH SPEED COUNTERS 7 1 Introduction me erruesvenrnnnnvvvnnnnnnvvnnnnnnvvnnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnr 7 2 Enhanced Quadrature Decoding rrssvrnnnvnnnnvvnnnnvnnnnnnnnnnnnnnnnvennnnnnnnnnnnnnennr 7 3 Configuring HSC as x1 x2 or x4 Counters rrnnnavnnnnvnnnnvnnnnnvnnnnnnnnnnnnnnner 7 4 Interfacing to 5V type Quadrature Encoder 8 FREQUENCY SPEED MEASUREMENT 8 1 Programming of PM Input rrssvernnnnnvvnnnnnnvnnnnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnneenr 8 2 Applications nainuihailelunaineju hele aeh Eae ATEAK aaeain 8 2 1 Measuring RPM Of A Motor 8 2 2 Measuring Transducer with VCO Outputs i 8 2 3 Measuring Transducer with PWM Outputs 8 3 Frequency Measurement on High Speed Counter Inputs User s Manual USER S MANUAL USER S MANUAL 9 INTERRUPTS 9 1 9 1 Input Interrupts rssvennnnnnvennnnnnvnnnnnnnvnnnnnnnnennnnnnnnnnnnnnnnnnnnnnnnennnnnnnennnnnnnennnnnnnennnnnnnennnnnnnnennnnnenn 9 1 9 2 Periodic Timer Interrupt PTl rrnnnnnnnnnnnnnnnvennnnnnnnnnnnn
3. 2 6 2 1 11 Use Username Password eso 2 6 2 1 12 ACCESS LEVEN EE 2 6 2 1 13 Advanced Configuration i 2 6 2 1 14 Standalone Version of Ethernet Configuration Software 2 6 2 2 On line Monitoring Programming via FServer mrs rnnnnvnnnnnvnnnnvnnnnvnnnnnvnnnnnnnnnnvnnnnnnnnnnnnnnnvennn 2 8 2 3 Using Fserver Network Services CommandS vrnnnvnnnnnvnnnnnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnr 2 9 23 GetOurLocalIP Address uaar Rai re 2 10 2 3 2 DNS command Resolving Domain Name into IP Address i 2 10 En RE EE 2 11 2 3 4 Open Connection to Remote FServer or TLServer to Use NETCMD 2 12 2 3 5 Remote File Services 2 13 2 3 6 Other Network Services Tags seseseseeeeersserssitsstrsstessrenssttsstnsstessrensrensrnnnrnnsrnensrensnnne 2 13 User s Manual Page iv USER S MANUAL 2 4 MODBUS TCP Server and Client ConnectiOn rrssrrnxsvnnnnvnnnnnvnnnnnnnnnnnnnnnvnnnnnnnnnnnnnnnnnnnnnenn 2 14 2 4 1 Connecting To The PLC s MODBUS TCP Server ii 2 14 2 4 1 1 Bit Address Mapping ii 2 14 2 4 1 2 Word Address Mapping socios dioui iieii i iei ii a i e a 2 16 2 4 2 MODBUS TCP Access Security i 2 16 2 4 3 Making A Modbus TCP Client Connection to Other Modbus TCP Server 2 17 2 5 Getting data from Internet Connecting to The Internet Time Server
4. OUTPUTS 1N4001 Figure 11 4 Non isolated Interace to RC Servo As shown in the above figure we use a 1K ohm resistor to pull up the Control input to the RC Servo s power supply so that when the PLC s output is OFF the Control input is 6V and when the PLC output is ON the Control input is pulled to low The 1N4001 diode is to prevent the 24V weak pullup signal at the PLC output from entering the servo s Control input As such when the PLC output is ON the Control input is pulled down to about 1 diode drop about 0 7V In other words the RC Servo connected above are controlled by the PLC s PWM output but the duty cycle is inverted l e To send a 5 positive PWM control pulse to the Servo you can run the following statement SETPWM 2 9500 50 Set PWM 2 output to 95 duty cycle at 50 Hz Likewise to send a 10 positive PWM control pulse to the Servo you will need to run the following statement SETPWM 2 9000 50 Set PWM 2 output to 90 duty cycle at 50 Hz User s Manual Page 11 4 Chapter 11 Pulse Width Modulated Outputs 11 4 2 Using Nano 10 PWM Output To Control RC Servo Opto Isolated You can also use the PLC s PWM output to drive an optocoupler such as 4N35 and the output from the optocoupler is use to provide control pulse to the RC Servo as shown in Figure 11 5 4N35 24V DC 4 8V to 6V RS Optoisolator 6V DCPower For PLC For Servo OUTPUTS
5. Maximum allowable word count per command is 32 01 to 20 Hex If count is gt 32 only the first 32 words will be returned E g To read the 10 words of EEPROM data starting from address 100 send host link command RXI00640A The response string will contain 10 sets of 16 bit data 4 ASCII hex digit per set 16 35 Read EEPROM String Data r47 Firmware Only Command Format FPF __ s EEPROM String starting Address Hex User s Manual Page 16 14 Chapter 16 Host Link Command Response Format Response Format Rfxfsfafafaf fafafa D E g To read the string data stored at EEPROM address 10 send host link command Rx 000A The response string will contain string data stored in the EEPROM maximum 40 characters 16 36 Write Analog Output Upon receiving this command the PLC updates the value of its DAC data at the analog output channel i e no need for PLC to execute SETDAC to update the analog output Command Format w afn nlfele 16 16 16 16 Iesel _ Starting Analog channel DAC output data DAC output data channel 01 02h count for 1 channel for subsequent ch Hex Response Format channel count Hex 16 37 Write EEPROM Integer Data Command Format _ Starting EEPROM count Hex data for starting Address 0001 xxxx 01 10h EEPROM address 16 16 16 16 16 167 OD data for subsequent EEPROM address
6. The Nano 10 s RS485 port is also the only means to communicate with the Nano 10 CPU if your Ethernet configuration settings are corrupted and it cannot be connected to your network router 1 2 Physical Mounting amp Wiring The Nano 10 can be easily installed in many kinds of plastic or metal enclosures You need to use 4 PCB standoffs or screws and nuts to support the controller and fasten it to a console box The following subsections show some hardware details of the I Os that are available on the Nano 10 PLC model Separate chapters in this manual will be devoted to discussing the programming methods for this hardware 1 2 1 Digital Inputs Analog Input and RS485 Communication Ports The two wire RS485 port 4 digital inputs and 2 analog inputs as well as a 5V analog reference voltage are all available on a bank of screw terminal blocks along the lower edge of the PLC RS485 INL IN2 IN3 IN4 AN1 AN2 5V SISTS SISTS sISIS Two Wire 4 Digital Inputs 2Analog 5V Analog RS485 Port 24V NPN Inputs 0 5V Reference Figure 1 2 User s Manual Page 1 2 Chapter 1 Installation Guide Please refer to Section 1 4 regarding the specifications of the Digital Inputs The specifications and programming methods for the analog inputs are detailed in Chapter 5 of this manual Chapter 14 describes the use of the RS485 serial communication port Note that the screw terminal block is actually detachable from its soldered pins
7. 14 3 Changing Baud Rate and Communication Formats Use of the SETBAUD Statement The Nano 10 PLC s COMM port is highly configurable It can be set to a wide range of baud rates You can also program it to communicate in either 7 or 8 data bits 1 or 2 stop bits odd even or no parity The baud rate and communication formats of the serial port are set by the following command SETBAUD ch baud_no ch represents the COMM port number 1 only The baud no parameter takes a value from 0 255 amp HO to amp HFF which allows for additional configuration of the communication format The upper 4 bits of baud_no specify the communication format number of data bits number of stop bits and parity and the lower 4 bits represent the baud rate Hence the baud_no for 8 data bit 1 stop bit and no parity is the same as the old models providing compatibility across the PLC families Once the new baud rate has been set it will not be changed until execution of another SETBAUD statement The baud rate is not affected by a software RESET but the settings will be lost when the power is turned OFF The available baud rates and their corresponding baud rate numbers for COMM1 2 and 3 are shown below User s Manual Page 14 2 Chapter 14 Serial Communications Format baudno Format baudno 0000 xxxx 0001 xxxx 0100 xxxx 0101 xxxx Where xxxx represents the baud rate of the comm port as follow I xxxx 0000 0001 0010 0011 010
8. i 16 11 16 26 Write Variable Integers A tO Z rr 16 11 16 27 Write Variable Strings A to Z ii 16 11 16 28 Write Variable Data Memory DM 1 to DM 4000 nn 16 12 16 29 Write Variable System Variables rrrrnnnnvnnnnvrnnnvrnnnnnvnnnnnnnnnvvnnnnvnnnnnnnnnnnnnnnvennnnnnnnnnnnnnn 16 12 16 30 Write Variable High Speed Counter HSCPV iii 16 13 16 31 Halting the E e 16 13 16 32 Resume PLG Operation siirsi aean denna nine 16 13 16 33 Read Analog IMput cecsecccceeeeeceeeeeeeseeeeneeseeeenneeseeeeneeseeesneeseeeseeesesesneeseseseneseeesneeseeeenees 16 13 16 34 Read EEPROM Integer Data rrnnnnnnnnvnnnnnvnnnnvnnnnvnnnnnnnnnnnnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnner 16 14 16 35 Read EEPROM String Data r47 Firmware Only iii 16 14 16 36 Write Analog Quiput i ee alii ani ici 16 15 User s Manual Page ix 16 37 16 38 16 39 16 40 16 40 1 16 40 2 16 40 3 16 40 4 16 41 16 42 16 43 16 44 USER S MANUAL Write EEPROM Integer Data sernnnnnnnnnvnnnnnvnnnnnnnnnnvnnnnnnnnnnnnnnnvnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 16 15 WRITE EEPROM String Data ereasnvnnnnvnnnnnvnnnnnnnnnvnnnnnnnnnnnnnnnnvnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnennn 16 16 Force Set Clear Single I O Bit rrrnnvnnnnnnvnnnnvnnnnvnnnnnvnnnnnnnnnnvnnnnnnnnnnnnnnnnnnnnnvnnnnnnnnnnnnnnnner 16 16 Using OMRON Host
9. Each ladder logic element contacts or coils takes up 1 word of memory A TBASIC statement or function takes up half a word to four or five words depending on the number of parameters the statement or function has The program memory can be erased and reprogrammed more than one hundred thousand times which is a limit that you are unlikely to ever reach However unlike on the T100M PLCs the program memory User s Manual Page 1 7 Chapter 1 Installation Guide of the Nano 10 is not stored in an easily removable IC so it is not possible to upgrade your customer s PLC program by swapping out a single IC such as the M2017P or M2018P on a T100M PLC 1 6 2 Non Volatile Data Storage Users of the M Series PLCs T100MD and T100MX PLCs may be familiar with the PLCs EEPROM memory as well as some of its limitations Standard Nano 10 PLC does not have any built in EEPROM on board An optional FRAMRTC module can be added to the Nano 10 to provide up to 11K words of non volatile high speed ferromagnetic memory that behave just like EEPROM to the PLC However if you have only limited use of the EEPROM memory say to store some non volatile parameters once in a while and you do not wish to incur the expense of buying the FRAMRTC module then you will be glad to learn that the Nano 10 CPU cleverly uses its static RAM to shadow a flash memory area in the CPU to provide up to 1024 words of pseudo EEPROM that allows user to read and write
10. The Host should be the IP address of the Logontype eg Nano 10 PLC default IP is shown in the User samples example The Port can be left blank and the Servertype can be left as the default Password as shown Account Cad The Logontype should be set to Normal A and the User and Password should be set NewSte Ven Folder to the same as for the login to the Nano New Bookmark Benane 10 Server in the Ethernet port Delete Copy S S S Nothing else needs to be configured in this area Next go to the Transfer Connect OK Cancel settings tab Figure 2 9 1 User s Manual Page 2 28 Chapter 3 I O and Internal Relays Programming EN Gil Under the Transfer settings tab you Select Entry need to set the Transfer mode to Er General Advanced Charset Active and check the box to Limit Y F series Transfer mode number of simultaneous connections Default Active Passive The maximum number of connections Vi Limit number of simultaneous connections should be 1 Maximum number of connections 1 This is everything that needs to be configured so you can now click on connect l New Site New Folder New Bookmark Rename Delete Copy conet cance Figure 2 9 2 A F series samples 192 168 1 5 FileZilla feka If FileZilla has made a File Edit View Transfer Server Bookmarks Help 5 succes
11. To do so you need to know at least two reference points of how the native unit maps to the PLC s ADC reading User s Manual Page 5 4 Chapter 5 Analog I Os Reference Point ADC Reading x1 al x2 a2 Hence for any reading A ADC 1 the corresponding X is derived from X x1 A a1 2 gt X x2 x1 A a1 a2 a2 x1 x2 x1 a2 al Note that since x1 x2 a1 and a2 are all constants the actual formula is much simpler then it appears above E g Temperature measurement Temp ADC n 30 200 100 3000 So for any ADC readings A the temperature is X 70 A 200 2800 30 Note To get better resolution you can represent 30 degree as 300 and 100 degree as 1000 so if X 123 it means 12 3 degree 5 3 Temperature Measurement Using Analog Inputs 5 3 1 Thermistor Temperature Sensors A thermistor is a kind of resistor whose resistance decreases when its surrounding temperature increases It is a very low cost and stable device that can be used to measure a wide range of ambient temperature from freezers to hot water boilers which are commonly used in HVAC applications In order to convert the resistance changes into voltage readings to be read by the PLC s analog input you can use it to form an arm of a voltage divider circuit which would present a variable voltage to the analog input when the temperature changes A type of thermistor that measures 10 0K ohm at 25 degree C simply called 10K thermistor i
12. To see how the response data changes in response to the actual PLC s input please turn on some of PLC s digital inputs 1 to 8 then right click on the cell where the web query was defined and select te Refresh Data command You should see a new RIXX string appear at the selected cell where XX is the hexadecimal representation of the 8 input bits 1 8 E g if only inputs 2 and 8 are turned ON then the binary pattern is 1000 0010 which in hexadecimal form is 82 and the response string would therefore be RI82 You can then write an excel formula to extract the data 82 and use it for your other computation purpose By using a different Host Link command the Excel spreadsheet can read and write to the PLC s internal data very easily Notes 1 If you have enabled Use Username Password for the FServer you will be prompted by your Excel program to enter the Username and password before you can receive the response data 2 We have provided a more complete Excel spreadsheet example ExcelQuery xls which can be downloaded from hittp www tri plc com appnotes F series ExcelQuery xls The macro in this file converts the RIXX data it receives into ON OFF indicators on the Excel Spreadsheet cells Note that this spreadsheet file uses the HEX2DEC function that is not normally available when you first install the Excel program But you can add it in by installing the Analysis Toolpak Please search your
13. User s Manual Page 2 37 Chapter 3 I O and Internal Relays Programming The ONcolor value is the color that a relay bit button will turn when it has been activated The OFFcolor value is the color that a relay bit button will turn when it is deactivated Changing the Data Memory Labels and Fields Color Only the background color for the Data Memory labels can be changed in the user level 1 user modification area but not the Data Memory field where the actual data is shown background color or the Data Memory label field text color Data Memory Label Background Color DMlabelBgColor efffff The Data Memory label text color is defined by lt style gt body at the top of the 0 HTM file The Data Memory field text and background colors can be changed in the level 2 user modification area 2 10 4 Level 2 User Modifications The level 1 user modification area allowed you to quickly and easily customize the layout of the interactive objects as well as their main color size and name properties However the level 2 user modification area allows you to go further and customize some style details such as font text size more colors and other layout style properties We recommend that only expert HTML programmers make any changes to this area but even users with basic HTML knowledge should be able to make some changes by trial and error However we do not provide support for making changes to this area and we advise that ba
14. View Variables integer screen 5 2 4 Moving Average The Nano 10 PLC offers a built in Moving Average computation routine for each ADC channel When moving average is enabled the PLC firmware would store the past analog readings for each channel in its own historical memory array and each new instantaneous reading would overwrite the oldest reading When you run the ADC n function the PLC firmware would return the average of these past readings instead of the instantaneous new reading You can define a moving average of 1 to 9 points using the procedure described in Section 5 4 5 Defining a larger moving average can better help to even out fluctuations in ADC readings that can be caused by interference from digital noise However the larger the moving average the slower the ADC n function can detect a sudden change in the amplitude of the analog signal due to the averaging effect For a system that needs to quickly detect a signal change consider using either a smaller number of moving average points or call the ADC n function more frequently so that a sudden change can be detected earlier 5 2 5 Scaling of Analog Data The 12 bit analog inputs on the Nano 10 PLC returns data in the range of 0 to 4095 which corresponds to the full range of the voltage input presented at the analog pin However very often a user needs a formula to translate this numeric data into units meaningful to the process e g degree C or F psi etc
15. 1st Scan pulse 2 Thereafter the pulse width in us or the pulse frequency in Hz can be easily obtained from the PULSEWIDTH n or PULSEFREQUENCY n functions You can also obtain the pulse period inverse of frequency using the PULSEPERIOD function E g A PULSEWIDTH 1 B PULSEPERIOD 1 C PULSEFREQUNCY 1 3 All PM inputs by default return the measured pulse width and pulse period in unit of microsecond However for those who desire better resolution you can define PM 1 to 4 to return the measured pulse width and pulse period in 0 1 microsecond resolution by executing the following command once only during initialization SETSYSTEM 20 1 Once the above statement is executed if PUSLEWIDTH 1 PULSEWIDTH 4 returns the value 1234 it means the measured pulse width is 123 4 us A sample program can also be found on your i TRILOGI installation folder at C TRILOGI TL6 usr samples PulseMeasurement PC6 User s Manual Page 8 1 Chapter 8 Frequency Speed Measurement 8 2 Applications 24V eS ife EE EE ei NPN type Optical Sensor HE Figure 8 1 Setting Up a Simple Tachometer or Encoder Input 3 Nano 10 PLC 8 2 1 Measuring RPM Of A Motor One useful application of the PM capability is to measure the speed of rotation RPM of a motor A simple optical sensor coupled with a rotating disk with slots fitted to the shaft of a motor See Figure 8 1 can be fabricated economically When the motor turns
16. File Edit Controller Simulate Circuit Help Timer Figure 4 2 Completed Timer Circuit 4 2 4 Example 2 Creating a Simple Counter Circuit in Ladder Logic You can place components in the circuit by clicking in the green area to the right of the red arrow as shown in Figure 4 3 below This will bring up the component tool bar in the gray area above the green circuit area KS TRILOGI Version 6 13 Untitled File Edit Controller Simulate Circuit Help Circuit 1 DAAA nine quick Tags Figure 4 3 Creating Ladder Circuit Once the component toolbar is shown you can place your activating contact by selecting the 1 component from the toolbar HE and then selecting the activating input from the I O Table The contact will then be automatically placed in the ladder logic circuit The same can be done for the counter coil by selecting the 7 component from the toolbar 0 and then selecting a counter that has been entered into the I O Table Then a counter contact needs to be added as an input to a ladder logic circuit This contact will activate once the counter counts down This could be used to turn on an output after a certain count is reached Placing a counter contact in a circuit is the same as placing any contact in a ladder circuit except that the corresponding counter should be selected from the Counters section of the I O table After creating a ladder circuit that contains one input and one counter output and
17. r Channel Data 00 to 07 Response Format w fe D User s Manual Page 16 9 Chapter 16 Host Link Command Response Format 16 22 Write Timer Present Value P V Command Format Timer1 00 New timer PV Timer64 3F Hex Response Format Please note that the timer number starts from 00 which represent timer 1 then 01 represents timer 2 and so on 16 23 Write Timer Set Value S V Command Format Timer1 00 New timer SV Timer64 3F Hex Response Format Note the 2nd character is a lower case m instead of the upper case M of WM command 16 24 Write Counter Present Value P V Command Format rr Counter1 00 New PV Counter64 3F Hex Response Format User s Manual Page 16 10 Chapter 16 Host Link Command Response Format 16 25 Write Counter Set Value S V Command Format Counter1 00 New Counter SV Counter64 3F Hex Response Format Note the 2nd character is a lower case u instead of the upper case U of the WU command 16 26 Write Variable Integers A to Z Command Format A B C Z 8 Hexadecimal Digit for 32 bit integer Response Format E g To assign variable K to number 56789 0DD5 g send hostlink command NVIK00000DD5 16 27 Write Variable Strings A to Z Command Format w v s8 aphaet a a a a 0 A B C Z ASCII characters of the string vari
18. rr nn Timer1 00 Timer16 0F Timer64 3F Response Format RR 10 10 10 109 Timer present value in Decimal The present value PV of the specified timer is returned in decimal form as four byte ASCII text characters from 0000 to 9999 16 9 Read Timer Set Value S V Command Format Rn po SE rr nn Timer1 00 Timer16 0F Timer64 3F Response Format ER om ijijiji D Timer Set Value in Decimal The Set Value S V of the specified timer is returned in decimal form as four byte ASCII text characters from 0000 to 9999 Note that this command header contains small letter m instead of M in the RM command 16 10 Read Counter Present Value P V Command Format ER ee ee ae Se nn Counter1 00 Counter16 0F Counter64 3F Response Format R u jijij J Counter present value in Decimal The Present Value of the specified counter is returned in decimal form as four byte ASCII text characters from 0000 to 9999 User s Manual Page 16 5 Chapter 16 Host Link Command Response Format 16 11 Read Counter Set Value S V Command Format R ufn fn DI nn Counter1 00 Counter16 0F Counter64 3F Response Format Rf u 10 10 10 10 O Counter Set Value in Decimal The Set Value of the specified counter is returned in decimal form as four byte ASCII text characters from 0000 to 9999 Note that this header contai
19. symbol E g if ADC 1 returns the value 1234 the final string being displayed will be Rm Temp 012 C 13 2 Special Commands For LCD Display If you use the SETLCD command with line 0 then the strings will be treated as special instructions to be sent to the LCD module to program it for various modes of operation This includes blinking cursor underline cursor or no cursor as well as display shift mode You have to refer to the LCD manufacturer s data sheet for the detailed commands Some of the most useful commands are listed below User s Manual Page 13 1 Chapter 13 LCD Display Programming Acton Command __ Clear screen SETLCD 0 1 CHR 1 No cursor SETLCD 0 1 CHR 12 12 Underline Cursor SETLCD 0 1 CHR 14 13 Blinking Cursor SETLCD 0 1 CHR Underline Blinking SETLCD 0 1 CHR 15 13 3 Displaying Numeric Variable With Multiple Digits The SETLCD y x string command only overwrites the exact number of characters in the string parameter to the LCD display and thereafter the cursor is placed back to the location specified by the x and y parameters Thus if there exists some old characters right after the last character it can cause confusion especially if you are displaying a number E g If you first display the following string at row 1 and column 1 Pressure 12345 And if you subsequently display the string Pressure 983 at the same location without first clea
20. 10 User s Manual Page 4 7 Chapter 5 Analog I Os Chapter 5 Analog Inputs and Outputs User s Manual Chapter 5 Analog I Os 5 ANALOG INPUTS AND OUTPUTS 5 1 Analog Power Supply The analog power of the PLC is derived from the same 24VDC power supply as the CPU It will generate a 5V regulated DC voltage source that will be used internally as voltage reference and is available externally for use by other analog input devices The reference voltage output is available on the analog I O connector terminal block and may be used as the source voltage for connecting to potentiometers Its current is limited to 30mA Thus if you need more current for your analog device you will need to supply your own 5V DC source 5 2 Analog Inputs Each Nano 10 has two channels of built in 0 5V 12 bit Analog inputs The terminal block location for these analog inputs is described in Section 1 2 1 Electrical Characteristics No of A D channel 2 Resolution 12 bit Input Impedance Ch 1 to 2 20 00K Ohms Moving Average 1 to 9 points user definable Conversion Time lt 4 us per channel ADC n value 4095 4094 4093 ot No Input Voltage 5 00 Figure 5 1 Transfer Function for 12 bit ADC The DC input impedance of Analog inputs 1 to 2 are all 20 00K ohms 0 1 This is not a problem when connected to a 0 5V low impedance analog source Use
21. 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 number to not more than 31 Quite a few of the ladder logic special functions are related to the use of the sequencer These are described below 4 4 2 Advance Sequencer AVseq Increment the sequencer s step counter by one until it overflows This function is identical to and hence interchangeable with the UpCtr function 4 4 3 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 is not the same as sequencer at 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 4 4 4 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 steps is a very powerful feature of the sequencers User s Manual Page 4 6 Chapter 4 Timers Counters amp Sequencers 4 4 5 Reversing a Sequencer Although not available as a unique special function a sequencer may be stepped backward by decrementing its step counter usi
22. 3 Programming timers and counters in Custom Function 4 3 1 Programming Timers and Counters Present Values 4 3 2 Accessing Inputs Outputs Relays Timers and Counters Contacts 4 3 3 Changing The Timer and Counter Set Values in a Custom Function 4 3 4 Volatility of Nano 10 Timer amp Counter Set Values 4 3 5 Controlling a Timer or Counter in a Custom Function 4 4 Programming Sequencers on Ladder Logic 4 4 1 Introduction ere 4 4 2 Advance Sequencer AVseq 4 4 3 Resetting Sequencer TDGsegl 4 4 4 Setting Sequencer to Step N StepN 4 4 5 Reversing a Sequencer i 4 4 6 Program Example ii 4 5 Programming Sequencers in Custom Function 5 ANALOG INPUTS AND OUTPUTS 5 1 Analog Power Supply rrrnvnnnnnvnnnnnnnnnvnnnnnvnnnnnnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnner 5 2 Analog Hl cui iii 5 2 1 Interfacing to two wire 4 20MA eensore 5 2 2 Using Potentiometer to Set Parameiers i 5 2 3 Reading Analog Input Data 5 2 4 ene aaa italici alii 52 57 Scaling of Analog Data ei 5 3 Temperature Measurement Using Analog Inputs 5 3 1 Thermistor Temperature Sensors i 5 3 2 Using LM34 Semiconductor Sensor
23. CH23 6 288 281 CH24 6 296 289 CH25 6 304 297 CH26 312 305 CH27 6 320 313 CH28 6 328 321 CH29 6 336 329 CH2Ajs 344 337 CH2Bss 352 345 fe ge NTS fees Pee ETE ia iaia Mr CH3A16 488 481 CH3Die 496 489 CHE 504 497 CH3F 16 User s Manual Page 16 3 Chapter 16 Host Link Command Response Format 16 6 Read Timer Contacts Command Format bia cis Rana 8 bit Channel Hex Response Format RSR SES 8 bit data in Hex 16 6 1 Definition of Timer Contact Channel Numbers A timer contact is a single bit of memory and 8 timer contacts are grouped into one 8 bit channel similar to that of the inputs outputs etc The following table shows the timer numbers defined in TRiLOGI s Timer entry table and their corresponding channel numbers bit7 Timer Contact numbers bito EEE EEE e ENEE EE E E E AE ES I SEI SSC E CH2 CH3 CH4 CH5 CH6 CH7 64 63 62 61 60 59 58 57 16 7 Read Counter Contacts Command Format rR efn n D 8 bit channel Hex Response Format Bee JD 8 bit data in Hex_ 16 7 1 Definition of Counter Contact Channel Numbers The 64 counter contacts are assigned channel s in exactly the same way as the 64 timers Please refer to the last section 16 6 Read Timer Contacts for details User s Manual Page 16 4 Chapter 16 Host Link Command Response Format 16 8 Read Timer Present Value P V Command Format ATM n To
24. DM 1 to DM 1000 and string A to Z EMINT 1 to EMINT 16 and EMLINT 1 to EMLINT 16 are normally stored in the CPU RAM area and User s Manual Page 1 9 Chapter 1 Installation Guide therefore they fall into the category of volatile data memory meaning when you turn off power to the PLC the memory content will be lost and they will be reset to zero when the PLC is powered up again Hence you should use the SAVE_EEP command to save any data that must be preserved after the PLC is powered down Also note that in a standard Nano 10 PLC only the first 1000 DM memory locations are available This means that your program would not be able to access any DM beyond DM 1 to DM 1000 Reading from DM 1001 DM 4000 will always return 0 and writing to these address will be ignored With FRAM RTC With addition of the FRAM RTC module the amount of DM memory is increased to 4000 words making it the same as those on standard T100M or F series PLCs Also since some FRAM memory area is reserved to store these variables it is possible to make variables A to Z A to Z and DM 1 to DM 4000 non volatile by shorting Jump J1 on the Nano 10 circuit board see Section 1 7 This provides for additional non volatile data storage to applications that need them 1 7 Jumpers J1 amp J4 Two jumpers J1 and J4 are provided on the Nano 10 PLC in place of the DIP switches 1 amp 4 that you may already be familiar with on the M and F series PLC
25. Excel Help file for the specific method of adding in this toolpak as it may change from one version of Excel to another On Excel 2000 you can click on the Tools gt Add Ins check the Analysis Tookpak check box and then click OK MS Excel will automatically install the toolpak for you User s Manual Page 2 21 Chapter 3 I O and Internal Relays Programming 2 7 Accessing The PLC from Internet 2 7 1 Small Local Area Network Using Consumer Grade Network Router When you connect an Nano 10 PLC to your home Ethernet router the PLC would have joined a private local area network LAN It is accessible through its private static IP address by other devices on the same LAN as long as each device is on the same subnet See section 2 1 for an explanation of subnet settings The PLC is also able to access the Internet through the router because the router would translate a private TCP IP packet sent from the PLC into a public TCP IP packet out of the Internet and if there is any return data from the Internet meant for the PLC the router would know that and automatically routes the return packet back to the PLC The router performs what is known as Network Address Translation NAT and such routers are called NAT routers However the same FServer and Modbus TCP servers on the PLC are typically inaccessible from the public Internet This is because the router has a built in firewall that does not permit external TCP IP packe
26. Nano 10 PLC s Variables MODBUS Timer 1 to 64 40129 to 40192 Present Values Counter 1 to 64 40257 to 40320 Present Values Clock TIME 1 TIME 2 TIME 3 Date DATE 1 DATE 2 DATE 3 DATE 4 Data Memory DM 1 DM 2 DM 4000 2 4 1 2 Word Address Mapping As shown in Table 2 1 to access the PLC s DM 1 you use MODBUS address space 4 1001 and so on To access the Real Time Clock Hour data TIME 1 use 4 0513 The I O channels can also be read or written as 16 bit words by using the addresses from 4 0001 to 4 0320 Some MODBUS drivers such as National Instruments Lookout software even allow you to manipulate individual bits within a 16 bit word So it is also possible to map individual I O bits to the 4x address space E g Input bit 1 can be mapped to 4 0001 1 and output bit 2 is mapped to 4 0257 2 etc This is how it is shown in Table 2 1 However if you do not need to manipulate the individual bit then you simply use the address 4 0001 to access the system variable INPUT 1 and address 4 0257 to access the system variable OUTPUT 1 Note that INPUT 1 and OUTPUT 1 are TBASIC system variables and they each contain 16 bits that reflect the on off status of the actual physical input and output bits 1 to 16 2 4 2 MODBUS TCP Access Security If a Nano 10 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 sequen
27. OMRON Host Link Commands Since the PLCs also support OMRON C20H Host Link commands which are very similar in construct to our multi point command response format you can also make use of OMRON commands to supplement the native host link commands We will only discuss four of the OMRON host link commands RR WR RD and WD in this section because these commands can be used by users to read write to multiple I O registers and data memory in a single command Note maximum length of command string should be lt 80 characters Note Since the Nano 10 native protocol command set typically only supports read write of single variables and data memory if you want to read write multiple memory locations in a single command you can make use of these OMRON host link commands 16 40 1 Read IR Registers This command refers to Table 14 1 in Chapter 14 to map the PLC s I Os to OMRON IR register space from IRO to IR519 Command Format e fafafrfrfn nfn nfelfelf el e sm par rc Device ID Header IR Address Dec IR count Hex rr FCS Response Format a a R R s s t6 ie 16 16 _ gt Fm amp 6_ 2m 0 Device ID Header Status 1 Data Hex 00 OK 15 Bad 16 l ___ ___s lt Last data FCS E g To read Timer PV 1 to 7 using this command send 01RR012800074D The PLC will send return a response 801RR00xxxxyyyyzzzz User s Man
28. PC6 that uses this command is included in the Nano10Samples zip file that you can download from http www tri plc com trilogi Nano10Samples zip User s Manual Page 7 2 Chapter 7 High Speed Counters 7 4 Interfacing to 5V type Quadrature Encoder If you have a choice you should select an encoder that can produce 12V or 24V output pulses so that they can drive the inputs 1 2 3 4 directly If you have a 5V type of encoder only then you need to add a transistor driver to interface to the PLC s inputs The simplest way is to use an IC driver ULN2003 connected as shown in Figure 7 2 ULN2003A Input 3 i 1 1 1 1 Nano 10 PLC Figure 7 2 Interfacing 5V type Rotary Encoder User s Manual Page 7 3 Chapter 8 Frequency Speed Measurement Chapter 8 Frequency Speed Measurement User s Manual Chapter 8 Frequency Speed Measurement 8 FREQUENCY SPEED MEASUREMENT The Nano 10 PLC provides a very straightforward means to measure the pulse width of the ON cycle the frequency or the period of a rectangular wave pulse train arriving at its Pulse Measurement PM inputs 1 2 3 4 Which are mapped to digital inputs 1 to 4 see Chapter 6 8 1 Programming of PM Input 1 To use the PM input to measure pulse width or frequency execute the PMON statement ONCE to configure the relevant input to become a pulse measurement input You usually put the PMON statement in the init custom function and execute it with a
29. RS485 port to and from the controller The default serial port settings of the Nano 10 PLC for host link communication are 38400 baud 8 data bit 1 stop bit no parity The baud rate and the communication format may be changed using the SetBAUD TBASIC command described in the i TRILOGI Programmer s Reference Nano 10 PLC supports the full set of Host Link command protocol found on F series and M series PLCs Hence if you are already familiar with the F or M series host link protocol the command formats are identical 15 1 Multiple Communication Protocols The Nano 10 PLC just like the F series and T100M PLCs supports many different communication protocols to allow maximum application flexibility In addition to its own native set of communication protocols the Nano 10 PLC also understands and speaks the following protocols a MODBUS ASCII mode compatible communication protocol b MODBUS RTU mode compatible communication protocol c OMRON Host Link Commands for the C20H PLC family Note all trademarks belong to their respective owners The native host link command protocol will be described in detail in this and the next chapter The MODBUS and OMRON compatible protocols have already been discussed in Section 14 7 15 2 Native Mode Communication Protocols When the Nano 10 receives a native host link command via COMM1 it will automatically send a response string corresponding to the command This operation is totall
30. Reference manual and also in the program examples section of this chapter 10 3 2 Setting the Acceleration Properties Before the stepper motor channel can be used to control a stepper motor driver the STEPSPEED command must be executed first in order to define the acceleration settings Once this command has been executed the acceleration settings will not change until another STEPSPEED command is executed with different settings or if the PLC is powered down If the PLC is powered down the STEPSPEED command will need to be executed again before the stepper motor channels can be used However if a software reset executed from online monitoring or within the program the STEPSPEED command does not need to be re executed STEPSPEED ch pps acc The ch parameter should be a 1 Speed pps is based on the no of pulses per second pps output by the pulse generator The pps parameter should be set to a value between 1 and 10000 max rated pps for the Nano 10 PLC The acceleration acc determines the total number of steps taken to reach full speed from a standstill and the number of steps from full speed to a complete stop The stepper motor controller calculates and performs the speed trajectory according to these parameters when the STEPMOVE or STEPMOVEABS commands are executed To set stepper motor channel 1 to a speed of 100 pps in 50 steps the command would be as follows STEPSPEED 1 10
31. STEPMOVEABS 1 500 101 Stepper 1 to move fwd 500 steps from home and turn on relay 101 10 3 5 Demo Program for Stepper Motor Control A demo program for programming the Stepper Motor Controller and Driver StepperMotor PC6 can be found in the Nano10Samples zip file which can be downloaded from http www tri plc com trilogi Nano10Samples zip User s Manual Page 10 5 Chapter 11 Pulse Width Modulated Outputs Chapter 11 Pulse Width Modulated Outputs User s Manual Chapter 11 Pulse Width Modulated Outputs 11 PULSE WIDTH MODULATED OUTPUTS 11 1 Introduction Pulse Width Modulation PWM is a highly efficient and convenient way of controlling output voltage to devices with large time constants such as controlling the speed of a DC motor the power to a heating element or the position of a proportional valve The PWM works by first turning on the output to full voltage for a short while and then shutting it off for another short while and then turning it on again and so on in consistent and accurate time intervals This can be illustrated with the following diagram Load Voltage ici V Ful Average a o a b XV Ful Figure 11 1 The average voltage seen by the load is determined by the duty cycle of the PWM waveform The duty cycle is defined as follow a Duty Cycle 9 y Cy x 100 Period a b Frequency 1 period Hz Average voltage duty cycle multiplied b
32. The absolute position is calculated with respect to the last move from the HOME position The HOME position is set when the STEPHOME command is executed The speed and acceleration profile are determined by the STEP SPEED command as in the original command set This command automatically computes the number of pulses and the 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 STEPCOUNTABS function Once the STEPMOVEABS command is executed re execution of this command or the STEPMOVE command will have no effect until the entire motion is completed or aborted by the STEPSTOP command The STEPMOVEABS command is also used to specify whether the PLC is a motor controller a full step motor driver or a half step motor driver STEPMOVEABS ch position r The ch parameter would specify which stepper motor channel is being used and should be a 1 on Nano 10 The position parameter specifies how many pulses the motor will move relative to its home position User s Manual Page 10 4 Chapter 10 Stepper Motor Control The r parameter specifies which internal relay will be activated once the motor has moved to its new position This relay would be cleared when the STEPMOVEABS command is executed in case it was already activated Example
33. VO EE 3 1 3 2 2 For Internal Relays Non LatchiNg iii 3 1 3 2 3 For Internal Relays Latchmg ieri tieraniaaneyaa E R A An ibi AAEE KAA E KESARIA T AEA Raia 3 1 3 2 4 Programming Examples oresar aa a aa eaat AET Ani AAN ekana ESATIA NAAA 3 2 3 2 4 1 Example 1 Editing Label Names 3 2 3 2 4 2 Example 2 Creating a Simple Ladder Logic CirCU t 3 2 3 2 4 3 Example 3 Creating a Latching Relay CirCUIt i 3 2 3 3 Programming DIO in a Custom Function rmsssvrnnevnnnnvennnnvnnnnnnnnnvnnnnnvnnnnnnnnnnvnnnnnnnnnnnnnnnnnnnnr 3 3 331 Editing Label Names tamilu acii aidia e A 3 3 3 3 2 Controlling I O from Custom Functions urnrvrannvnnnnvvnrnrrvnnnrnnnnnrnnrvrrennnrnnrnnenrerreerrrreennnnsennn 3 3 3 3 3 Example 1 Turn on off an Output 3 4 3 3 4 Example 2 Toggle an Output 3 5 3 3 5 Example 3 Test the Status of an Output 3 5 4 TIMERS COUNTERS AND SEQUENCERS 4 1 4 1 due DL EE 4 1 Adel STIMOEr GOUSL aure tat EE 4 1 4 1 2 COUNT CONS iat tata thiene 4 1 E Ee CEET 4 1 4 2 Programming timers and counters on Ladder LogiC ss urunnnnvnnnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnneer 4 2 421 FOnNTIMEFS iui LARE Li 4 2 4 2 2 For ee CET 4 2 4 2 3 Example 1 Creating a Simple Timer Circuit in Ladder Logic 4 2 4 2 4 Example 2 Creating a Simple Counter Circuit in Ladder LogiC 4 3 User s Manual Page v 4
34. You do not need to distinguish between Modbus ASCII and RTU in this case simply use comm port 4 in your all your commands Multiple Modbus master commands can be sent as long as the connection is live You can test the connection status by checking the result of the STATUS 3 function at any time Once all the command exchanges have been completed you should send a lt gt tag to close the client connection to the remote server so that other NS commands can be executed in other parts of the program Please refer to the fnMBTCP fnRdMBTCP and fnWrtMBTCP custom functions in the demo program TestEthernet PC6 Page 2 18 Chapter 3 I O and Internal Relays Programming 2 5 Getting data from Internet Connecting to The Internet Time Server The Nano 10 PLC features a special NS command tag lt TCPCONNECT xxx xxx xxx xxx portno gt that allows you to connect to any server to download data However since the PLC does not have a lot of memory for storing incoming text data it is not suitable for downloading information from a commercial website that sends many kilobytes of data in a single download It can however be very useful to connect to some servers that send small amounts of information For example there are many Internet Time Servers on the Internet that allow users to synchronize their computer clocks via the Internet The service responds to time requests from any Internet client in several formats includi
35. a frequency matching that of the PWM frequency otherwise the resulting output waveform will be distorted and effective speed control cannot be attained User s Manual Page 11 2 Chapter 11 Pulse Width Modulated Outputs 2 The simple PWM speed control scheme described above is the open loop type and does not regulate the speed with respect to changing load torque Closed loop speed control is attainable if a tachometer either digital or analog is used which feeds back to the CPU the actual speed Based on the error between the set point speed and the actual speed the software can then adjust the PWM duty cycle accordingly to offset speed variation caused by the varying load torque A PID function may also be invoked to provide sophisticated PID type of speed control 3 The Nano 10 PWM can be used to control the speed of small motors only up to the maximum current limit that the PLCs output can safely drive For larger motors industrial grade variable speed drives should be used instead 11 4 Position Control Of RC Servo Motor RC Servo is a class of DC servo motor commonly used in remote control hence the term RC for positioning a device at a desired location It is often termed proportional control because the position where the motor will turn to is directly proportional to the pulse width of the control signal When chosen appropriately RC Servo can provide an extremely inexpensive and versatile solution for positioning a dev
36. and direction signals to an external stepper motor driver in order to control motion of a stepper motor See Chapter 10 for more details User s Manual Page 1 5 Chapter 1 Installation Guide 1 5 2 Digital Output Wiring Diagram 24V DC Power Supply for PLC 24V 0 ov 22 OUT W OUT2 4 O Powert OUT4 ei ACID SL Power OUT4 C ice Figure 1 6 Nano 10 Output Interfacing to Load All digital outputs are directly programmable in Ladder Logic as well as in TBASIC custom functions Some programming examples are detailed in Chapter 3 Digital Os and Internal Relays Note that it is possible to wire the four outputs to become a H bridge relay outputs 3 and 4 as high side switch and MOSFET output 1 and 2 as low side switch which can drive a DC motor in both forward and reverse directions You can even use the PWM outputs to control the speed of the motor and therefore make it possible to use the Nano 10 as an internet accessible bi directional motor speed controller 1 5 3 Inductive Load 24V Inductive bypass diode DC only Diode s reverse break down voltage PLC NPN should be at least Digital Output 2 x load voltage Ol Figure 1 7 When switching inductive loads such as a solenoid or a motor always ensure that a bypass diode is connected to absorb inductive kicks which will occur whenever the output driver is turned OFF Although Out
37. another Modbus TCP Server gt lt CONNECTED gt Successfully connected to the Modbus TCP server of the specified IP address ERR 05 Prev Conn ON Another NS command has been executed and left the client socket opened but did not execute the PRINT 4 lt gt to close the client socket ERR 04 Not Connected Failed to connect to the targeted Modbus TCP Server This TBASIC function returns 1 if the Modbus TCP connection is live and returns 0 if the connection has ended You can test the connection status to determine if the connection is still alive This service allows your PLC to log in to any device that supports a Modbus TCP server and is connected to the same LAN or to the Internet Of course you may also use it to connect to another Nano 10 or F Series PLC on the Internet since every these PLCs all have MODBUS TCP server too Once the connection with the Modbus TCP server is established the CPU will return the response string lt CONNECTED gt to the users program which can read it using the INPUT 4 function The STATUS 3 function can also be used to determine if the connection is successful and alive When the program gets the confirmed connection it can then use any one of the four TBASIC commands READMODBUS WRITEMODBUS READMB2 WRITEMB2 to read or write data to the remote devices via the virtual comm port 4 as if a Modbus slave device has been locally connected to a COMM4 port of this PLC
38. be achieved using a low cost transistor such as a 2N4403 A better way is to use an opto isolator with a logic level output as shown in Figure 10 2 This provides a galvanic isolation between the PLC and the stepper motor driver 5V OV Stepper s supply Logic output OO 24V DC Optoisolator H11L2 Power Supply ene for PLC Quality Technology To 5V CMOS stepper driver input 2K2 resistor SmA max 2 2K Figure 10 2 Conversion of Nano 10 outputs to 5V logic level User s Manual Page 10 2 Chapter 10 Stepper Motor Control 10 3 Programming Stepper Control Channel 10 3 1 Introduction The PLC s stepper motor controller channel 1 is controlled by the PLC program using the STEPMOVE and STEPMOVEABS commands These commands have the same parameters as they did when they were used on M Series PLCs For example STEPMOVE ch count r STEPMOVEABS ch position r The ch parameter is the channel This is how the PLC knows which stepper motor channel to turn on Now this parameter is also used to set the stepper motor channel to controller mode full step driver mode or half step driver mode To set the stepper motor channel to controller mode the ch parameter should be a 1 The same format should be used for STEPMOVEABS except that the count parameter is changed to the position parameter more details provided in the Programmers
39. can only communicate with the Nano 10 PLC through a serial port connection until you have changed the PLC s IP address to match that of your network s address However In order to communicate with the Nano 10 PLC via serial port connection you will need to run the TLServer software on your PC TLServer acts as a serial to Ethernet gateway such that the commands it receives from I TRILOGI software via TCP IP are conveyed to the PLC via the PC s serial port and vice versa Since the Nano 10 PLC only has 1 RS485 serial port this will require that the PC running TLServer to have an RS485 interface However most new PCs today no longer have any built in serial port Thus the easiest way to install an RS485 interface on the PC is to purchase a USB to RS485 converter e g http www tri plc com U 485 htm Since the USB toRS485 converter is powered by USB port you can simply plug the converter into the PC s USB port and connect two wires to the Nano 10 s RS485 port and immediately communicate with the PLC via serial communication Before you make any changes to the PLC s Ethernet configuration parameters it is a 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 After you have retrieved the existing parameters from the PLC you will see that various fields in the configuration software screen are filled up Note that the Nano 10 PLC ha
40. download it from http www tri plc com nano i Relay zip Data Memory 0 DM 4 Figure 2 10 5 There are four data memory locations that can both display the values set by the PLC program and accept new values to be stored in the PLC DMI locations The first four DM locations are used which are DM 1 DM 2 DM 3 and DM 4 These are also the label names set in the 0 HTM file but they could be set to anything such as what is shown in the 2 HTM file 2 10 3 Customizing the HTML Files Now that you know about the components included in the HTML files you can try to customize the HTML files to fit your application or just for fun In order to customize the HTML files you will need to open them with a text editor such as Notepad The file 0 HTM will be used as the example in this section but 2 HTM may be referred to occasionally as well These files typically open with your default web browser so you will need to right click on 0 HTM select Open With and then choose Notepad exe or your preferred text editor Once you have opened 0 HTM in your text editor you will need to scroll down to the area in the file where it says Level 1 User Modifications Begins here You should then see the following in your text editor User s Manual Page 2 34 Chapter 3 I O and Internal Relays Programming 0 HTM Notepad son File Edit Format View Help Level 1 User Modifications Begins here a function userPreference bg
41. email transmission STATUS 3 This function returns 1 on success and 0 on failure Note that this function only returns the email status after the closing tag lt gt has been sent If the function is polled before the last closing tag is sent the status is indeterminate Description You can use this command to send out an email for you at any time The FServer uses the SMTP server and Gateway IP addresses defined by the Nano 10 See Section 2 1 to perform this task If it encounters any errors it will send back an error string which begins with the ERR followed by the reason for the error Although the sender s email address does not have to be a valid email address it is good to at least use a valid domain name as the sender address User s Manual Page 2 11 Example Chapter 3 I O and Internal Relays Programming Otherwise the SMTP server may refuse to send the email because it may deduce that an email with an invalid domain name is likely to be a Spam mail Please refer to the fnEmail function in the TestEthernet PC6 file 2 3 4 Open Connection to Remote FServer or TLServer to Use NETCMD Format Response STATUS 3 Description User s Manual lt CONNECT IP address port of TLServer or XServer gt username string password string lt CONNECTED gt Successfully connected to remote FServer TLServer or XServer at the IP address ERR 05 Prev Conn ON Another NS command
42. has been executed and left the client socket opened but did not execute the PRINT 4 lt gt to close the client socket ERR 04 Not Connected Failed to connect to remote Fserver or TLServer This TBASIC function returns 1 if the connection is active and returns 0 if the connection has ended You can test the connection status to determine if the connection is still alive This service allows your PLC to log in to another Nano 10 an F Series PLC or a T100MD PLC connected via TLServer or XServer through the Internet You execute this command by first sending the string lt CONNECT XXX XXX XXX XXX 9080 gt using the PRINT 4 command where xxx XXX XXX XXX is the IP address of the remote FServer or TLServer followed by sending the username and password needed to log in to the remote server Each line should be terminated with a CR carriage return character The PRINT 4 command automatically appends the CR character Once a connection with the remote server is established the CPU will return the response string lt CONNECTEDs gt to the user program which can read it using the INPUT 4 function The STATUS 3 function can also be used to test if the connection is successful and alive When the program gets the confirmation of connection it can then use the TBASIC NETCMD 4 x command to read or write data to the remote PLCs as if the remote PLC is locally connected to COMM4 port of this PLC as show
43. link commands please refer to Chapter 15 of this manual Normally the host link commands are sent to the PLC via the serial port as per all other PLC models produced by TRi The FServer however permits these host link commands to be sent using the HTTP protocol which enables the Nano 10 and F series PLC to be easily accessible by enterprise software using what is known as Web Query methods The enterprise software only needs to know the format of the host link command required to read the target data and then they can use their web query capability to query the PLC and extract the required data from the response string One example which you can try immediately is to use the Microsoft Excel 2000 or later version spreadsheet program First open a blank spreadsheet then click on the Data menu and select Get External Data gt New Web Query as shown below Microsoft Excel Book1 SI File Edit View Insert Format Tools Data Window Help Adobe PDF EH De ERA 4a amp Ee Zl Sor 4 100 v DI Filter D D A Sch Subtotals Validation H Ca Text to Columns PivotTable and PivotChart Report Get External Data gt Ki Run Saved Query tS New Web Query New Database Query Import Text File Figure 2 6 1 User s Manual Page 2 20 Chapter 3 I O and Internal Relays Programming Next please enter the text as shown in the following diagram and then click OK This will
44. map the switch to 1 0004 and likewise you can map the switch to output 2 using the MOBDUS address 1 0258 However if the driver allows the switch to be mapped to the 0x space then you can use MODBUS register space 1 0258 and 0 0258 for the output 2 mapping with identical result User s Manual Page 2 14 Chapter 3 I O and Internal Relays Programming Table 2 1 Memory Mapping of Nano 10 CPU Internal Data to MODBUS Register MODBUS Word Addr MODBUS Bit m an rr Oat n 40017 110 40017 16 40018 1 to 40018 16 40019 1 to 40019 16 40020 110 40020 16 40021 1 to 40021 16 40022 1 to 40022 16 Timer n 1 to 16 40033 1 to 40033 16 513 to 528 17 to 32 40034 1 to 40034 16 529 to 544 33 to 48 40035 1 to 40035 16 545 to 560 49 to 64 40036 1 to 40036 16 561 to 576 17 to 32 40050 1 to 40050 16 785 to 800 33 to 48 40051 1 to 40051 16 801 to 816 49 to 64 40052 1 to 40052 16 817 to 832 Relay n 40065 1 to 40065 16 40066 1 to 40066 16 40067 1 to 40067 16 Counter n 1 to 16 40049 1 to 40049 16 769 to 784 40069 1 to 40069 16 40070 1 to 40070 16 40071 1 to 40071 16 40072 1 to 40072 16 40073 1 to 40073 16 40074 1 to 40074 16 40075 1 to 40075 16 177t0 192 40076 1 to 40076 16 1201 to 1216 193 t0 208 40077 1 to 40077 16 1217 to 1232 20910224 40078 1 to 40078 16 1233 to 1248 a e LT 497 to 512 40097 1 to 40097 16 1521 to 1536 User s Manual Page 2 15 Chapter 3 I O and Internal Relays Programming
45. may User s Manual Page 2 5 Chapter 3 I O and Internal Relays Programming be accessible from the Internet using the same public IP address of the router but with different port numbers 2 1 8 LAN Speed You can set the LAN speed of the Nano 10 PLC to be either 10 Mbps or 100 Mbps default per second using this menu option Most modern Ethernet switch or router will automatically connect to the PLC using its default LAN speed and there is usually no need for user to configure this option except in very special application where the devices are connected via a 10Mbps Ethernet hub which demands all connected device to be set to the same 10Mbps LAN speed 2 1 9 Node Name You can assign up to 16 ASCII characters any character in naming a PLC The node name is currently not used by the network router so it is merely a convenient name for user to identify a PLC 2 1 10 Username and Password FServer only You can use the username and password feature to prevent unauthorized access to the FServer It adopts the same proprietary encryption scheme used in the TLServer and TRiLOGI software to encrypt the password transmission However unlike the TLServer software that allows you to define unlimited number of usernames and passwords the FServer only permits a single username and password and this is limited to a length of 16 characters each 2 1 11 Use Username Password Yes No In applications where there is no danger of unauthoriz
46. page that is specific to your own application The Nano 10 PLC comprises 2 analog inputs 12 bit 0 5VDC 4 digital Inputs and 4 digital outputs 2 of the digital outputs 1 and 2 can each sink up to 8A peak and 4A continuous 24VDC current from the load and can be used to output stepper motor pulse direction signals or used as Pulse Width Modulated PWM output driver The other 2 digital outputs each comprises a pair of voltage free contacts allowing switching of two isolated loads of up to 5A current per channel 24VDC AC or 120VAC In addition all 4 of the digital inputs can be used for decoding and measuring pulses received from up to 2 digital encoders allowing you to measure position and velocity of 2 moving objects in real time All 4 of the digital inputs can also be defined as interrupt inputs allowing fast events to be handled in the shortest possible time and to not be constrained by the program scan time The Nano 10 built in RS485 port allows it to interface to many peripheral devices such as an LCD display e g MDS100 BW hittp Awww tri plc com mds100bw htm or a serial touch panel e g Maple System HMI The RS485 port is conversant in MODBUS protocol and can be used as a MODBUS master or slave to construct a highly sophisticated control system You can also use it to interface to bar code readers serial printers RFID readers or use it for programming monitoring via the TLServer software part of the i TRILOGI software suite
47. point host link command to it Thereafter the host computer must wait to receive an echo of the Cirl E character from the controller Reception of the echoed Ctrl E character indicates that the controller is ready to respond to the command from the host computer At this moment the host computer must immediately send the command frame to the controller and then wait to receive the response frame from the controller The entire communication session is depicted in Figure 15 1 After the controller has received the command it will send a response frame back to the host computer and this completes the communication session If the controller accepts the command the response frame will start with the same header as the command followed by the information that has been requested by the command and the terminator As you can probably see proper handshaking using the Ctrl E character between the host and the PLC is important to communicate successfully using the Point to point protocol Although the Multi point format discussed in the next section seems more complex the communication exchange using multi point protocol is actually simpler than point to point since it involves only a single exchange of command response string We therefore recommend using the multi point format if you are writing your own communication program Note TBASIC has a built in command NETCMD that lets a Nano 10 PLC access another slave PLC using the multipo
48. rrnernrnnnnnvennnnnnnnnnnnnnnnnvnnnnnnevnnnnnnennnnnnnennnnnnnnennnnnnnennnnnnnenr 16 5 16 9 Read Timer Set Value SV 16 5 16 10 Read Counter Present Value P V rrnnnnrnnrnnnnnvnnnnnnnvernnnnnnnvnnnnnnennnnnnnennnnnnnnnnnnnnnnennnnnnenr 16 5 16 11 Read Counter Set Value S V rrrnnnrnrrnnnnnvernnnnnvnvnnnnnnevvnnnnnnrrnnnnnernnnnnnernnnnnnnennnnnnnennnnnneenn 16 6 16 12 Read Variable Integers A tO Z rrrnnnnnnnnnnnvnvnnnnnnnnnnnnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 16 6 16 13 Read Variable Strings A to Z i 16 6 16 14 Read Variable Data Memory DM 1 to DM 4000 ceeceeeeeseeeeeeeeeeeeeeeneeneeneees 16 7 16 15 Read Variable System Variables rrrnnnrnnnnvnnnnvonnnnvnnnnnvnnnnvennnnnnnnnnnnnnvvnnnnnnnnnnnnnnnnnnnnnennn 16 7 16 16 Read Variable High Speed Counter HSCPV sernnnnnnnnnvnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 16 8 16 17 Write INPUts iii anita Eege dee ranieri 16 8 16 18 MV pute LED 16 8 16 19 Write EE 16 9 16 20 Write Timer contactsS rien 16 9 16 21 Write Counter contacts nriii iii 16 9 16 22 Write Timer Present Value P V annnnnnrnnnnnnnnnnnnnnnnvnnnnnnnnnnnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnr 16 10 16 23 Write Timer Set Value S V i EEN EEN Ee 16 10 16 24 Write Counter Present Value P V REENEN An 16 10 16 25 Write Counter Set Value S V
49. settings on a TRi s PLC with built in Ethernet port such as the Nano 10 and F series PLCs When the Ethernet amp ADC Calibration is selected from the Controller menu you will see the following screen User s Manual Page 2 1 Chapter 3 I O and Internal Relays Programming Ethernet Configuration BASIC The configuration program communicates with the PLC the same way as i TRILOGI which is either ans Factory Default through the TLServer software serial port or Subnet Mask directly through the Ethernet Fserver port Gateway IP Addr SMTP Server Node Name i If your i TRILOGI is not yet connected to the DNS Server Fserver TLServer software or directly to the PLC s built in F TRER Number of TR Server then you will be prompted to login to the Connections Fserver MBTCP PLC s server MBTCP Port SNE Em hd See the i TRILOGI Programmers Reference Manual for more information on this Username Use username password Password c00000000000040 Yes No AccessLevel 1 Programmer w Hap elp Retrieve Parameters from PLC Y Reboot PLC after Save Close Figure 2 1 2 Notes to New Users If this is the first time that you are configuring the PLC s Ethernet port and if your PC is not on the same default subnet of 192 168 1 xxx as the Nano 10 then you may not be able to communicate with the Nano 10 Ethernet port using its default IP address of 192 168 1 5 9080 In that case you
50. slaves whereas the program REMOTE Mseries PC6 will only work with F series M series or another Nano 10 slaves This is because the F series M series and Nano 10 host link command set is a superset of the H series host link command set and this example uses the more efficient M series host link commands to read write 16 bit data for networking between M series PLCs An application note and example programs demonstrating how to use our other PLC models as slave remote UO for the F or M series PLC can be found at the following web page http www tri plc com appnotes AppnoteMain htm 16 44 Inter PLC Networking Using MODBUS Protocols The PLCs may also pass data to each other using special MODBUS commands which are even simpler to use than NETCMD but are restricted to accessing variables that are mapped into MODBUS address structure Please refer to the Section 14 7 and 14 8 as well as the TBASIC Reference manual for details on using the READMODUS WRITEMODBUS READMB2 and WRITEMB2 commands User s Manual Page 16 21
51. temporarily to check if it is affecting your FileZilla connection but it is not recommended to leave your firewall disabled If you have confirmed that disabling the firewall allows you to successfully connect to the Nano 10 server and view the directory listing then you can add FileZilla to the firewall exception list so that you can leave your firewall enabled User s Manual Page 2 29 Chapter 3 I O and Internal Relays Programming To add FileZilla to the Windows firewall exception list you will need to open the Windows firewall from your network settings configuration area Then you will need to click on Change settings which will open up a new window You will need to go to the Exceptions tab in the new window and look for FileZilla in the list of programs If you see FileZilla in the list then you will need to check the box beside it to add it to the exception list Otherwise you will need to manually add it to the list by clicking Add program and searching for FileZilla in its installation directory Here is a picture of the Windows Firewall status window and the Change settings window with the Exceptions tab A a P Windows Firewall Windows Firewall Settings ss 8 Exceptions EGE Windows Firewall General Exceptions Advanced off S e Eeg Exceptions control how programs communicate through Windows Firewall Add All Wind
52. to 1F index into the array starting from 01 User s Manual Page 16 7 Chapter 16 Host Link Command Response Format Response Format PR v s 16 16 TI _ rr T_yrc m snu 4 Hexadecimal Digit for 16 bit integer Example To read the value of DATE 2 which represents the month of the RTC send command RVS0902 and if the PLC responds with Rvs0005 it means the month is May 16 16 Read Variable High Speed Counter HSCPVI Command Format LR Es ae Ee Channel 1 or 2 Response Format pv H 16 16 16 ie 16 16 16 te JD 8 Hexadecimal Digit for 32 bit integer E g To read the value of HSCPV 2 send hostlink command RVH2 If variable HSCPV 2 contains the value 1234560 1E240i the PLC will send the response string as RVH0001E240 16 17 Write Inputs Command Format map ES NVS Channel Data 00 to OF Response Format CA EEE Sa 16 18 Write Outputs Command Format a OI ane ame Nere SE Channel Data 00 to OF User s Manual Page 16 8 Chapter 16 Host Link Command Response Format Response Format i E 16 19 Write Relays Command Format Weini oe oe Channel Data Response Format A i E 16 20 Write Timer contacts Command Format _ _ Channel Data 00 to 07 Response Format 16 21 Write Counter contacts Command Format
53. to from these memory using the standard TBASIC SAVE_EEP LOAD_EEP SAVE_EEP LOAD_EEP commands The pseudo EEPROM data are normally stored in static RAM memory This implies you can read write to the pseudo EEPROM at full speed with no limitation to the read write life of the pseudo EEPROM area since these are actually just RAM memory However since data stored in RAM are volatile they need to be saved into the non volatile flash memory before power down Nano 10 allows you to do so easily using a single SETSYSTEM command as follow SETSYSTEM 252 0 Upon execution of the above command the Nano 10 CPU will erase a special flash memory area used to backup the pseudo EEPROM and it will then copy the entire pseudo EEPROM memory data to the flash memory However the CPU will perform the backup only if there are any changes made to the pseudo EEPROM area This is to prevent unnecessary erase write of the flash memory It is the responsibility of the programmer to determine when and how often to run the abovementioned SETSYSTEM command before power to the Nano 10 is removed in order not to lose data The reason why the programmer should not backup the pseudo EEPROM space to the flash memory every time a data has changed is because a The backup process can take tens of millisecond to complete b the backup involves erasing the flash sector and burning the new data into the flash sector and the flash memory does have a write cycle life of only ab
54. to the PCB which permits easy replacement of the controller board when necessary as shown below wire r Insulated crimp ferrules Tightening screw e Y Figure 1 3 Using Ferrules to connect to screw terminal block Although wires may be connected directly to the screw terminal insulated crimp ferrules should be used to provide a good end termination to multi stranded wires Use of ferrules reduces the possibility of stray wire strands short circuiting adjacent terminals and their use is therefore highly recommended 1 2 2 Power Supply and Digital Output Ports The Nano 10 power supply and 4 digital outputs are available on the detachable screw terminal block along the top edge of the Nano 10 PCB E SEN SS ge 3 OUT3 oun 24V OV OUT1OUT2 The following sections describe the specifications of the PLC power supply as well as digital I Os 1 3 Power Supply The Nano 10 PLC requires a single regulated 24V 5 ripple DC power supply The PLC typically consumes less than 100mA and thus you may also use the same power supply to power the PLC and a small output load as long as the total load current is within the power supply maximum limit If the loads require higher current then it is recommended that a separate power supply be used for the output load Note that if you choose to use two separate power supplies for non isolated output 1 and 2 their OV terminals should be tied together to provide a commo
55. to your network router switch or hub using the straight CAT 5 cable When a Activity Connection connection is made the yellow Connection LED on the RJ45 LED LED connector will light up indicating that the PLC has been Figure 2 1 1 connected to the network router Once connected to the network the i TRILOGI programming software works instantaneously with the PLC allowing remote programming and process monitoring over the LAN or the Internet In addition the Ethernet facility at this port can host web pages and Java applets so that users of the equipment can control monitor their equipment using their web browser from anywhere Before connecting the PLC s Ethernet port you should configure it using the configuration tool that is now built into the 6 3x or higher version of the i TRILOGI programming software Previously a standalone Ethernet Configuration program was required to setup the basic and advanced Ethernet ADC and RTC Real Time Clock options This standalone version is still available and more information on this program including where to download it is available at the end of section 2 1 2 14 Standalone Version of Ethernet Configuration Software Now these settings can be configured directly from the TRiLOGI programming software as described next 2 1 Configuring The Ethernet Port This tool which is located in the Controller Menu of TRILOGI allows you to configure the Ethernet Port and ADC RTC calibration
56. wildcard FCS which is available when the PLC is in auto protocol mode This is to facilitate easy testing of the multi point protocol However the wildcard FCS can be disabled if the PLC has executed the SETPROTOCOL n 5 to put its COMM port n into pure native mode In that case you will have to supply the actual FCS to your command string User s Manual Page 15 3 Chapter 15 Host Link Communication Protocol 15 4 2 Calculation of FCS The FCS is 8 bit data represented by two ASCII characters 00 to FF It is a result of performing an Exclusive OR on each character in the frame sequentially starting from in the device number to the last character in the data An example is as follows _ u ps Device ID Header Data FCS 0100 0000 XOR 0 0011 0000 XOR 4 0011 0100 XOR R 0101 0010 XOR V 0101 0110 XOR 0100 1001 XOR A 0100 0001 0100 1000 A8 Value 4846 is then converted to ASCII characters 4 0011 0100 and 8 0011 1000 and placed in the FCS field FCS calculation program example The following C function will compute and return the FCS for the string passed to it unsigned char compute_FCS unsigned char string unsigned char result result stringt first byte of string while string result string XOR operation return result A Visual Basic routine for FCS computation is included in the source code of a sample communication program you can downl
57. will re boot after you have transferred the parameters to it 5 4 2 ADC Zero Offset ADC n value 4095 4094 4093 3 Zero 1 Offset 0 The zero offset error can be corrected 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 return the total sum to the calling routine Input Voltage Figure 5 7 5 4 3 A D Moving Avg This field lets you define the number of points of moving average that the Nano 10 CPU firmware uses to compute the value returned by the ADC n function Please see explanation of moving average in Section 5 2 5 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 is that 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 return the most recently sampled data at the analog input n User s Manual Page 5 9 Chapter 6 Special Digital I Os Chapter 6 Special Digital I Os User s Manual Chapter 6 Special Digital I Os 6 SPECIAL DIGITAL I Os All of the 4 digital inputs of the Nano 10 PLC can be configured as special inputs such as High Speed Counters Interrupts an
58. 0 OK E g To Write to DM 1200 to 1201 using this command send O1WD1200xxxxyyyyff where xxxx and yyyy are the values to be written to DM 1200 amp DM 1201 16 41 Testing of Host Link Commands You can try out all the Host Link commands using TLServer s Serial Communication Setup However TLServer is designed to accept only multi point protocol commands except the IR command which is necessary to obtain the device ID from the PLC You therefore have to enter all your host link commands in multi point format Since the multi point protocol requires an FCS frame check sequence character to be appended to the end of the command string you may be able to get around it by using the wildcard FCS 00 in place of the actual FCS E g To read input channel 02 from a PLC with ID 01 you can enter the command string as 01RI0200 User s Manual Page 16 19 Chapter 16 Host Link Command Response Format For TLServer version 2 1 and above there is an FCS button that lets you compute the actual FCS for the string in the command string text field You can then use the actual FCS with the command string to completely test your command E g If you type in the string 01R102 in the command string but do not press Enter and then click on the FCS button the FCS for this string will be computed and shown as FCS 58 as shown in the following figure ES Serial Communicatio
59. 0 50 This would be equivalent to an acceleration of 100 pulses s2 which can be calculated using the following expression A V 2S 100 2 50 100pps User s Manual Page 10 3 Chapter 10 Stepper Motor Control 10 3 3 Using the STEPMOVE Command Once the STEPSPEED command is executed the STEPMOVE command can be used to move the stepper motor forwards or backwards STEPMOVE ch count r The ch parameter specifies which stepper motor channel is being used and should be 1 on Nano 10 PLC The count parameter specifies how many pulses the motor will move If the motor were in half step driver mode then count would be in half steps The r parameter specifies which internal relay will be activated once the motor has moved count number of steps This relay would be cleared when the STEPMOVE command is executed in case it was already activated Example 1 Moving Forwards STEPMOVE 1 500 101 channel 1 would send 500 pulses to a driver and then turn on relay 101 Example 2 Moving Backwards STEPMOVE 1 500 101 channel 1 would send 500 pulses to a driver and then turn on relay 101 10 3 4 Using the STEPMOVEABS Command This command allows you to move the stepper motor ch to an absolute position indicated by the position parameter At the end of the move the relay r will be turned ON Position can be between 2 to 2 i e about 2 x 10
60. 0 F to 110 F but you can also easily change the temperature range of interest 5 3 2 Using LM34 Semiconductor Sensor Vs Vs 5V to 30V CHOOSE Ry Vs 50 pA LM34 Vout Vout 3 000 mV AT 300 F 750 mV AT 75 F 500 mV AT 50 F LM34 Vout 10 0 mV F Vs rg Full Range Fahrenheit Temperature Sensor Figure 5 4 The LM34 is a wonderful low cost semiconductor temperature sensor with a range of 50 F to 300 F It is extremely easy to use for measuring temperature above 0 F You simply connect one pin to the User s Manual Page 5 6 Chapter 5 Analog I Os positive voltage 5 to 30V and the other pin to OV and the signal pin will output a voltage that is directly proportional to the ambient temperature in F The output voltage is 10mV per degree F So at room temperature of 72 degrees F the device will output a voltage of 72 x 0 01 0 72V If you connect this to the PLC s analog input you can obtain the temperature in degree F or degree C using the formula F ADC 1 500 4096 in degree F OR C F 32 5 9 in degree C Although another part number LM35 can output temperature in 10mV per degree C the output falls into even lower ADC range for ambient temperature measurement since the same 72 degree F is only 22 degree C which means LM35 only outputs 22 x 0 01 0 22V Hence for better accuracy and resolution we recommend using LM34 instead of LM35 and if need be then convert it to degree C
61. 0 0101 0110 0111 2400 2400 4800 9600 19200 31250 38400 57600 xxxx 1000 1001 1010 1011 1100 1101 1110 1111 Baud Rate 100K 115 2 230 4K 110 150 300 600 1200 A table of all the available baud rates and COMM formats is shown in the following page The communication format written as 7 2 e which means 7 data bits 2 stop bits and even parity Likewise 8 1 n means 8 data bits 1 stop bit and no parity You can use the table to select the baud number for a certain baud rate and COMM format COMM1 can work at high baud rate of up to 230 4 K bps Baud No Table All numbers in Hexadecimal amp H00 to amp HFF at an ate ato zan 71e zao aon 820 EB REENEN E ET e ee SG 80 JEG ek Jae 56 300 OD 4D 6D 8D CD ED 1D 5D 7 26000 ae AE 66 EE SE 7 9200 OR AE ee ee 2400 101 41 61 81 C1 E1 11 51 7 4800 02 42 62 82 C2 E2 12 52 7 2600 03 43 63 83 03 ES 13 53 7 38400 06 as 66 86 06 Pes 1 46 56 7 ink oa ae 66 88 os Es ia 28 78 115K2 109 49 69 89 co E9 19 59 79 E g To set the baud rate of COMM1 to 19200 7 data bit 1 stop bit and even parity Gre Ge statement SETBAUD 1 amp HC4 Important Please note that if you change the baud rate or communication format of the COMM port to something that is different from that set in the TLServer then
62. 0 PLC to use the enhanced quadrature counting by using the SETSYSTEM command as follows SETSYTEM 4 n The value of n at bit 0 1 and 2 respectively defines if the HSC channel 1 2 and 3 is to run in Simple when the bit is 0 or Enhanced when the bit is 1 mode As such N bit 1 0 HSC 2 HSC 1 0 00 Simple Simple 1 01 Simple Enhanced Enhanced Enhanced 7 3 Configuring HSC as x1 x2 or x4 Counters By default the HSC in Nano 10 only increment or decrement the counter by 1 for each full cycle of pulses However since there are two pulse trains and therefore a full cycle produces 4 rising and falling edges in total It is possible to configure the HSC to either count by 1 for every two transition edges x2 or to count every transition edge x4 A new special SETSYSTEM 24 N command can be used to configure the 2 channels of HSCs on the Nano 10 PLC so that they can become simple x1 x2 or x4 quadrature high speed counters This new command not available to T100M PLCs overwrites the settings performed by SETSYSTEM 4 xx mentioned in Section 7 2 and is the new preferred method for configuring the HSC channel N is defined as a two byte integer Upper byte channel number amp H01 or amp H02 Lower byte amp HOO simple amp H01 x1 amp H02 x2 amp H03 x4 E g To define HSC 1 as x2 HSC N amp H0102 To define HSC 2 as x4 HSC N amp H0203 An example program HSC x4
63. 004 and likewise you can map the switch to output 2 using MOBDUS address 1 0258 But if the driver allows the switch to be mapped to Ox space then you can use MODBUS register space 0 0004 and 0 0258 for the mapping with identical results 14 6 1 2 WORD ADDRESS MAPPING As shown in Table 14 1 to access DM 1 from the PLC you use MODBUS address space 4 1001 and so on To access the Real Time Clock Hour data TIME 1 use 4 0513 The I O channels can also be read or written as 16 bit words by using the addresses from 4 0001 to 4 0320 Some MODBUS drivers such as National Instruments Lookout software even allow you to manipulate individual bit within a 16 bit word So it is also possible to map individual I O bits to the 4x address space E g Input bit 1 can be mapped to 4 0001 1 and output bit 2 is mapped to 4 0257 2 etc This is how it is shown in Table 14 1 However if you do not need to manipulate the individual bit then you simply use the address 4 0001 to access the system variable INPUT 1 and address 4 0257 to access User s Manual Page 14 9 Chapter 14 Serial Communications the system variable OUTPUT 1 Note that INPUT 1 and OUTPUT 1 are TBASIC system variables and they each contain 16 bits that reflect the on off status of the actual physical or internal input and output bits 1 to 16 14 6 2 MODBUS RTU Protocol Support The Nano 10 PLC also supports the MODBUS RTU protocol The difference between the ASCII a
64. 2 1 2 1 Digital Inputs Analog Input and RS485 Communication Ports i 1 2 1 2 2 Power Supply and Digital Output Porte 1 3 1 3 Power Supply ii al inni iii Ee 1 3 14 Digital Input Circ US a er a iaia iii 1 4 1 5 Digital Output Circuits iii 1 5 1 5 1 Electrical Gpechticatons ececeeeceeeeeeeeeeeeeeeeee eee aeeeeeeeseeeeecaeeseaaesdeeeeeseaeeesaeeseeeeeeee 1 5 1 5 2 Digital Output Wiring Diagram i 1 6 12523 Ifduetive e DEE 1 6 1 6 Program and Data Memory ssvvnnnnnnnvnnnnnnnvnnnnnnnvnnnnnnnvnnnnnnnnvnnnnnnnnnnnnnnnnennnnnnnnnnnnnnnnnnnnnnnnenennnne 1 7 BT Program MEmO y cstren tali piro delia lekki dtvethbnce AER dette debile E 1 7 LSZ Non Volatile Data Storag ciato 1 8 1 6 3 RAM Data Memory cciri iaia 1 9 1 7 Jumpers J1 amp J4 EE 1 10 1 7 1 Usefulness of Jumper J4 1 10 1 8 Real Time Glock ii ai ale 1 11 1 9 CPU Status Indicators i ile 1 11 2 ETHERNET PORT 2 1 2 1 Configuring The Ethernet POrt mssrnnnnvnnnnvnnnnnnvnnnnnnnnnvnnnnnvnnnnnnnnnnnnnnnvennnnnnnnnnnnnnnvennnnnnnnnnnnnneenn 2 1 LLT IP e le 2 3 a EEN IP e TEE 2 3 21 3 SMIP Server tt cirie 2 3 2 1 4 DNS Server IP Address 2 4 2 1 5 No of Connections FServer Modbus TCP 2 5 2 1 6 FServer Port NO aLaaa 2 5 2 1 7 Modbus TCP Secondary Port NO 2 5 Sp LAN Speed x iy cide ana iii 2 6 21 91 Node N m Larsen CEA REESEN EE EE EE EE EE EEN e 2 6 2 1 10 Username and Password FServer ONlY
65. 3 OMRON Host Link Command Support m mmmrererrrvennrenrnrverrrrrrrnrrrrnnrrerrrrenrnrnnnnnnenrnnen 14 10 14 6 4 Application Example Interfacing to SCADA Goitware 14 11 14 7 Using The PLC As a Modbus Master Getting Data From Power or Flow Meters14 12 14 7 1 Nano 10 PLC As MODBUS RTU Master 14 12 15 HOST LINK PROTOCOL INTRODUCTION 15 1 15 1 Multiple Communication Protocols nrrrriii iii 15 1 15 2 Native Mode Communication ProtoColS rrrssvrnnnnvnnnnnnnnnnvnnnnnnnnnnnnnnnvnnnnnnnnnnnnnnnvennnnnnnnnnnnnnn 15 1 15 3 Point To Point Communication Format errnnvvnnnnvnnnnnvnnnnnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnennnn 15 1 15 3 1 Command Response Frame Format Point to Point 15 2 15 3 2 Error Response Formati i uri ential at ei La tind 15 2 15 4 MULTI POINT COMMUNICATION SYSTEM serre 15 3 15 4 1 Command Response Frame Format Multi point ii 15 3 15 4 2 Galculation ofFCS atutiiie ae lar 15 4 15 4 3 Communication Procedure i 15 4 15 4 4 FrAMInQuE Ors fscaller rele le ie 15 5 15 4 5 Command Errorsi isa iaia EE 15 5 15 4 6 SHOULD YOU USE POINT TO POINT OR MULTI POINT PROTOCOL 15 5 15 5 RS485 Primer tane tion Paces iaticenteewestast liane sini stendene ciet 15 6 15 5 1 RS485 Network Interface Hardware rnnt nnnnnnn ennnen 15 6 15 5 2 Protection of RS485 InterfaCe annt tnnnntrn nnne nnmn
66. 3 USERS URI MANUAL Nano 10 PLC Triangle Research Int l Inc Nov 2010 USER S MANUAL Copyright Notice and Disclaimer All rights reserved No parts of this manual may be reproduced in any form without the express written permission of TRI Triangle Research International Inc TRi makes no representations or warranties with respect to the contents hereof In addition information contained herein is subject to change without notice Every precaution has been taken in the preparation of this manual Nevertheless TRi assumes no responsibility for errors or omissions or any damages resulting from the use of the information contained in this publication MS DOS and Windows are trademarks of Microsoft Inc MODBUS is a trademark of Mobdus org All other trademarks belong to their respective owners Revision Sheet Release No Date Revision Description Cid Rev 1 4 13 2010 Added description of RC Servo Control in Chapter 11 Corrected wrong or inconsistent numbering of figures 6 22 2010 Corrected header error on Chapter 16 Rev 3 11 10 2010 Change all lt REMOTE gt tag to lt REMOTEFS gt Added description of blocking INPUT n in Section 14 5 eo DREES User s Manual Page ii USER S MANUAL Conditions of Sale and Product Warranty Triangle Research International Inc TRi and the Buyer agree to the following terms and conditions of Sale and Purchase 1 The Nano 10 Programmable Controllers are guarantee
67. 30 94 216 144 You can then use this IP address string in all the other NS commands to be described in the following sub sections c The DNS server may take some time to resolve the domain name If it is unable to resolve the domain name then it will return an error string so your program should test to see if it receives the ERRO7 error message to determine whether the returned string is useable d Although it is possible to embed the domain name directly in the NS command in place of IP address it is usually much more efficient to use the IP address directly if it is known in advance This is because the DNS server may take some time to resolve the domain name into IP address each time it is called and there is a possibility that the domain name server may be overloaded or down momentarily when it is needed and hence complicating the attempt for the PLC to connect to a remote server Therefore we recommend that you use the lt DNS domain gt tag to resolve the domain name into IP address first and then use the resulting IP address for all Network Services commands via the Internet 2 3 3 Send Email Format lt EMAIL recipient email address gt SENDER sender email address SUBJECT whatever text string body of the email line 1 body of the email line 2 si A Response lt OK gt Email successfully sent ERR 04 Not Connected Failed to connect to SMTP server Section 2 1 3 ERR 06 Email Failure Failed to complete
68. 5 0 no matter what and the other settings should be left blank because you won t be connecting this Ethernet port to the Internet Page 2 26 Chapter 3 I O and Internal Relays Programming Internet Protocol TCP IP Properties 2 Here is an example of a configuration that will work EEGEN General You can get IP settings assigned automatically if your network supports this capability Otherwise you need to ask your network administrator for Once you have set the IP address and Subnet the appropriate IP settings IP address 192 168 1 2 Subnet mask 255 255 255 Default gateway Use the following DNS server addresses Prefemed DNS server Altemate DNS server if your PLC has an IP address of 192 168 1 xxx where xxx is anything from 1 255 except 2 mask you can click on OK and then click on OK Obtain an IP address automatically again to close the Local Area Connection Properties window shown in Figure 2 8 5 Advanced Figure 2 8 5 Now your Ethernet port has been configured and you can try to connect to your PLC from TRILOGI using your PLCs IP address and port number Note 1 Connecting the PC s Ethernet port directly to the PLC only establishes a private network connection between the two devices That is to say the PLC connected this way is ONLY accessible to this PC Even if the PC is connected to a LAN e g via Wi Fi connection the PLC connected to t
69. 96 15 40097 1 to 40097 16 1521 to 1536 MODBUS is a registered trademark of Groupe Schneider OMRON is a registered trademark of OMRON Corporation AJA A AIA n A BARR DIA User s Manual Page 14 8 Chapter 14 Serial Communications PLC Variables OMRON MODBUS Timer 1 to 64 IR128 to IR191 40129 to 40192 Present Values Counter 1 to 64 IR256 to IR319 40257 to 40320 Present Values Clock TIME TIME 2 TIME 3 Date DATEN DATE 2 DATE 3 DATE 4 Data Memory DM 1 DM 1 DM 2 DM 2 DM 4000 DM 4000 14 6 1 1 BIT ADDRESS MAPPING All the Nano 10 I O bits are mapped identically to both the MODBUS Ox and 1x space The bit register offset is shown in the last column of Table 14 1 Although MODBUS names the 0x address space as Coil which means output bits and the 1x address space as Input Status which means input bits only the Nano 10 PLCs treat both spaces the same Some MODBUS drivers only allow you to read from Ox space and write to 1x space but you still use the same offset shown on Table 14 1 Example To map a lamp symbol to PLC Input 4 you select the MODBUS register address 0 0004 You can also map a lamp symbol to the PLC s output 2 In that case you should map it to MODBUS register address 0 0258 To map a toggle switch symbol to the PLC input 4 if you are restricted to select only MODBUS 1x address space then you will have to map the switch to 1 0
70. Clock Chapter 12 Real Time Clock User s Manual Chapter 12 Real Time Clock 12 REAL TIME CLOCK 12 1 Introduction A Real Time Clock RTC is a device that keeps accurate date and time information down to the second The Nano 10 has a built in Real Time Clock that provides calendar and time data for year month date day of week hour minute and second but it is not battery backed You can however easily add an optional battery backed FRAMRTC module and the Nano 10 will sense it automatically and use it upon installation NOTE If the RTC battery is not installed or the battery is removed for more than 15 seconds from the FRAMRTC then the PLC will lose its real time clock data when it is powered up even with the FRAMRTC installed When this happens the RTC Err bit in the ladder logic special bit will be ON so that user program can use it to alert the operator The PLC can also use the RTC Err bit to trigger an automatic RTC update from an Internet Time Server or from a TLServer that it connects to 12 2 TBASIC variables Used for Real Time Clock Date Time YEAR DATE 1 HOUR TIME 1 MONTH DATE 2 MINUTES TIME 2 DAY DATE 3 SECOND TIME 3 Day of Week DATE 4 There are 7 registers available in TBASIC that are used to access and configure the date and time These registers which are shown above can be read from and written to just like any other integer variable Th
71. Create a new connection Set up a home or small office network Change Windows Firewall settings Disable this network device ti Rename this connection 2 Change settings of this connection User s Manual rear Connec e O Tools Advanced Help Og Dm rer DS Wireless Network Connection Connected Shared Ka D I Broadcom 802 11b g WLAN Ne 1394 Connection Connected D 1394 Net Adapter Figure 2 8 2 Now you can either right click on the Local Area Connection and select Properties or highlight it and click on Change settings of this connection from the Network Tasks sidebar as shown above When you do this the following window will open Page 2 25 Local Area Connection Properties PRETE General Advanced Connect using B Realtek RTL8139 810x Family Fast This connection uses the following items M l Client for Microsoft Networks vi Fie and Printer Sharing for Microsoft Networks bl aos Packet Scheduler Y Install Description Transmission Control Protocol Intemet Protocol The default wide area network protocol that provides communication across diverse interconnected networks C Show icon in notification area when connected Notify me when this connection has limited or no connectivity Figure 2 8 3 Internet Protocol TCP IP Properties nn General Altemate Configuration You can get IP settings as
72. D Link Building Networks for People High Speed 2 4GHz Wireless Ro DI 624 Home A Tools Status Virtual Server is used to allow Internet users access to LAN services Enabled Disabled Name TA Clear Applications Private IP Protocol Type TCP v Filters Private Port WI User s Manual Page 2 22 Chapter 3 I O and Internal Relays Programming On the Linksys WRT54G router you would configure it from the Applications amp Gaming menu under the Port Range Forward tab as shown below Linksys A Division of Cisco Systems Inc Wireless G Broad Applications i F Access Applications amp Gaming UP sica SAGA Restrictions amp Gaming Port Range Forward Port Triggering DMZ Port Range Forward Port Range 2 7 2 Large Corporate Local Area Network In the case of a medium to large corporate LAN whether incoming and outgoing TCP IP packets are allowed to go through the corporate firewall is entirely decided by the System Administrator according to the company s security policy Most corporate LANs will not allow incoming packets from reaching an internal server until the System Administrator has given the permission to do so Some company s network may not even allow devices such as the PLC to open a connection to the Internet to access external data If your application requires the PLC to access the Internet or to be accessible from the Internet then you would need to consult yo
73. Figure 11 5 Opto lsolated Interace to RC Servo In the opto isolated interface shown above the power supply to the PLC and that to the RC Servo are completely isolated no common ground required Also since the interface inverts the output signal from the PLC no software inversion is necessary i e When the PLC NPN output is OFF the control input to the RC Servo will be OFF and when the PLC NPN output is ON the control input to the RC Servo 6V Hence to send a 5 positive PWM control pulse to the Servo you can run the following statement SETPWM 2 500 50 Set PWM 2 output to 5 duty cycle at 50 Hz Likewise to send a 10 positive PWM control pulse to the Servo you can run the following statement SETPWM 2 1000 50 Set PWM 2 output to 10 duty cycle at 50 Hz Of course you can replace the duty cycle with a value e g DM 1 and run statement such as SETPWM 2 DM 1 50 Set PWM 2 output to DM 1 100 duty cycle at 50 Hz 11 4 3 RC Servo Positioning Resolution Since the resolution on the Nano 10 PLC s PWM output is precise to 0 01 at 50Hz this means that you can get a maximum of 500 discrete positions within the travel range of the RC Servo This should be sufficiently accurate for many applications such as HVAC damper control or control of proportional valves The actual positioning accuracy and precision however will depend on the quality of the RC Servo User s Manual Page 11 5 Chapter 12 Real Time
74. INPUT n will not suspend the CPU and wait for a valid string from the COMM port However in real world communication very often you will need to send a command to a device and it takes a while for the device to be able to send back a response string User s Manual Page 14 5 Chapter 14 Serial Communications The most efficient way of handling such serial communication exchange with other devices is to send a command string using the PRINT n and then start a timer and let the PLC program continue to scan the ladder program When timer times out the timer contact is used to activate a custom function and use INPUT n to read the return message from the device This is most efficient use of the CPU time since the program will not have to waste time to wait for response string from the device and that s the reason for INPUT n to default to non blocking mode Another way to deal with this is to use the NETCMD function terminated with NETCMD sends a command string and will return immediately when it receives a response string or if more than 0 15s has passed If the device is slow to response the CPU basically sits in a loop to wait for the response for up to a maximum of 0 15s NETCMD function also re tries the communication several times if it does not receive a response in the first try A third way of handling serial exchange with other devices is to use the INPUT n command in blocking mode Starting from CPU firmware r72 and
75. Label Names This is the same as for the digital I O except that the I O table window needs to be scrolled to the custom function area for editing custom function names Placing the custom function in the circuit is done the same way as other ladder logic contacts and coils by selecting the and then choosing the Differential custom function dCusF from the pop up jp CusFn Custom Function E dCusF Diff Up Custom Funcs i window br MaRsT Master Reset The circuit should look something like below E TRiLOGI Version 6 13 Untitled File Edit Controller Simulate Circuit Help Circuit 1 AE HE HH Haru I I sal fune__1 4 Figure 3 5 Circuit with custom function dCusF 3 3 2 Controlling I O from Custom Functions An empty custom function looks like this User s Manual Page 3 3 Chapter 3 I O and Internal Relays Programming KE Custom Function 1 Func_1 Control Find Find All 1 Func_1 latita Las ha Rename Function View Other Functions Keyword Helps Undo New Release TRILOGI 6 30 Build 02 F series PLCs users should upgrade to version 6 30 to take advantage of the integrated Ethernet amp ADC Configuration Tool This allows you to change the PLC s IP address and other settings remotely TBASIC code is entered into the custom function which allows the possibility of total control of all of the
76. Link CommandS asrnnnnvnnnnvnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnvnnnnnnnnnnnnnnneer 16 17 Read le Mee EEN 16 17 VISITE EE 16 18 Read Data Memory DM 1 to DM 4000 16 18 WRITE Data Memory DM 1 to DM 4000 enrenannvnnnnnvnnnrrnnnnrrnnnnnvnnerrennnrrnnnnrnnennenennne 16 19 Testing of Host Link Commande rnnnvrnnnnvnnnnnvnnnnvnnnnnnnnnnnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 16 19 Visual Basic Sample PrograM rsssvnnnnvnnnnnvnnnnnnnnnvnnnnnnnnnnnnnnnnvnnnnnnnnnnnnnnnnnnnnnennnnnnnnnnnnnnn 16 20 Inter DLC Networking Using NETCMD Command in 16 21 Inter PLC Networking Using MODBUS ProtocolS rrnsssrnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 16 21 User s Manual Page x Chapter 1 Installation Guide Chapter 1 Installation Guide for Nano 10 PLC User s Manual Chapter 1 Installation Guide 1 INSTALLATION GUIDE FOR NANO 10 PLC Power1 Power2 AC DC AC DC 24V DC Power Supply for PLC Output LED Indicators Red SN O G Gig NANO 10 24v o o tIO T2 ors on BYTRI Hn su WwW SR DODO RELAY1 RELAY 2 rss nonna nee i bei 10 3 arii E Ethernet RJ 45 E 00 1F 2E 00 10 10 E ___ Modbus TCP L TTT Remote programming Email peer to peer etc IN2 IN3 IN4 AN1 AN2 5V e el le olje el QOQNOSNQPNXQ PL Two Wire 4 Dig
77. OMM1 serial port and thus TBASIC statements and functions such as PRINT 1 INPUT 1 and NETCMD 1 are used since the NS commands are sent through the serial port 1 2 Since the Ethernet is already built in on the Nano 10 PLCs you do not need to send NS commands via any of its serial port this also means that no serial port is sacrificed in order to have access to Ethernet communication However to help users of the XServer and TLServer migrate easily to the Nano 10 PLC Ethernet port we implement the NS commands using similar command format as that on the XServer and TLServer But instead of sending the commands through COMM1 you will interact with the O S through COMM port 4 d Of course since the Nano 10 PLC doesn t have 4 serial ports COMM port 4 is therefore only a virtual comm port and its creation is merely to simplify implementation of the NS commands 3 The TestEthernet pc6 download from http www tri plc com trilogi Nano10Samples zip includes all examples of how to use the NS commands via virtual comm port 4 which serves as a good starting point for you to learn these simple but yet powerful methods for making a client connection over the LAN or the Internet 4 The PLC reserves only a single client socket to implement the Network Services If you use any of the NS commands listed below please ensure that the command is completed so that the client socket can be closed before issuing a different N
78. PLC s 0V Use a 250 0 3 16 ohm resistors in series to obtain 253 16 ohm Again due to the 20 00K ohm internal resistance on the PLC s ADC inputs you need to wire a 253 16 ohm resistor formed by a 250 ohm and 3 16 ohm resistors in series to the circuit in order to convert the 4 20mA signal to 1 00 5 00V analog voltage and can be read by the PLC using the ADC n statement which will return readings of between 819 and 4095 5 2 2 Using Potentiometer to Set Parameters A potentiometer can provide a very low cost means for users to input parameters to the PLC such as temperature settings timer or counter preset values etc The diagram above shows how easy it is to implement such a device using the 5V reference output and an analog input Very accurate parameters can be set if an external LCD display e g MDS100 BW is used as visual feedback of the settings Alternatively a paper scale can be printed to give approximate set value at various angles of the potentiometer s rotating arm A D 1 to 8 10KQ Potentiometer E Figure 5 2 5 2 3 Reading Analog Input Data The 2 analog input signals are read by the TBASIC command ADC 1 to ADC 2 The ADC n function will return a number between 0 and 4095 12 bit resolution which corresponds to the measured voltage at any of the analog inputs n The resolution of a 12 bit ADC is 1 4096 this means that for the 0 5V ADC range the resolution is 5 4096V 1 22mV That means that if you appl
79. PLCs functions and hardware There are 7 TBASIC functions available to control all of the digital I O which are SETIO labelname CLRIO abelname TOGGLEIO abelname TESTIO abelname SETBIT v n CLRBIT vn TESTBIT v n EO Ol BQ Ne Each function has its own advantage depending on what needs to be done to a digital I O Each of these functions is explained in the programmer s reference manual which should be referred to for further information Here are some examples of how to control digital UO using these functions 3 3 3 Example 1 Turn on off an Output This can be done using both the SETBIT v n CLRBIT v n command and the SETIO abelname CLRIO labelname command 1 Using SETBIT v n CLRBIT vn SETBIT OUTPUT 1 0 This will turn on the first output using the output register CLRBIT OUTPUT 1 7 This will turn off the 8th output using the output register 2 Using SETIO labelname CLRIO labelname SETIO out This will turn on the output outi CLRIO out5 This will turn off the output out5 User s Manual Page 3 4 Chapter 3 I O and Internal Relays Programming In this case out1 and out5 would need to be entered in the I O Table as an output Otherwise there will be a compilation error 3 3 4 Example 2 Toggle an Output TOGGLEIO light This will change the output light from off to on or on to off The output light would need to be entered into the I O Table as an output as well and could repres
80. RTC is only corrupted then you should only have to set the RTC to resolve the problem This can be done most easily by using the TRiLOGI method of setting the RTC that was described in section 12 4 After setting the RTC the PLC should be powered off and then powered on again The RTC Err bit should be off at this point but if it isn t then there is a possibility of damage to the PLC At this point you should contact Triangle Research tech support or if you have purchased the unit from a local distributor then you should contact the distributor for assistance User s Manual Page 12 5 Chapter 13 LCD Display Port Chapter 13 LCD Display Programming User s Manual Chapter 13 LCD Display Programming 13 LCD DISPLAY PROGRAMMING Although the Nano 10 PLC lacks a connector for connecting to a physical LCD display it does support the SETLCD command available to all the M series and F series PLC The content of the non existent LCD display however can still be displayed as a Virtual LCD screen using the I TRILOGI On line monitoring function Thus the SETLCD command can still be an effective debugging tool for the PLC to display internal or computed data The LCD content is also accessible from a web browser using the appropriate web services commands Hence it can still be extremely useful for a Nano 10 to use the SETLCD command to manipulate its virtual LCD display and the content is visible on the user configurable control web page de
81. S command All NS commands begin with a string enclosed within the angle bracket called a tag e g lt EMAIL gt lt CONNECT gt Most NS commands end with a closing tag lt gt except the lt REMOTEFS gt tag which ends with a lt REMOTEFS gt closing tag Depending on the command type the Nano 10 CPU may return one or more response strings via virtual comm port 4 from which the PLC can read to determine if the NS command has been executed properly User s Manual Page 2 9 Chapter 3 I O and Internal Relays Programming The PLC can operate the Ethernet port by means of TBASIC INPUT and PRINT commands operating on COMM 4 It uses the PRINT 4 command to send out NS commands and the INPUT 4 command to receive response data via the Ethernet port Notes 1 UNLIKE the case of T100MD PLC XServer the CPU does not route communication data that the FServer or Modbus TCP server is exchanging with external clients to the virtual comm port 4 This means that there would not be interference to the NS command response being sent and received by the PLC program via virtual comm port 4 As such there is no need to implement the arbitration method mentioned in the XServer User s Manual for this PLC Only PRINT 4 and INPUT 4 are implemented on virtual COMM port 4 Nano 10 PLC DOES NOT support the INCOMM 4 and OUTCOMM 4 commands However you may send any non zero ASCII data usin
82. Timer 1 to have a Set Value of 500 SetCtrSV 10 1000 Define Counter 10 to have a Set Value of 1000 4 3 4 Volatility of Nano 10 Timer amp Counter Set Values It is important to know that regardless of whether an FRAMRTC is installed all the Set Values SV of timers and counters in Nano 10 PLC are stored at special pseudo EEPROM areas reserved for storing configuration data We have described in detail how the pseudo EEPROM are implemented in the Nano 10 PLC see section 1 6 2 Although this pseudo EEPROM area for storing configuration data is separate from the user EEPROM area that you access with the SAVE_EEP and LOAD_EEP commands the underlying mechanism works the same way That is to say if your TBASIC program changes the SVs using the SetTimerSV and SetCirSV command the new SVs are only temporarily stored in the PLC RAM area until they are backup to the flash memory User s Manual Page 4 4 Chapter 4 Timers Counters amp Sequencers As described in section 1 6 2 the backup process only occurs when the PLC is reset rebooted or when the SETSYSTEM 252 0 command has been executed Therefore if you want the new SVs to be permanently stored in the PLC you will have to either run the SETSYSTEM 252 0 command once or perform a software reset to backup these new data to the flash memory so that the changes can become permanent 4 3 5 Controlling a Timer or Counter in a Custom Function You can activate a timer or a counter direc
83. a single PLC Replace the converter if it is confirmed to be faulty Next check the wire from the converter to the beginning of the network A broken wire here can lead to the failure of the entire network User s Manual Page 15 9 Chapter 15 Host Link Communication Protocol Since an RS485 network links many PLCs together electrically and in a daisy chain fashion problems occurring along the RS485 network sometimes affect the operation of the entire network For example a broken wire at the terminal of one node may mean that all the PLCs connected after this node become inaccessible by the master If the RS485 interface of one of the PLCs has short circuited because of component failure then the entire network goes down with it too This is because no other node is able to assert proper signals on the two wires that are also common to the shorted device Hence when trouble shooting a faulty RS485 network it may be necessary to isolate all the PLCs from the network Thereafter reconnect one PLC at a time to the network starting from the node nearest to the host computer Use the TRILOGI program to check communication with each PLC until the faulty unit has been identified User s Manual Page 15 10 Chapter 16 Host Link Command Response Format Chapter 16 Host Link Protocol Format User s Manual Chapter 16 Host Link Command Response Format 16 HOST LINK PROTOCOL FORMAT This chapter describes the detailed formats of the command an
84. able length Response Format mere E g To assign the string Super PLC to the string variable P send hostlink command wvsP Super PLC User s Manual Page 16 11 Chapter 16 Host Link Command Response Format 16 28 Write Variable Data Memory DM 1 to DM 4000 Command Format w v o 16 16 16 16 16 16 16 16 O NT 16 bit Index to array 16 bit Integer Data 0001 to OFAO 400010 Response Format w yv o D E g To write the value 1234 4D2 g to DM 1000 send hostlink command wvD03E804D2 100010 3E8416 16 29 Write Variable System Variables Variable t mer Io 05 tmerPvi Io Command Format type Index 16 bit Integer Data type 01to 0D denotes the type of system variable to access index 01 to 1F index into the array starting from 01 Response Format E g To set cik 1 which represents the hour of the RTC to 14 send the command Nvs0801000E to the PLC User s Manual Page 16 12 Chapter 16 Host Link Command Response Format 16 30 Write Variable High Speed Counter HSCPVI Command Format 1or2 8 Hexadecimal Digit for 32 bit integer Response Format E g To clear the value of HSCPV 2 send hostlink command WvH200000000 16 31 Halting the PLC Command Format When the PLC receives this command it temporarily halts the execution of the PLC s ladder program after the current sca
85. above if you run the command SETSYSTEM 19 t This will configure the INPUT n command to block the CPU for up to maximum of t x 10 milliseconds to wait for a valid string from 3 party device Although this command also wastes CPU cycles to wait for a response and hence it is not as efficient compared to using the timer activated method mentioned above it nonetheless is very simple to implement and can be used for non time critical applications You only need to execute SETSYSTEM 19 t once and INPUT n will block for the same t x 10 millisecond every time it is executed until SETSYSTEM 19 t is run again To return the INPUT n to non blocking mode run SETSYSTEM 19 0 PRINT n The PRINT statement transfers its entire argument to a 256 byte serial out buffer which is separate from the serial in buffer The PRINT statement therefore does not affect the content of the serial buffer for incoming characters The operating system handles the actual transfer of each byte of data out of the serial out buffer in a timely manner Note that the PLC automatically enables the RS485 transmit driver when it sends serial characters out of its RS485 port When the stop bit of the last character in the serial out buffer has been sent out the operating system immediately disables the RS485 driver and enables the receiver This greatly eases the use of the RS485 port since there is no need for a user to bother with the often critical timing of control
86. age 2 6 Chapter 3 I O and Internal Relays Programming Please download and run the SetupFPLCConfig exe file from the above URL to install the F series Ethernet Configuration Utility program After you have installed the configuration program please click on the Windows Start button and open the F series PLC Configuration group and select the Ethernet Configuration Utility program The following screen should appear f i This configuration program can only communicate F Series Ethernet Basic Configurat SG DE with the PLC via its serial port RS485 in the case of Nano 10 If you PC already has an RS232 port IPAddress fig2 he fi Js Posen or USB RS232 adapter you can purchase an Subnet Mask 255 255 e o Default Auto485 adapter to obtain the required RS485 ae i i interface Otherwise it may be more convenient to ES IS INN DO purchase a USB to RS485 adapter e g SMTP Server Jo fo fo Jo Advanced http Awww tri plc com U 485 htm for the program DNS Sewer ip fo fo contowaton to work with the Nano 10 PLC RE S080 o sove First click on the Serial Setup button and set the Modbus TCP 502 Nof BB PC s COM port to the same settings as the PLC s SEME oske ce METER RS485 port default settings are 38 400bps 8 data bit 1 stop bit and no parity It is important that you select a valid COM port on the PC Usemame Use Usemame Password otherwise the program will report an error
87. and allows you to read all the Nano 10 PLC s 16 bit system variables such as the inputs outputs relays counters timers timers P V counters P V CLK and DATE Although inputs outputs etc are also accessible via the RI RO RR commands the RVS command can access them as 16 bit words instead of as 8 bit bytes in those commands For the 32 bit system variable HSCPVI use the RVH command described in the next section to access it It may be more conventional for some SCADA software driver to use a single header command RVS to access all the I O varying only the type number to access different I O types The RVS command also can be used to access the internal variables used to store ADC DAC and PWM values obtained during the latest execution of the ADC setDAC or setPWM statement These are however not system variables in the TBASIC sense E g it is illegal to use ADC 2 to access the ADC channel 2 in TBASIC you have to use the ADC 2 function instead An 8 bit hexadecimal number is used to denote the type of system variable as shown in the following table Variable Variable ind all 04 05 _PWM ___ oD Not a system variable in TBASIC but readable timer 04 Prc co is _timerPV 06 07 08 09 08 Command Format RV Sole type Index type 01to 0D denotes the type of system variable to access index 01
88. 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 correct the reading to 2060 x 0 9942 2048 Example 2 If you apply 4 000V to ADC 2 you would expect the ADC 2 function to return a value of 4 000 5 000 x 4096 3277 However your program returned a value of 3230 from ADC 2 Proportional Error 3230 3277 0 985658 Multiplication factor required to correct this error 1 0 985658 1 0146 1 146 10000 gt X 146 To compensate for this error enter a value of 146 in the ADC Calib for Ch 2 and save it to the PLC After the PLC has rebooted the CPU would apply the multiplication factor of 1 0146 to the readings it received which would correct the reading to 3230 x 1 0146 3277 Notes 1 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 of F series PLC The same file can also be used to compute the calibration factor for the Nano 10 This file can be downloaded from the following web page http www tri plc com appnotes F series AnalogCalibration xls User s Manual Page 5 8 Chapter 5 Analog I Os 2 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
89. another ladder circuit that contains one counter contact and one output the ladder logic circuit should like something like Figure 4 4 below KS TRILOGI Version 6 14 Untitled File Edit Controller Simulate Circuit Help Circuit 2 A HH HJH F Mt Jal Fig Frio E S DeL Input Counter Jp_ dETEI Counter1 Output OUT Figure 4 4 Completed Counter Circuit User s Manual Page 4 3 Chapter 4 Timers Counters amp Sequencers 4 3 Programming timers and counters in Custom Function 4 3 1 Programming Timers and Counters Present Values The present values PV of the 64 timers and 64 counters in the PLC can be accessed directly as system variables timerPV 1 to timerPV 64 for timers present value ctrPV 1 to ctrPV 64 for counters present value 4 3 2 Accessing Inputs Outputs Relays Timers and Counters Contacts The bit addressable I Os elements are organized into 16 bit integer variables TIMERBIT 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 I O numbers 48 33 32 17 16 1 Bit 15 0 15 0 15 0 TIMERBIT 3 TIMERBIT 2 TIMERBIT 1 CTRBIT 3 CTRBIT 2 CTRBIT 1 4 3 3 Changing The Timer and Counter Set Values in a Custom Function You can use the SetTimerSV and SetCtrSV functions to change the Set Value SV for a timer and counter respectively An example of this is shown below SetTimerSV 1 500 Define
90. ase of the Nano 10 PLC and the password will be provided User s Manual Page 2 31 Chapter 3 I O and Internal Relays Programming 2 10 Accessing and Customizing the HTML Web Interface for Control and Monitoring In the previous section 2 9 Installing a Web Page or Web Applet into the Nano 10 PLC using FileZilla you were shown how to transfer html files to the Nano 10 web server These files can be accessed from any standard web browser that supports AJAX technology Internet Explorer Firefox Safari locally as long as your Nano 10 is connected to the LAN local area network or from anywhere in the world as long as your Nano 10 is connected to the Internet Even the iPhone and other smartphones that support AJAX can be used to access these web pages which means your application can be controlled and monitored from anywhere while on the go The Nano 10 PLC comes prepackaged with two ready to use web pages installed in its web server and a JavaScript file that interfaces to the PLC These web pages run on HTML and JavaScript code which is why they are only accessible from standard browsers that support AJAX technology However the HTML files are designed to be easily modified by anyone even if you don t have any programming experience The purpose is to be able to easily customize the web page layout for your specific application by defining some label names and a background image without having to worry about the programming required to i
91. ation of an ADC channel you need to supply a precise DC 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 is an error you can apply a correction factor to it To perform the ADC calibration you would need to use the Ethernet Configuration Tool mentioned in Chapter 2 1 Click on the Advanced button on the Basic Configuration screen and open the Advanced Configuration screen The bottom half of the screen contains ADC and DAC calibration constants that you can enter and transfer to the PLC as shown below User s Manual Page 5 7 Chapter 5 Analog I Os ADC Calib Chi Ch2 Cha Ch4 Ch5 Che Ch ChS 0 000x x 20 100 25 60 50 50 30 60 Zero Offset 0 0 0 0 0 O 0 O DAC Calib 0000 10 Jd fo fo A D Moving Ava 3 EN No of pts 1 9 Zero Offset 0 0 o fo Figure 5 6 5 4 1 ADC Calib These fields are used to apply a multiplication factor to the value returned by ADC function The multiplication factor 1 x 10000 Example 1 If you apply 2 500V to ADC 1 you would expect the value returned by ADC 1 to be 2048 But the actual average reading centers around 2060 Proportional Error 2060 2048 1 005859 Multiplication factor required to correct this error 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
92. attempts to communicate with it using the NATIVE mode You will receive a communication error if you try to use TRILOGI to access a PLC COMM port that has just been communicating in other protocol modes 4 To improve the flexibility of switching from one COMM mode to another The Nano 10 incorporates a COMM mode self reset timer such that a specific COMM mode will time out automatically and enters into AUTO mode after 10 seconds if no more commands are received from that COMM port When a user wants to switch from one COMM mode to another he she often will be changing the serial connector from one device to another During this time there is no data received by the COMM port which presents an opportunity for it to reset its COMM mode However the surest way to reset the specific COMM mode is to cycle the power to the PLC so that its COMM port will be reset to AUTO mode and ready to communicate with any supported protocols 5 If you wish to use the COMM port for serial data input only you can use the SETPROTOCOL command to set the COMM port to NO PROTOCOL This can prevent the PLC from erroneously treating some serial data as the header of an incoming communication protocol and respond to it automatically The SETPROTOCOL command can also be used to set the PLC to a specific protocol This may be desirable if the COMM port has a specific role and you do not want it to enter other modes by mistake User s Manual Page 14 4 C
93. both the TLServer and TRiLOGI will no longer be able to communicate with the PLC via this COMM port You will have to either configure the TLServer s serial port setting using its Serial Communication Setup routine to match the PLC or you can cycle the power to the PLC to reset the COMM port to the default format 38 400 8 n 1 If you had used 1st Scan contact to activate the SETBAUD command than you will need to cycle the power to the PLC with Jumper J4 shorted to halt the execution of the SETBAUD command When the PLC is reset this way its COMM1 will power up at the default format of 38 400 8 n 1 only so you will need to configure TLServer s serial port to 38 400bps to communicate with it User s Manual Page 14 3 Chapter 14 Serial Communications 14 4 Support of Multiple Communication Protocols The Nano 10 PLC is a real communication wizard It has been designed to understand and speak many different types of serial communication protocols some of which are extremely widely used de facto industry standards as follows a NATIVE HOST LINK COMMAND b MODBUS ASCII Trademark of Modbus org c MODBUS RTU Trademark of Modbus org d OMRON C20H protocols Trademark of Omron Corp of Japan The command and response formats of the NATIVE protocols are described in detail in Chapter 15 and 16 The other protocols and their address mapping to the Nano 10 PLC are described in Section 14 7 Each COMM port can communicate usin
94. ces However if the MODBUS TCP port is to be exposed to the public Internet then you ought to consider the security issues associated with MODBUS TCP connections Since a MODBUS TCP connection does not require a username password login sequence unlike the FServer login the only way to protect against unauthorized access is through the Trusted IP addresses defined using the Ethernet Configuration software User s Manual Page 2 16 Chapter 3 I O and Internal Relays Programming You can use either the Ethernet Configuration Tool mentioned in Section 2 1 or the standalone F series Ethernet Configuration program mentioned in Section 2 1 14 to define a list of Trusted IP addresses Please click on the Advanced button on the Basic Configuration screen as shown in Figure 2 4 1 and you should see the following Advanced Configuration screen The first thing you should do is to click on the Retrieve Parameters from PLC so that you can capture a copy of the current 1F 2E 11 22 Factory Default ie n se _ Faton Detaut configuration in the PLC and you can then Trusted Pat 192 168 1105 2 24 63 173 123 modify selectively Advanced Configuration Trusted IP 3 0000 4 0 0 0 0 You can define a list of up to 6 Trusted Trusted IP 5 0 0 0 0 6 0 0 0 0 IP addresses in this panel To enable the E Modbus TCP Trusted IP click on the Yes button next to the Modbus TCP Use Tru
95. ch MODBUS register as shown in Table 12 1 User s Manual Page 14 7 Chapter 14 Serial Communications Table 14 1 Memory Mapping of to other PLCs PLC I O om MODBUS Word Addr MODBUS Bit Addr mapping Mapping BEER Input n BEE sli E 1 to 16 R00 0 to IR00 15 0001 1 to 40001 16 1t016 DA 17 to 32 0002 1 to 40002 16 17 to 32 Output n LL 2564n o 1 to 16 IR16 0 to IR16 15 40017 1 to 40017 16 257 to 272 4 BARR Timer MM i EE Te i Counter E E eae 49 to 64 IR51 0 to IR51 15 40052 1t0 40052 16 817 to 832 ai a Relay n 1024 1 to 16 IR64 0 to IR64 15 0065 1 to 40065 16 1025 to 1040 17 to 32 IR65 0 to IR65 15 0066 1 to 40066 16 1041 to 1056 DIA 33 to 48 IR66 0 to IR66 15 0067 1 to 40067 16 1057 to 1072 49 to 64 IR67 0 to IR67 15 0068 1 to 40068 16 1073 to 1088 65 to 80 IR68 0 to IR68 15 0069 1 to 40069 16 089 to 1104 81 to 96 IR69 0 to IR69 15 0070 1 to 40070 16 105 to 1120 97 t0 112 IR70 0 to IR70 15 0071 1 to 40071 16 121 to 1136 113 to 128 IR71 0 to IR71 15 0072 1 to 40072 16 137 to 1152 129 to 144 IR72 0 to IR72 15 0073 1 to 40073 16 153 to 1168 145 to 160 IR73 0 to IR73 15 0074 1 to 40074 16 169 to 1184 161 to 176 IR74 0 to IR74 15 0075 1 to 40075 16 185 to 1200 177t0 192 1R75 0 to IR75 15 0076 1 to 40076 16 1201 to 1216 193 t0 208 IR76 0 to IR76 15 0077 1 to 40077 16 1217 to 1232 209t0 224 _ 1R77 0 to 1R77 15 0078 1 to 40078 16 1233 to 1248 ce re SE SA 497t0 512 IR96 0 to IR
96. ch it will update the physical Inputs and Outputs I O at the end of the scan Hence the location of a logic element within the ladder diagram is important because of this sequential nature of the program execution When scanning the ladder program the CPU uses some internal memory variables to represent the logic states of the inputs obtained during the last I O refresh cycle Likewise any changes to the logic state of the outputs are temporarily stored in the output memory variable not the actual output pin and will only be updated to the physical output during the next I O refresh You can see that the CPU will only notice any change to the input logic state when it has completed the current scan and starts to refresh its input variables The input logic state must also persist for at least one scan time to be recognized by the CPU In some situations this may not be desirable because any response to the event will take at least one scan time or more An interrupt input on the other hand may occur randomly and the CPU will have to suspend whatever it is doing as soon as it can and start servicing the interrupt Hence the CPU responds much faster to an interrupt input In addition interrupts are edge triggered meaning that the interrupt condition occurs when the input either changes from ON to OFF or from OFF to ON Consequently the input logic state need not persist for longer than the logic scan time for it to be recognized by
97. ck up copies are kept in case you find that the web page is not working and you may need to refer to the original copy User s Manual Page 2 38 Chapter 3 I O and Internal Relays Programming Chapter 3 Digital UO and Internal Relays Programming User s Manual Chapter 3 I O and Internal Relays Programming 3 DIGITAL I O AND INTERNAL RELAYS PROGRAMMING 3 1 Introduction Although the Nano 10 PLC has only 4 physical Digital Inputs and 4 Digital Outputs all additional input and output bits that are supported by the i TRIiLOGI software are still available to the Nano 10 PLCs as internal inputs and output bits Nano 10 also supports all 512 internal relays available in both ladder logic and BASIC 3 2 Programming DIO with Ladder Logic The physical I O and internal relays can be programmed in ladder logic in a few simple steps 3 2 1 For Physical I O 1 Createor Edit the label names 2 Place the input contact s into the ladder logic circuit 3 Place the output coil at the end of the ladder logic circuit 3 2 2 For Internal Relays Non Latching Create or Edit the label names Place the relay contact s into the ladder logic circuit Place the relay coil at the end of the ladder logic circuit OD 3 2 3 For Internal Relays Latching Create or Edit the label names Place the activating input relay contact into the ladder logic circuit Place the latching relay in parallel with the activating contact Place the relay coil at the end
98. ckets for DMLocY are the y coordinates for each data memory item The label and field for DM 1 is the first value and the next value is for DM 2 etc Changing the Size of Display Data Labels and Buttons It is possible to change the default size of the interactive objects which are the Data Memory labels and fields the Internal Relay Bit buttons and the LCD Display Only the values need to be edited in the corresponding lines of code in the HTML file just like how the x y coordinates can be edited Again some trial and error will be required to find the desired size Resizing the LCD Display LCDSIZE 185 21 width height of each line of LCD The specified size is reflected equally in all four of the display lines so each line cannot have a different size User s Manual Page 2 36 Chapter 3 I O and Internal Relays Programming Resizing the Internal Relay Bit Buttons IOwidth 80 Fixed width for I O button Set to 0 for Auto width IOheight 0 Use Auto height If you set the IOwidth or IOheight to 0 then the program will adjust the I O button size based on the width of height of the entire label name But if you specify a fixed value such as 80 as shown above then the specified size is reflected equally in all eight of the buttons so each one cannot have a different size Resizing the Data Memory Labels and Fields DMWidth 175 DMHeight 20 The specified size is reflected equally in all four of the
99. command the Excel spreadsheet to send the web query string RI00 to the Nano 10 PLC that is connected to the network with IP address 192 168 1 5 and port 9080 The query string RIOO is for reading the status of 8 bit input channel 0 which covers the logic states of input bit 1 to 8 If the FServer is accessible by the PC from the network router it will send the response data which will be displayed on the selected spreadsheet cell where the New Web Query was defined earlier The response data shown on the cell could be RIOO The response data includes the command header RI as defined in the HostLink Command protocol described in Chapter 15 The data 00 indicates that none of the inputs 1 to 4 are currently turned ON FE New Web Query eax 1 Enter the address for the Web page that contains the data you want If browsing switch back to Excel once you have located the Web page in your browser http 192 168 1 5 9080 HOSTLINK RI00 Browse Web 2 Choose the part of the Web page that contains the data you want Note that pre formatted sections are treated as tables The entire page Only the tables C One or more specific tables on the page Enter table name s or number s separated by commas 3 Choose how much formatting from the Web page you want your data to keep None C Rich text formatting only Full HTML formatting Save Query Advanced a Cancel Figure 2 6 2
100. comprises the power electronics circuitry that provides the voltage current and phase rotation to the stepper motor coils A stepper motor controller on the other hand only supply the direction and output a number of pulses to an external stepper motor driver to actually drive the stepper motor Since the Nano 10 PLC only has two high speed digital outputs the PLC is only capable of acting as stepper motor controller to supply the direction and pulse control signals to an external stepper motor driver 10 2 Nano 10 As Stepper Motor Controller When configured as a Stepper Motor Controller the PLC would generate the required number of pulses and sets the direction signal according to the defined acceleration and maximum pulsing rate specified by STEPSPEED and STEPMOVE commands The pulse and direction outputs are not meant to be connected directly to the stepper motor Instead you will need a stepper motor driver which you can buy from the motor vendor Depending on the power output the number of phases of the stepper motor and whether you need micro stepping the driver can vary in size and cost Most stepper motor drivers have opto isolated inputs which accept a direction signal and stepping pulse signal from the Stepper Motor Controller In this case the F Series PLC is the Stepper Motor Controller which will supply the required pulse and direction select signals to the driver Note that the digital output 1 automat
101. d Client Connection The Nano 10 PLC supports both the FServer and the industry standard MODBUS TCP server simultaneously This means that all Nano 10 PLCs are ready to interface directly with many third party industrial control devices that support the MODBUS TCP protocol These include the SCADA software HMI hardware OPC Server HVAC controllers and many other industrial control devices In addition the Nano 10 PLC can be used both as a MODBUS TCP SERVER as well as a MODBUS TCP CLIENT simultaneously This means that the Nano 10 PLC can readily read data from any device that has a MODBUS TCP server such as flow meters AC DC drives HVAC elements RTUs network sensors etc It is also possible to perform peer to peer networking with other MODBUS TCP controllers e g another Nano 10 or F Series PLC over a LAN or over the Internet 2 4 1 Connecting To The PLC s MODBUS TCP Server By default the Nano 10 CPU supports up to 3 simultaneous MODBUS TCP connections You can change the number of simultaneous MODBUS TCP connections from 2 to 5 using the Ethernet Basic Configuration Tool program as described in Section 2 1 The PLC will listen on the default well known MODBUS TCP port 502 for one or all of the connections However it is also possible to define a secondary port number using the Nano 10 Ethernet Configuration program as described in Section 2 1 7 Note that if you define a secondary port number then only one of the MODBUS TCP c
102. d Pulse Measurement 2 of the 4 digital outputs can also be configured as PWM or stepper motor controller pulse outputs If these are not used as special I Os then they can be used as ordinary ON OFF type I O in the ladder diagram The High Speed Counters and Pulse measurement inputs share physical inputs but they can be used simultaneously as HSC and PMON unlike M Series Note that if any other two special functions share the same I O then only one of them can be active at any one time The location of these special I Os are tabulated as follows eae Inputs High Speed Counter Pulse Measurement Geess Ch 1 Phase A a 1 Ch 1 2 Ch 1 Phase B Ch 2 Ch 2 Ch 2 Phase A Ch 3 Ch 3 Ch 2 Phase B Ch 4 Ch 4 Note While inputs 1 4 can be used simultaneously as High Speed Counters and Pulse Measurement pins any pins defined as interrupts can only be interrupts Special Outputs Output Stepper Pulse Dir outputs PWM output Ch 1 Direction These special I Os therefore share the same electrical specifications as the ON OFF type I Os which have already been described in the Chapter 1 Installation Guide We will describe each of these special I Os in greater details in the following chapters User s Manual Page 6 1 Chapter 7 High Speed Counters Chapter 7 High Speed Counters User s Manual Chapter 7 High Speed Counters 7 HIGHSPEED COUNTERS Technical Specifications No of Channels Maximum acceptable pu
103. d against defects in materials or workmanship for a period of one year from the date of registered purchase Any unit that is found to be defective will at the discretion of TRI be repaired or replaced 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 must NOT be used in applications where failure of the product could lead to physical harm 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 carry the full original manufacturers warranty Such products include but are not limited to power supplies sensors I O modules 5 TRireserves the right to alter any feature or specification at any time Notes to Buyer If you disagree with any of the above terms or conditions you should promptly return the unit to the manufacturer or distributor within 30 days from date of purchase for a full refund User s Manual Page iii USER S MANUAL TABLE OF CONTENTS Page 1 INSTALLATION GUIDE FOR NANO 10 PLC 1 1 1 1 OVervIew eege EES 1 1 1 2 Physical Mounting amp Wiring ssrennnnnnvnnnnnnnnvnnnnnnnvnnnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnennnnnnen 1
104. d response frames for all the Nano 10 host link commands which is identical to that implemented on the F series PLCs Only the formats for the point to point communication protocol are presented but all these commands are available to the multi point protocol as well To use a command for multi point system simply add the device ID nn before the command header and the FCS at the end of the data See Chapter 3 for detailed descriptions of multi point communication command format 16 1 Device ID Read Command Format EES E Response Format R 16 16 Device ID 00 to FF The device ID is to be used for the multi point communication protocol so that the host computer can selectively communicate with any controller connected to a common RS485 bus see Chapter 3 for details The ID has no effect for point to point communication The device ID is stored in the PLC s non volatile memory and therefore will remain with the controller until it is next changed 16 2 Device ID Write Command Format bi A ALA RA DI eee oe New Device ID 00 to FF Response Format FILTERE E g To set the PLC s ID to OA send command string IWOA to PLC 16 3 Read Digital Input Channels Command Format HR Je 8 bit Channel Hex User s Manual Page 16 1 Chapter 16 Host Link Command Response Format Response Format RJifiejej EH oe 8 bit Data Hex 16 3 1 Definition of Input Channels The following table show
105. dress by going to the Administrator page of your router and pull up information on the WAN E g The DNS server address you can see from the following screen is 64 59 144 92 User s Manual Page 2 4 Chapter 3 I O and Internal Relays Programming Connection Type DHCP Client QoS Engine Active Cable Status Connected Network Status Established Connection Up Time 4 Day 16 Hour 58 Min 51 Sec MAC Address 00 0F B0 01 0D 1D IP Address 24 81 71 204 Subnet Mask 255 255 252 0 Default Gateway 24 81 68 1 Primary DNS Server 64 59 144 92 Secondary DNS Server 64 59 144 93 Figure 2 1 4 2 1 5 No of Connections FServer Modbus TCP The Nano 10 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 server is assigned a maximum of 3 connections each However to improve flexibility you can re assign the mix of maximum connections between the two servers as long as the number of Modbus TCP connections does not exceed 5 and the number 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 2 1 6 FServer Port No The Port number is a 16 bit integer range 0 to 65535 that needs to be specified on top of the IP address w
106. due to its simplicity and built in error checking capability User s Manual Page 15 5 Chapter 15 Host Link Communication Protocol 15 5 RS485 Primer 15 5 1 RS485 Network Interface Hardware The built in RS 485 interface allows the Nano 10 PLC to be networked together using very low cost twisted pair cables Since the Nano 10 PLCs are fitted with a 1 8 power RS485 driver such as the 75HVD3082 up to 256 devices can be connected together The twisted pair cable goes from node to node in a daisy chain fashion and should be terminated by a 120 ohm resistor as shown below o 5V Terminating resistor F series T100MD RS 485 or RS485 RS485 Nano 10 PLC Figure 15 2 Note that the two wires are not interchangeable so they must be wired the same way to each controller The maximum wire length should not be more than 1200 meters 4000 feet RS 485 uses balanced or differential drivers and receivers which means that the logic state of the transmitted signal depends on the differential voltage between the two wires and not on the voltage with respect to a common ground As there will be times when no transmitters are active which leaves the wires in floating state it is good practice to ensure that the RS 485 receivers will indicate to the CPUs that there is no data to receive In order to do this we should hold the twisted pair in the logic 1 state by applying a differential bias to the lines using a pair of 560Q t
107. e 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 sequencer s contact will turn ON until the next increment of the sequencer This contact can be used to indicate that a program has completed one cycle and is ready for a new cycle Accessing individual steps of the sequencer is extremely simple when programming with 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 User s Manual Page 4 5 Chapter 4 Timers Counters amp Sequencers XE 1 0 Labels al Special Bits vib Label Name SegNx Normally ON 1st Scan 0 015 Clock 0 02s Clock 0 05s Clock 0 15 Clock 0 25 Clock 0 55 Clock 1 05 Clock 1 min Clock RTC Error The Special Bits table is located after the Counters table and before the Inputs table Click on the SegN 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 step number for this sequencer Each step of the sequencer can be programmed as a contact on the ladder diagram as SeqN X where N Sequencers 1 to 8 and X Steps 0 31 e g Seq2 4 Step 4 of Sequencer
108. e Nano 10 server and store them somewhere on your computer To do this you will need to open up the folder on your computer that you want to store the files in Then you can drag the files from the Nano 10 server via FileZilla into your destination folder It is best to make a copy of these files as a backup on your computer so that you have the original copies available in case you need them Now you can make any necessary changes to the 0 HTM file and or 2 HTM file this is explained further in section 2 10 but the N JS file shouldn t be changed unless you are very experienced with JavaScript File Names Note that the filenames are important and the N JS file should not be renamed or it will not work The 0 HTM file and 2 HTM can be renamed with or without the HTM extension but there are limitations There is a very simple pre configured file system in the Nano 10 web server that is implemented as follows Files can have the name 0 through 9 one digit or A through M one character Files can have any extension HTM is used for the pre loaded files There is 2Kb of reserved space for each File 0 through 9 and A through M e If the HTML file is more than 2kb then more than one file space will be used User s Manual Page 2 30 Chapter 3 I O and Internal Relays Programming e Ifa file takes up multiple 2kb locations and another file is added within one of the used locations
109. e RTC variable s reach the set value Example Set up a 1 minute clock pulse to monitor the RTC as follows Clk 1min CheckClock dCusF E Custom Function 1 CheckClock ae turn on LAMP at 6pm every day except Sunday IF TIME 1 18 AND TIME 2 gt 0 AND DATE 4 lt gt 7 THEN SETIO LAMP ENDIF turn OFF LAMP off at 11 30pm every day IF TIME 1 23 AND TIME 2 gt 30 THEN CLRIO LAMP ENDIF Figure 12 3 Using Real Time Clock Example 12 7 Retrieving RTC Clock values using STATUS 18 For Nano 10 PLC with firmware version r72 and above you can read the hour minute and second of the Nano 10 RTC in a single STATUS 18 function The RTC hours minutes and second values are returned as a single integer in the following format hhmmss This could be faster and more convenient to use than to perform 3 comparison statements using TIME 1 TIME 2 and TIME 3 However please note that this function is not available on the M series PLC or F series PLC with older firmware version and it is currently not supported by the i TRILOGI version 6 30 simulator You will need to transfer your program to the PLC in order to test it User s Manual Page 12 3 Chapter 12 Real Time Clock Example Time STATUS 18 0 0 0 0 0 1 5 105 10 5 3 100503 23 59 59 235959 You can therefore easily test the value of the RTC using a single command E g IF STATUS 18 gt 100000 After 10 am in the mo
110. e characters from the serial buffer queue so these data are still visible to the user s program As long as the user program retrieves the data before the 256 byte buffer is filled up no data will be lost If more than 256 bytes have been stored the buffer wraps around and the oldest data is overwritten first and so on The following describes how INCOMM and INPUT PRINT and OUTCOMM functions interact with the serial buffer a INCOMM n Every execution of the INCOMM n function removes one character from the circular buffer When no more data is available in the buffer this function returns a 1 The data removed by INCOMM will no longer be available for the INPUT 1 command b INPUT n When the INPUT 1 function is executed the CPU checks the COMM1 buffer to see if there is a byte with the value 13 the ASCII CR character which acts as a terminator for the string If a string is present all the characters that make up the string will be removed from the COMM1 buffer If a completed string is not present then the COMM1 buffer will not be affected and INPUT 1 returns an empty string This ensures that before a complete string is received the serial characters will not be lost because of the unsuccessful execution of the INPUT 1 function c INPUT n in Blocking Mode INPUT n is designed to be non blocking and to return immediately i e either it returns a complete string or it returns an empty string This means that
111. e data for these registers are in integer format DATI DAT 1 may contain four digits e g 1998 2003 etc 4 1 for Monday 2 for Tuesday 7 for Sunday Gi bi 12 3 RTC Error Status On Ladder Logic There is a special bit available in TRILOGI that allows you to notify the PLC program if the RTC Error event occurs and the RTC Error status light is turned on The RTC Error event occurs if the RTC is corrupted or damaged see section 12 8 for more detail or if the battery is not installed The special bit is called RTC Err and can be obtained from the Special Bits I O Table The RTC Err contact can be used to activate an alarm of some kind The following ladder logic circuit is an example of this using the RTC Err bit as an input that controls an output called RTC_Alarm User s Manual Page 12 1 Chapter 12 Real Time Clock RTC Err RTC_Alarm OUT In the circuit above RTC Err is a special bit that cannot be renamed in your program The output RTC_Alarm is a user defined output that could be named to anything If the RTC Error event occurs for any reason the RTC Err bit would activate the RTC_Alarm output 12 4 Setting the RTC Using TRILOGI Software The RTC date and time can be easily set within TRILOGI by selecting Set PLC s Real Time Clock from the Controller menu A window will pop up with default values entered as shown below in Figure 12 1 All of these values can be edited and then writte
112. e to specify the filename of the web page you want to access This is what the default web pages will look like when they are loaded into your browser User s Manual Page 2 32 Chapter 3 I O and Internal Relays Programming 0 HTM 2 HTM Continuous Update E Continuous Update Refresh Gycle t Los Angeles 18 28 58 New York 21 28 58 London 2 28 58 Tokyo 9 28 58 55 C Zone 1 Temp C Zone 2 Temp Los Angeles 18 45 22 New York 21 45 23 London 2 45 23 Tokyo 9 45 24 2010 Triangle Research Intl inc All rights Rserved Fi ri 21 1 2010 Ke Research inti inc All rights Rserved Ste Figure 2 10 2 2 10 2 Control and Monitoring Components in the Default HTML Files The 0 HTM and 2 HTM files both include the same components but they are arranged and configured differently with a different background image set Both files have the following components available Background Image which can be defined in the HTML file LCD Display which will display whatever the PLC program is displaying on an LCD screen 8 internal relay bits as buttons with configurable label names 4 Data Memory variables DM 1 DM 4 with configurable label names Continuous Update checkbox with cycle count and refresh button Background Image In the 0 HTM file the background image is set to the blue border picture and all the other components are positioned inside the blue border The background image should be a JPEG file l
113. earn the actual command response format User s Manual Page 14 10 Chapter 14 Serial Communications 14 6 4 Application Example Interfacing to SCADA Software SCADA software or MMI systems also known as LCD Touch Panels normally use an object oriented programming method Graphical objects such as switches indicator lights or meters etc are picked from the library and then assigned to a certain I O or internal data address of the PLC When designing a SCADA system first you need to define the PLC type You can choose the MODBUS ASCII MODBUS RTU or OMRON C20H Once a graphical object has been created you will need to edit its connection and at this point you will be presented with a selection table that corresponds to the memory map of that PLC type Example 1 To connect an indicator lamp to Input 9 of the PLC You will need to program the switch to connect to IR00 8 for the OMRON protocol However If you have defined the PLC as MODBUS type then this indicator lamp should be connected to bit address 1 0265 In either case there is no need to learn about the actual command format of the protocol itself as the SCADA software will automatically generate the required commands to access the input address that has been chosen for the object Example 2 To display readings from ADC 2 as a bar graph on SCADA Since the data from ADC 2 is not directly mapped to MODBUS or OMRON in Table 14 1 you need to add a statement in the custom funct
114. ed access to the PLC via FServer you can elect not to use the username password With the No option selected the TRILOGI client or Java Applet can log in to the FServer using whatever username and password since FServer will bypass the username and password authentication and allow the client to log in 2 1 12 Access Level You can define the access level that the TRiLOGI client is permitted to operate on the PLC Three access levels are currently defined 1 for Programmer 2 for User and 3 for Guest Choose 1 Programmer if you wish to be able to program the PLC Please see the i TRILOGI Programmer s Reference manual for the definition of the access levels 2 1 13 Advanced Configuration The Advanced Configuration button lets you configure other more advanced beyond the basic Ethernet configuration but less often used features of the PLC This includes definition of the Trusted IP addresses see Section 2 5 2 as well as calibrations of the PLCs Analog I Os and RTC see Section 5 5 2 1 14 Standalone Version of Ethernet Configuration Software The standalone version of the Ethernet Configuration software which was previously the only option for configuring the Ethernet port and advanced settings on the F series PLCs can also be used to configure the Nano 10 PLC s Ethernet port You can download the software from our website at the following URL http www tri plc com download FserverConfig index htm User s Manual P
115. ed 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 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 is not used by any other devices on your network Note that majority 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 1 2 to 192 168 99 Usually the router itself would have the IP address 192 168 1 1 so that address is 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 1 2 GateWay IP Addr The Gateway IP address lets the Nano 10 PLC communicate with other LAN segments or connect to the Internet 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 Internet 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
116. ence The purpose is to be able to easily customize the web page layout for your specific application without having to worry about the control and monitoring portion which is already programmed More information can be found on this in section 2 10 Accessing and Customizing the HTML Web Interface for Control and Monitoring The purpose of this section is to learn how to install the Filezilla FTP transfer program and how to use it to transfer the required files 2 9 1 Installing the FileZilla program Once you have gone to the web page from the above link you will need to select the client version to download Then you need to select the software version for your computers platform typically the Windows version and download it to your computer This is the installation setup file which you will need to execute after it has downloaded Please perform a default installation by following the installation steps 2 9 2 Configuring FileZilla to Communicate with the Nano 10 After installing the FileZilla client please open it from the start menu or desktop icon and then go to the File menu and select Site Manager The following menu will then pop up Site Manager select Entry Under the default General tab you will TEE General Advanced Transfer settings Charset need to enter the Host IP address and Host 192 168 1 5 Port configure the Logontype Servertype FIP File Transfer Protocol
117. ent any desired output 3 3 5 Example 3 Test the Status of an Output This can be done using both the TESTBIT v n and TESTIO abelname command Using TESTBIT v n X TESTBIT INPUT 2 1 status of input 10 on 1 off 0 is stored in variable X Using TESTIO abelname X TESIO button status of input button defined in the I O table is stored in variable X User s Manual Page 3 5 Chapter 4 Timers Counters amp Sequencers Chapter 4 Timers Counters amp Sequencers User s Manual Chapter 4 Timers Counters amp Sequencers 4 TIMERS COUNTERS AND SEQUENCERS 4 1 Introduction The Nano 10 PLC supports 64 timers with 0 1s or 0 01s time base and 64 counters with range of 0 to 9999 You can define timer 1 to n to become high speed timers with 0 01s time base by executing the HSTIMER n command i e High Speed Timer always start from timer 1 up to timer n 4 1 1 Timer Coils A timer is a special kind of relay that when its coil is energized must wait for a fixed length of time before closing its contact The waiting time is dependent on the Set Value SV of the timer Once the delay time is up the timer s N O contacts will be closed for as long as its coil remains energized When the coil is de energized i e turned OFF all the timer s N O contacts will be opened immediately However if the coil is de energized before the delay time is up the timer will be reset and its contact w
118. er and you can run all the commands under the Controller menu including transferring your new program to the PLC or setting the PLC s Real Time Clock etc For more details on using these commands please refer to i TRILOGI Programmer s Reference Likewise to transfer your new program to the PLC you can click on the Controller menu and select Program Transfer to PLC or press the lt Ctrl T gt keys If i TRiLOGI is already connected to the FServer the program transfer will begin immediately after you ve confirmed your action Otherwise the same Login to TLServer screen as shown on Figure 2 2 1 will appear for you to complete the login sequence Note 1 Unlike the TLServer software that runs on the PC which allows unlimited connection time the FServer on the Nano 10 PLC will disconnect the client if there is no activity for more than 10 minutes The older version of the i TRILOGI program may not detect that the connection has been closed and it may instead think that the PLC is not present When this happens you should click on Controller menu and select Disconnect to properly shut down the connection that has already been reset by the PLC 2 If you are unable to connect to the PLC then check that both the PLC and the PC running your i TRILOGI software are connected to the same local area network LAN and are on the same subnet Generally for a subnet mask of 255 255 255 0 if the PC s IP address i
119. er program and that will have an adverse impact on the CPU performance 9 3 Power Failure Interrupt PFI The Nano 10 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 perform such critical function such as saving critical data to the PLC s non volatile memory see Section 1 6 2 just before power failure The syntax for the PFI is as follow INTRDEF 17 cfnum I Interrupt 17 is reserved for PFI cfnum custom function number to execute when PTI event takes place E g INTRDEF 17 256 1 call function 256 when power failure occur User s Manual Page 9 3 Chapter 10 Stepper Motor Control Chapter 10 Stepper Motor Control User s Manual Chapter 10 Stepper Motor Control 10 STEPPER MOTOR CONTROL 10 1 Technical Specifications No of Channels control signal Max Pulse Rate pps 10000 4A 24V DC S O Continuous Current per phase 4A 24V DC Peak Current per phase 8A 24V DC Driver Breakdown Voltage Velocity Profile Trapezoidal Defined by STEPSPEED accelerate from 1 8 max pps to max pps decelerate from max pps to 1 8 max pps Maximum number of steps 2 2 2 1x10 TBASIC commands STEPSPEED STEPMOVEABS STEPCOUNTABS STEPMOVE STEPSTOP STEPCOUNT It is essential to understand the difference between a stepper motor Controller and a stepper motor Driver A stepper motor Driver
120. er server and use the returned data to update the PLC s real time clock A better standalone program TimeServer PC6 can also be found in the Nano10Samples zip folder This program not only updates the time but also updates the calendar and computes the time zone and adjust for daylight saving time automatically Note Some NIST time servers have strict policy against abuse so you should avoid sending repeated request within a short period of time otherwise further connections may be denied once you are considered to have violated their connection policy User s Manual Page 2 19 Chapter 3 I O and Internal Relays Programming 2 6 Web Service Accessing PLC s data from MS Excel The FServer provides an extremely useful feature called Web Service You can actually use your web browser to access the Nano 10 PLC internal data by specifying the following URL lt IP Address portno of FServer gt HOSTLINK lt Point to point hostlink command without gt E g Please enter the following URL into your web browser URL address space 192 168 1 5 9080 HOSTLINK IR You will see the following data appear on your browser screen IRO1 IR is one of the many host link commands that allows a host computer to read or write to the PLC s internal data space using ASCII strings This particular command IR is for reading the PLC s ID and in this case the PLC returns 01 by default For more details on the list of host
121. es Response Format Maximum allowable word count per command is 16 01 to 10 Hex User s Manual Page 16 15 Chapter 16 Host Link Command Response Format 16 38 WRITE EEPROM String Data Command Format wfxfsfnfnfn nfafa f fa D EEPROM String Address Hex Response Format w x s D ASCII characters max 40 characters E g To write the string data Hello TRi at EEPROM String address 12 send host link command RXS000CHello Bisi 16 39 Force Set Clear Single I O Bit This new Wbnnnnxx command allows you to change a single I O bit on the PLC You can force set or clear any single input output relay timer or counter bit This has an advantage over other write commands such as WI WO etc that affects the entire group of 8 or 16 bits organized into channels Command Format wfb nfnfn nfxfx D mn I O Bit address Hex Response Format pw O 00 Clear I O bit OFF FF SET I O bit ON I O Type Bit address nnnn Hex Input 1 to 256 0000 to OOFF Output 1 to 256 0100 to 01FF Timer 1 to 256 0200 to 02FF Counter 1 to 256 0300 to 03FF Relay 1 to 256 0400 to 04FF Relay 257 to 512 0500 to OSFF E g To force output 1 to ON send Wb0100FF To turn it OFF send wb010000 User s Manual Page 16 16 Chapter 16 Host Link Command Response Format 16 40 Using
122. fault baud rate and communication format of 38 400 8 n 1 This differs from the T100M PLC User s Manual Page 1 10 Chapter 1 Installation Guide 1 8 Real Time Clock The Nano 10 PLC has a built in Real Time clock RTC that keeps track of the time and date and can be used to trigger time based events readily However on the standard Nano 10 there is no battery backup of the RTC This means that when the Nano 10 is powered up the real time clock is set to the factory default date of 2000 1 1 and time at 0 00 00 On the other hand if you have connected the Nano 10 PLC to the LAN you can program the PLC to automatically access a time server on the Internet or on the local LAN upon power up This means that the PLC is able to synchronize its time accurately to that of the atomic clock source that the Internet Time Server s are often based on This technique is described in Section 2 5 FRAM RTC As its name implies the FRAM RTC module adds a lithium battery backed Real Time Clock module to the Nano 10 PLC The Nano 10 CPU automatically detects the presence of the FRAM RTC module and will set its built in RTC using the battery backed RTC data in the FRAM RTC module The FRAM RTC therefore is useful to applications that are not connected to the LAN or the Internet to set the RTC but requires non volatile RTC to control time based events When the FRAMRTC is present the Nano 10 PLC also tries to take advantage of the FRAMRTC s more accu
123. fill in the correct Gateway IP Address Ask your system administrator if you have any question about this 2 1 3 SMTP Server IP Address The SMTP Simple Mail Transport Protocol Server field lets you define the IP address of the email server that the PLC can use to send out emails from user s program please see section 2 4 2 for more details on how to program the PLC to send emails This is the same SMTP server that your normal email client software such as Thunderbird or MS Outlook uses to send out email You can ask your Internet Service Provider ISP for the IP address of their SMTP server The ISP usually provides the SMTP server in domain name form such as mail sbcglobal net but you should also be able to request the numerical IP address of the SMTP server from the ISP User s Manual Page 2 3 Chapter 3 I O and Internal Relays Programming 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 sbcglobal net is resolved to the IP address 207 115 36 120 N gt nslooku mail sbcglobal net erver pd2nsc3 st vc shawcable net ddress PEA 59 14 on authoritati ame mail 67 92 sw ba ddress 2 1 4 a 1 3 ive n e sbcglo Le 115 36 12 C N gt Figure 2 1 3 Windows users may also search the Inter
124. function accepts host link commands in multi point format and automatically computes the Frame Check Sequence FCS characters appends them to the command string and sends out the whole command string together with the terminators The function then waits for a response string and checks the integrity of the received response string for errors This function returns a string only if a proper response string has been received Please refer to the TBASIC Reference for a detailed explanation of this command The NETCMD function therefore greatly simplifies the programming tasks for handling networking between PLCs The programmer only needs to construct the correct command string according to the formats described in this chapter pass the formatted string to the NETCMDS function and then check for the response string A Nano 10 PLC may use the NETCMD to map the I O of another PLC into its internal relays and use the other PLC as its remote I O There are some programming examples in the Nanol0Samples zip file that you can download from http www tri plc com trilogi Nano10Samples zip that illustrates the use of NETCMD to map I Os of a slave PLC to the master Please study the two examples RemoteIO Hseries PC6 and RemoteIO Mseries PC6 carefully to understand the mechanism of mapping I Os between the PLCs The TRILOGI program REMOTE Hseries PC6 will work on the H series M series F series or another Nano 10 PLCs as
125. g the PRINT 4 command The following subsections describe the various Network Service commands available to the Nano 10 PLC 2 3 1 Get Our Local IP Address 2 3 2 Format lt IP gt Response Xxx xxx xxx xxx nnnn IP address port of FServer Example PRINT 4 lt IP gt ETLCD 1 1 Our IP INPUTS 4 Wei Note This IP address is returned instantly so there is no need to wait for INPUT 4 There is also no need for the closing tag lt gt DNS command Resolving Domain Name into IP Address In order to use this command successfully you must first correctly define the DNS Server IP address mentioned in Section 2 1 4 Format lt DNS domain name gt Response XXX XXX XXX XXX IP address string returned by DNS server ERR 07 DNS Unresolved Either DNS server not properly defined or the domain name does not exist Response xXX XXX XXX XXX IP address string returned by domain name server STATUS 3 This function returns 1 on success and 0 on failure Example PRINT 4 lt DNS tri ple com gt FOR I 1 to 10000 AS INPUTS 4 User s Manual Page 2 10 Chapter 3 I O and Internal Relays Programming IF LEN AS lt gt 0 SETLCD 1 1 IP A RETURN E NEXT Notes a There is no need for the closing tag lt gt to end this command b If your DNS server has been correctly defined the above program should return the IP address as a string such as 1
126. g the same or different protocols independent of the other The most wonderful feature of Nano 10 PLCs is that the support of all the above mentioned protocols can be fully automatic and totally transparent to the users There is no DIPswitch to set and no special configuration software to run to configure the port for a specific communication protocol The following describes how the automatic protocol recognition scheme works 1 When the PLC is powered ON the COMM1 port is set to the AUTO mode which means that they are open minded and listen to all serial data coming through the COMM ports The CPU tries to determine if the serial data conforms to a certain protocol and if so the COMM mode is determined automatically 2 Once the protocol is recognized the CPU sets that COMM port to a specific COMM mode which enables it to process and respond only to commands that conform to that protocol Error detection data such as the FCS LRC or CRC are computed accordingly which method is used to verify the integrity of the received commands If errors are detected in the command the CPU responds in accordance with the action specified in the respective protocols 3 When the COMM port enters a specific COMM mode it will regard commands of other protocol as errors and will not accept them Hence for example if COMM 1 has received a valid MODBUS RTU command which puts it in an RTU mode it will no longer respond to TRILOGI s
127. gits iii 13 2 User s Manual Page vii USER S MANUAL 13 4 Displaying Decimal PoOint srrrnnnnnvnnnnnnnvnnnnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 13 3 14 SERIAL COMMUNICATIONS 14 1 14 1 Introduction escher eege Eege E deeg ee 14 1 142 COMMI1 Two wire RS485 POrt rmnsrnnnnnnnnnnvnnnnnnnnnnnnnnnvnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnennnnnnnnnnnnennnnnnnn 14 1 14 2 1 PROGRAMMING AND MONITORING ssssesessseseseessssssssssssrresrrnsrnrsnnnrrnnetnnsnnnrnnnennnnt 14 1 14 2 2 Accessing 27 Party RS485 based Devices sccesssssesssssesesessssnesessessessesseesessessenees 14 2 14 2 3 Interfacing Other Devices to Modbus TCP Host or to the Internet 14 2 14 2 4 Distributed Controhsw aio aero a ala 14 2 14 3 Changing Baud Rate and Communication Formats Use of the SETBAUD Statement 14 2 14 4 Support of Multiple Communication ProtoColS rrrsvvrrnnnnvnvennnnnnvennnnnnnvennnnnnvennnnnnnennnnnnenr 14 4 14 5 Accessing the COMM Port from within TBASIC rssrnnannvnnnnvvnnnnvnnnnnvnnnnnnnnnnvnnnnnnnnnnnnnnnvennn 14 5 14 6 Using The PLC Asa Modbus Omron Slave SCADA HMI Applications 14 7 14 6 1 MODBUS ASCII Protocol Support i 14 7 14 6 1 1 BIT ADDRESS MAPPING lti aerea ge eet tie 14 9 14 6 1 2 WORD ADDRESS MAPPING nideien eaaa ea ea eataa aai uia at eiia ai aSa 14 9 14 6 2 MODBUS RTU Protocol Support 14 10 14 6
128. h the Nano 10 PLC does not have built in LCD port you will still be able to view the virtual LCD display on the Online Monitoring View Variable screen that displays the cause of the runtime error and the function where it occurred The TBASIC simulator captures many possible run time errors including out of range values but in the Nano 10 only a few most important run time errors are reported The remaining errors are ignored The following are the few run time errors that will be reported in the Nano 10 PLC User s Manual Page 1 11 Chapter 1 Installation Guide Divide By Zero FOR NEXT loop with STEP 0 Gall Stack Overflow Circular CALL suspected Illegal Opcode Please inform manufacturer System Variable Index out of range This is normally caused by using an unavailable subscript E g DM 0 INPUT 1 DM 5000 etc Check the subscript value especially if it contains a variable e g DM X if X 0 this will lead to a runtime error All run time errors should be identified and corrected before you proceed any further ARON User s Manual Page 1 12 Chpater 2 Ethernet Port Chapter 2 Ethernet Port User s Manual Chapter 3 I O and Internal Relays Programming 2 ETHERNET PORT Ethernet RJ45 port Incredibly every Nano 10 PLC has a single built in 10 100 Base T Ethernet port that does everything that its bigger brother the F series PLCs are designed to do You can easily connect the Nano 10 PLC
129. hapter 14 Serial Communications Please refer to the TBASIC Programmer s Reference manual for a detailed description of the SETPROTOCOL command Note If you fix a COMM port to a non native non auto mode TRILOGI will not be able to communicate with the PLC anymore You may have to power cycle the PLC to reset the COMM mode If you use the 1st Scan contact to activate the SETPROTOCOL command then you will need to cycle the power to the PLC with Jumper J4 shorted to halt the execution of the SETPROTOCOL command Also remember that when the PLC is reset this way its COMM1 will power up at default format of 38 400 8 n 1 only so you will need to configure TLServer s serial port to 38 400bps to communicate with it 14 5 Accessing the COMM Port from within TBASIC Besides responding automatically to specific communication protocols described in section 14 5 the COMM 1 is fully accessible by the user program using the TBASIC commands INPUT INCOMM PRINT and OUTCOMM It is necessary to understand how these commands interact with the operating system as follow When a COMM port receives serial data the operating system of the Nano 10 automatically stores them into a 256 bytes circular buffer so that user programs can retrieve them later The serial data are buffered even if they are incoming commands of one of the supported protocols described in section 14 5 In addition processing of a recognized protocol command does not remove th
130. he LCD screen LCDXY 22 52 starting x y location of LCD panel All you need to do is change the numbers in the square brackets The x location is 22 by default and the y location is 52 by default both relative to the top left corner of the browser display area Relocating the Internal Relay Bit Buttons Each of the eight buttons 4 input buttons and 4 output buttons can be moved individually by editing the following code IOLocX IOLocY 24 120 24 120 24 120 24 120 142 142 164 164 267 267 290 290 The values in the square brackets for IOLocX are the x coordinates and the values in the square brackets for IOLocY are the y coordinates for each button The button for Output1 is the first value and the next value is for Output2 etc Relocating the Data Memory Labels and Fields The labels and fields are grouped together for each of the four data memory locations used so each label and field group will move as one item Here is the code to change the coordinates for the starting location of the data memory items DMLocX DMLocY 24 24 24 24 I 185 205 225 245 The values in the square brackets for DMLocX are the x coordinates for each data memory item The label and field for DM 1 is the first value and the next value is for DM 2 etc Note that the default x coordinates are all the same so they are in line vertically but they each have different y coordinates The values in the square bra
131. he current step number Every step of the sequence must be accessible and can be used to trigger some action such as turning on a 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 o Action Wait for Start signal Forward arm at point A Close gripper Retract arm at point A Move arm to point B Forward arm at point B Open gripper Retract arm at point B Move arm to point A CO N OT AIIN User s Manual Page 4 1 Chapter 4 Timers Counters amp Sequencers 4 2 Programming timers and counters on Ladder Logic The timers and counters can be programmed in ladder logic in a few simple steps 4 2 1 For Timers Create Edit the label names Place the input contact s into the ladder logic circuit Place the timer coil at the end of the ladder logic circuit Place the timer contact in one or more ladder logic circuits pon 4 2 2 For Counters Create Edit the label names Place the input contact s into the ladder logic circuit Place the counter coil at the end of the ladder logic circuit Place the counter contact in one or more ladder logic circuits optional pon 4 2 3 Example 1 Creating a Simple Timer Circuit in Ladder Logic You can place components in the circuit by clicking in the green area to the right of the red arro
132. he multi drop network backbone and connect the shield to the OV DC ground power terminal of every PLC The grounded shield then provides a common ground reference for all the different PLCs power supplies Even though the RS485 network may still work without a common ground reference because the signal wire pair will somehow pull all the RS485 devices to some reference point Failure to provide a common ground is a potential source of serious trouble as signal wires with a floating ground easily induce large voltage differences between nodes when subjected to electromagnetic interference Hence for reliable operation it is important to provide the common ground A grounded shield also has the additional advantage of shielding the electrical signals from EMI 15 5 3 Single Master RS485 Networking Fundamentals RS485 is a half duplex network i e the same two wires are used for both transmission of the command and reception of the response Of course at any one time only one transmitter may be active The Nano 10 PLC implements a master slave network protocol The network requires a master controller which is typically a PC equipped with an RS485 interface In the case of a PC you can purchase an RS 485 adapter or an RS232C to RS485 converter and connect it to the RS232C serial port Any F series M series or even the Nano 10 PLC can be programmed to act as the master it can communicate with other User s Manual Page 15 7 Cha
133. hen accessing the FServer from across the network The default value is 9080 which is the same default value used by the TLServer and TRILOGI client software Please see the 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 Nano 10 or F series PLCs may be accessible from the Internet using the same public IP address of the router but with different port numbers 2 1 7 Modbus TCP Secondary Port No 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 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 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 Nano 10 or F series PLCs
134. his PC via direct Ethernet connection will not be accessible by any other devices on the same LAN and the PLC will not be able to open network connection to any other devices beyond the PC that it is connect to this way Sometimes the PC that is connected directly to the PLC via Direct Ethernet Connection may lose its Internet connection via Wi Fi This is because the O S thinks that the direct Ethernet connection to the PLC is a real network connection and attempt to route TCP IP packets through it That will result in a connection failure If this occurs and you need to access the Internet then please temporarily remove the Ethernet cable from the PLC and the PC should then be able to access the Internet again User s Manual Page 2 27 Chapter 3 I O and Internal Relays Programming 2 9 Installing a Web Page or Web Applet into the Nano 10 PLC using FileZilla With the Nano 10 PLC it is possible to transfer a custom web page to the Nano 10 s built in web server using the Filezilla FTP transfer program which is available for free download at the following link http filezilla project org The Nano 10 PLC comes prepackaged with two ready to use web pages installed in its web server These web pages run on HTML and JavaScript code so they are accessible from standard browsers such as Internet Explorer Firefox and Safari However the HTML files are designed to be easily modified by anyone even if you don t have any programming experi
135. his function will return the string 0012 Note that for negative numbers the negative sign is counted as part of the digit count so you need to provide enough spaces to take care of the sign if you need to handle both positive and negative numbers User s Manual Page 13 2 Chapter 13 LCD Display Programming 13 4 Displaying Decimal Point Although the Nano 10 PLC does not handle floating point computation it is still possible to perform computations involving fractions by using fixed point notation E g If each unit represents 0 01 then the number 1234 represents the value 12 34 It is quite simple to display a number on the LCD display with a decimal point as follows You first divide the numeric variable by 100 to obtain the integer component i e the portion to the left of the decimal point and use the MODULUS operator to obtain the decimal component i e the portion to the right of the decimal point of the number So to display a number contained in X with two decimal places do the following Elg SETLCD 1 1 Data STRS X 100 STRS X MOD 100 Hence if the number X 12345 then X 100 123 and X MOD 100 45 and the above would display the string Data 123 45 User s Manual Page 13 3 Chapter 14 Serial Communications Chapter 14 Serial Communications User s Manual Chapter 14 Serial Communications 14 SERIAL COMMUNICATIONS 14 1 Introduction There is only a single RS485 ser
136. ial port on the Nano 10 PLC This serial port supports full Modbus ASCII RTU and Host Link Protocol drivers and it can also be programmed to accept or send ASCII or binary data using the TBASIC built in commands such as INPUT n INCOMM n PRINT fn OUTCOMM n d This serial port is designated as COMM1 to the TBASIC and it is a two wire RS485 port that allows multiple PLCs to be connected to a single host computer or a master PLC for networking or to implement a distributed control system 14 2 COMM1 Two wire RS485 Port This half duplex RS485 ports is meant for serial bus type networking or for connecting to optional peripherals such as a serial LCD message display unit e g MDS100 BW external analog modules e g l 7018 touch panel HMI or it can be used for inter communication between PLCs Up to 255 RS232 RS485 peripheral devices may be linked together in an RS485 network on this port The RS485 port signal is carried on a 2 way screw terminal connector please refer to Chapter 1 Installation Guide For successful communication using the RS485 port you need to correctly connect the and terminals to the RS485 equipment using a twisted pair cable If you are using the PC as the network host you will need an USB to RS485 converter such as the U 485 converter The following describes some possible uses of the RS485 ports 14 2 1 PROGRAMMING AND MONITORING The Nano 10 PLC can be programmed via its RS485 port on a one
137. ically becomes the direction select signals for the Stepper controller channels 1 and digital output 2 automatically becomes the pulse signal output when the stepper controller is being used The direction pin is turned ON when the motor moves in the negative direction and turned OFF when the stepper motor moves in the positive direction The STEPMOVEABS command makes it extremely simple to position the motor at an absolute location while the STEPMOVE command lets you implement incremental moves in either direction for each channel User s Manual Page 10 1 Chapter 10 Stepper Motor Control 10 2 1 Interfacing to 5V Stepper Motor Driver Inputs Some stepper motor drivers accept only 5V signals from the stepper motor controller In such a case you need to determine whether the driver s inputs are opto isolated If they are then you can simply connect a 2 2K current limiting resistor in series with the path from the PLC s output to the driver s inputs as shown in Figure 10 1 Stepper Motor Driver i Direction Select Input 24V DC Nano 10 PLC Power Nano PLE Poot OUTPUTS Calculation Ip 10mA R V 5 0 01 e g for V 24V R 24 5 0 01 1 9K Select R 2K2 Rating 197 2200 0 16W Use 0 5W resistor PLC s Power Supply GND Figure 10 1 However if the stepper motor driver input is only 5V CMOS level and non opto isolated then you need to convert the 24V NPN PLC outputs to 5V This can
138. ice For example for controling the percentage opening of a HVAC damper or to rotate the angle of window blinds or to position a solar panel to track the sun light There are many sizes of RC Servo available in the market from those that weigh just a few grams to those for controlling an industrial scale unmanned vehicle e g UAV or unmanned submarine A small self contained RC servo typically cost less than 20 retail price and is incredibly easy to control using the Nano 10 ims fo D Figure 11 3 RC Servo and Control Signal RC Servo typically only have 3 wires Power typically 4 8 to 6V and a Control input To position the RC Servo to a position within its range of travel Some are 0 to 90 degree and there are those that can go from 0 to 180 degree you send a positive pulse with pulse width between 1 00 ms to 2 00 ms to the Control input once every 20ms The servo will position the actuator to one end when it receives a pulse of 1 00ms and the other end when it receive a pulse of 2 00ms If you send it a pulse of 1 50ms it will position the actuator to the center In PWM term 1 00ms pulse width every 20ms means a duty cycle of 1 00 20 00 5 00 2 00ms pulse width every 20ms means a duty cycle of 2 00 20 00 10 00 duty cycle So to control the position of the actuator one only needs to send it a positive PWM signal with frequency 1 0 02 50Hz and duty cycle between 5 and 10 The gear and
139. ill never be closed When the last aborted timer is re energized the delay timing will restart and use the SV of the timer rather than continue from the last aborted timing operation 4 1 2 Counter Coils A counter is also a special kind of relay that has a 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 decrements its count register value by 1 Note that the coil must go through an OFF to ON cycle in order to decrement the counter If the coil remains energized all the time the counter will not decrement Hence a counter is suitable for counting the number of cycles an operation has gone through When the count register hits zero all of the counter s N O contacts will be turned ON These counter contacts will remain ON regardless of whether the counter s coil is energized or not To turn OFF these contacts you have to reset the counter using a special counter reset function RSctr 4 1 3 Sequencers A sequencer is a highly convenient feature for programming machines or processes that operate in fixed sequences These machines operate in a fixed clearly distinguishable step by step order starting from an initial step progressing to the final step and then restarting from the initial step again At any moment there must be a step counter to keep track of t
140. imagesrc http tri plc com nano hmipics panelbluel jpg link to your background image LCDXY 22 52 LCDSIZE 185 21 LCDbgcolor ffffAA LcDTextcolor black starting x y location of LCD panel width heig t of each line of LCD LCD background color in RGB value Can also be set as white for white background LCD text color Ioname Outputl Output2 Output3 Output4 Inputl Input2 Input3 Input4 Ionamecolor black Iowidth 80 Fixed width for 1 0 button Set to 0 for Auto width Ioheight 0 Use Auto height IOLOCX 24 120 24 120 24 120 24 120 IOLOCY 142 142 164 164 267 267 1290 290 ONcolor yellow yellow can also be written in RGB value as ffff00 OFFcolor grey grey can also be written in RGB value as 7f7f7f Font and color for DM labels are defined by lt style gt body at the top of this page DMlabel DM 1 Beard GR 3 DND m i DMlabelBgcolor efff DMwidth 175 DMHeight 20 DMLocX 24 24 24 24 DMLocy 185 205 225 245 Setting the Background Image The first line of code you can edit is bgimagesrc http tri plc com nano hmipics panelbluel jpg This is how you set the background image for your web page All you need to do is replace URL of the JPEG file http tri ple com nano hmipics panelbluel jpg with the URL of your own background graphics file hosted on any web server Changing Label Names The na
141. int Host link protocol format very easily If an unknown command is received or if the command is illegal such as access to an unavailable output or relay channel the following error response will be received 15 3 2 Error Response Format The host computer program should always check the returned response for possibilities of errors in the command and take necessary actions User s Manual Page 15 2 Chapter 15 Host Link Communication Protocol Host Computer The F Series PLC Send Ctrl E 05H and wait for echo Ready to process command return Ctrl E 05H Send Command string to controlle Wait for response Execute command Return Response string to host Accept Response Check for errors Figure 15 1 15 4 MULTI POINT COMMUNICATION SYSTEM In this system one host computer may be connected to either a single PLC via RS485 or multiple PLCs on an RS485 network 15 4 1 Command Response Frame Format Multi point u eee eme Device ID Header Data FCS Terminator Each command frame starts with the character and two byte hexadecimal representation of the controller s ID 00 to FF and ends with a two byte Frame Check Sequence FCS and the terminator FCS is provided for detecting communication errors in the serial bit stream If desired the command frame may omit calculating the FCS simply by putting the characters 00 in place of the FCS Note we call 00 the
142. ion Hence its accuracy is temperature dependent If you require the PLC s RTC to be very accurate you should keep the PLC under a constant operating temperature If your Nano 10 is connected to a LAN then you also have the option of having the RTC periodically set itself using the very accurate RTC data that can be obtained from a time server on the Internet See Section 2 5 User s Manual Page 12 4 Chapter 12 Real Time Clock 12 9 Control of RTC Hardware On Nano 10 PLC with r72 and above firmware you can use the following command to control the RTC hardware SETSYSTEM 253 n hi Stop built in RTC Run built in RTC Disable auto RTC update from FRAMRTC Enable auto RTC update from FRAMRTC y 4 M 4 WWWNro An example program RTCcontrol PC6 is included in the Nano10Samples zip file that you can download from http www tri plc com trilogi Nano10Samples zip 12 10 Troubleshooting the FRAMRTC If the RTC Err bit is ON indicating a bad RTC and the battery is properly installed on the FRAMRTC then the RTC component on the FRAMRTC could be corrupted or damaged This could happen if there was any damage to the components on the board such as I O drivers communications drivers or any of the IC s or PCB circuitry Also if a voltage spike came into the PLC through its I O power supply or communications ports that could cause some corruption even if there was no component damage If the
143. ion of rotation of the quadrature encoder greatly simplifies the programmer s task of handling high speed encoder feedback The HSCDEF statement can be used to define a CusFn to be executed when the HSC reaches a certain pre defined value Within this CusFn you can define the actions to be taken and define the next CusFn to be executed when the HSC reaches another value Please note that the HSDDEF statement will also activate the Pulse Measurement hardware as described in the Pulse Measurement section A programming example of the HSC can be found in your iTRiLOGI program folder C TRiLOGI TL6 usr samples HighSpeedCtr PC6 User s Manual Page 7 1 Chapter 7 High Speed Counters 7 2 Enhanced Quadrature Decoding The default method in which the PLC handles quadrature signals as described above is somewhat simplistic It does not take into consideration the jiggling effect that occurs when the encoder is positioned at the transition edge of a phase Mechanical vibration could cause multiple counts if the rotor shaft jiggles at the transition edge of the phase resulting in multiple triggering of the counter This simplistic implementation however does have the advantage that the HSC can also be used for single phase high speed counting For the Nano 10 PLC an enhanced quadrature decoding routine is provided which will lock out multiple counting by examining the co relationship between the two phases You can configure the Nano 1
144. ion that reads ADC 2 and copies it into a data memory e g DM 100 ADC 2 Now you can program the bar graph on the SCADA screen to be connected to DM 100 if you use the OMRON protocol For the MODBUS protocol the object should be connected to the address 4 1100 User s Manual Page 14 11 Chapter 14 Serial Communications 14 7 Using The PLC As a Modbus Master Getting Data From Power or Flow Meters The Nano 10 PLC support for the MODBUS protocol goes beyond being a MODBUS slave only You can use the TBASIC READMOBUS and WRITEMODBUS commands as well as READMB2 and WRITEMB2 to send out MODBUS ASCII or RTU commands to access any other Nano 10 F series or T100M series PLC or any third party MODBUS slave devices The READMODBUS or READMB2 commands use MODBUS Function 03 this can be changed to function 04 using SETSYSTEM 6 4 command to read from the slave and WRITEMODBUS or WRITEMB2 use MODBUS Function 16 to write to the slave Note that when using the READMODBUS or WRITEMODBUS commands the 40001 address stated in Table 14 1 should be interpreted as address 0000 and 40002 as address 0001 and 41001 as address 1000 etc This is in accordance with the specifications stated in MODBUS protocol MODICON defined zero offset addresses for the MODBUS protocol yet in their holding register definition these are supposed to start from address 40001 hence the unusual correspondence But to maintain compatibility with the MODBUS specificatio
145. ital Inputs 2 Analog 5V Analog RS485 Port 24V NPN Inputs 0 5V Reference Figure 1 1 1 1 Overview The new TRi s Nano 10 is quite possibly the world s most powerful Nano class PLC Although measuring only 2 75 x 3 25 and spots just 10 digital analog I Os it comes with a built in Ethernet port that can be connected directly to a network router switch or hub for access to the LAN or to the Internet The Ethernet port supports the FServer for remote programming or monitoring and a Modbus TCP server for access by third party devices with up to 6 simultaneous connections The user can also easily program the Nano 10 to connect to another PLC peer to peer networking or to Modbus TCP slave devices via the Internet It can email real time data to any email address es or connect to the Internet Time Server to get the most accurate real time information The Ethernet port also supports Web Services allowing enterprise software such as a database program or MS Excel to query for information from multiple PLCs instantaneously This also means that you can even create your own Ajax based web page to monitor control your PLC using an internet User s Manual Page 1 1 Chapter 1 Installation Guide browser on a smart phone such as the Apple s i Phone or just about any PC Mac browser An example template will be provided to demonstrate this ability and you can easily modify the template to create the web
146. label and field items so each item cannot have a different size Changing the Color of Display Data Labels and Buttons It is possible to change the default color of the interactive objects which are the Data Memory labels and fields the Internal Relay Bit buttons and the LCD Display Each of these objects has different configurable color properties which will be explained further Color can be set one of two ways 1 Using the specific name in single quotes Eg Yellow 2 Using a unique code called an RGB value that equates to a color also in single quotes Eg FFFFOO for the color Yellow Here is a link to a website that converts colors to color codes http jdstiles com colorchart html Changing the LCD Display Color The LCD display has a background color and a text color which can be individually configured as per the following code LCDbgColor ffffAA LCD background color in RGB value Can also be set as white for white background LCDTextColor black LCD text color Changing the Internal Relay Bit Buttons Color The eight Input and Output buttons have two background color settings one for an ON status and one for an OFF status and a text color setting that can each be configured Text Color IOnameColor black Background Color ONcolor yellow yellow can also be written in RGB value as f 00 OFFcolor grey grey can also be written in RGB value as 7 7 7
147. ling the RS485 driver receiver direction OUTCOMM This command sends only a single byte out of the serial COMM port without going through the serial out buffer It enables the RS485 transmitter before sending the character and disables it immediately after the last stop bit has been sent out User s Manual Page 14 6 Chapter 14 Serial Communications 14 6 Using The PLC Asa Modbus Omron Slave SCADA HMI Applications The Nano 10 PLC supports a subset of the OMRON C20H and MODBUS Both ASCII and RTU modes are supported compatible communication protocols so that it can be easily linked to third party control software hardware products such as SCADA software LCD touch panels etc The PLC automatically recognizes the type of command format and will generate a proper response These are accomplished without any user intervention and without any need to configure the PLC at all Both MODBUS and Omron protocols use the same device ID address 00 to FF as used by the native Hostlink Command protocol described in Chapter 15 Since the addresses of I O and internal variables in the Nano 10 PLC are organized very differently from the OMRON or Modicon PLCs we need to map these addresses to the corresponding memory areas in the Modbus address space so that they can be easily accessed by their corresponding protocols All I Os timers counters internal relays and data memory DM 1 to DM 4000 are mapped to the Modbus Holding Registe
148. lse rate 10KHz per channel Quadrature signal decoding Relevant TBASIC Commands HSCDEF HSCOFF HSCPV 7 1 Introduction Digital inputs 1 2 3 4 form two channels of high speed counter inputs which can interface directly to a rotary encoder that produces quadrature outputs A quadrature encoder produces two pulse trains at a 90 phase shift from each other as follows Direction of Rotation 90 Ai Phase A Phase B 90 Direction of Rotation Figure 7 1 When the encoder shaft rotates in one direction phase A leads phase B by 90 degrees When the shaft rotates in the opposite direction phase B will lead phase A by 90 degrees The quadrature signals therefore provide an indication of the direction of rotation The F Series PLC handles the quadrature signals as follows if the pulse train arriving at input 1 leads the pulse train at input 2 the High Speed Counter HSC 1 increments on every pulse If the pulse train arriving at input 1 lags the pulse trains at input 2 then the HSC 1 decrements Note that if input 2 is OFF then pulse trains arriving at input 1 are considered to lead the input 2 and HSC 1 will be incremented Likewise if input 1 is OFF then pulse trains arriving at input 2 will decrement HSC 1 Inputs 3 and 4 form the inputs for High Speed Counter channel 2 which operates in the same way as HSC 1 described above The fact that the Nano 10 PLC automatically takes care of the direct
149. me it computes the FCS of the command and compares it with the FCS field received in the command frame If the two do not match then a framing error has occurred The controller will send the following Framing Error Response to the host Device ID Header FCS Terminator 15 4 5 Command Errors If an unknown command is received or if the command is illegal such as an attempt to access an unavailable channel the following error response will be received Error Response Format Device ID Header FCS Terminator The host computer program should always check the returned response for possibilities of errors in the command and take necessary action 15 4 6 SHOULD YOU USE POINT TO POINT OR MULTI POINT PROTOCOL Although at first the point to point protocol appears simpler in format having no ID and no FCS computation the communication procedure is actually more complex since it involves the need to synchronize the two communicating devices by exchanging the Control E character The lack of error checking also makes the protocol less reliable especially in noisy environment In fact the TLServer software will only accept multi point communication protocol from the client software with the exception of the IR command which is needed to obtain the ID of a PLC with unknown ID Hence if you were to write your own communication program to talk to the PLCs we would strongly recommend using only the multi point protocol exclusively
150. mentals The built in Ethernet port of Nano 10 PLC inherently supports multi master peer to peer network connection without any arbitration Therefore if there is a need to perform peer to peer networking it will be much easier to do it via the Ethernet port However if the Nano 10 is not connected to LAN or a low cost local networking solution via RS485 is desired then the following discussion will be relevant Since any F M or Nano PLC is capable of sending out network commands the obvious question is whether multiple masters are allowed on the RS485 network It is possible to have multiple masters on a single RS485 network provided the issues of collision and arbitration are taken care of There are several means to achieve these objectives 15 5 4 1 Multiple Access with Collision Detection There is nothing to stop any PLC from sending out host link commands to other PLCs However if more than one PLC simultaneously enables their transmitters and send out host link commands then the signals will conflict and the messages will be garbled up If the network traffic is low then the solution may be a matter of having the master check for the correct response after sending out a command string If there is error in the response string the master should back off the network for a short while use different timing for different PLCs and then re send the command until a correct response string is obtained Fortunately the NETCMD functio
151. mes of the eight Internal Relay Bit buttons and the four Data Memory labels can be changed to anything or even left blank All you need to do is replace the words in the single quotes with anything from the following lines of code Internal Relay Bit buttons Ioname Output1 Output2 Output3 Output4 Inputl1 Input2 Input3 Input4 Data Memory labels DMlabel DM 1 DM 2 DM 3 DM 4 Relocating Display Data Buttons and Labels It is possible to change the default locations of the interactive objects which are the Data Memory labels and fields the Internal Relay Bit buttons and the LCD Display All of these things have x y coordinates that are defined in the level 1 user modification area The coordinates are relative to the top left of the browser window which would be 0 0 These coordinates can be easily modified but in order to find the right values for your desired location you will need to do some trial and error with different numbers User s Manual Page 2 35 Chapter 3 I O and Internal Relays Programming Relocating the LCD Display Note that the LCD Display content is not configured in the HTML files because it is displaying what is set in the PLC program The display is grouped as a single unit so it is not possible to define separate locations for each display line remember it is a 4 line by 20 character display emulation This is the code to change the coordinates for the starting location of t
152. more than a few PLCs it is important to either strengthen or protect the RS485 interface as described below User s Manual Page 15 6 Chapter 15 Host Link Communication Protocol 1 Youcan replace the standard RS485 driver 75HVD3082 on the PLC with a fault tolerant RS485 driver IC part number LT1785AIN8 This 8 pin IC is made by Linear Technology and can withstand wrong voltages of up to 60V The LT1785AIN8 is a 1 4 power RS485 driver which means up to 128 PLCs can be connected together Unfortunately this IC is much more expensive than 75HVD3082 and hence it is not provided as standard component on the PLC You can purchase the IC from any major electronic catalog company such as www digikey com 2 When using non fault tolerant RS485 drivers such as SN75176 or SN75HVD3082 we strongly recommend the following protection circuit to be added between every PLC s RS485 and the twisted pair multi drop network cable RS485 Network 100 1 2W 0 1A Fuses Ground the Shield Figure 15 3 Note As can be seen from the circuit the two 9V Zener diodes clamp the signal voltage on the PLC s RS485 interface to between 9V and 0 7V If the high voltage persists the 0 1A fuse will blow effectively disconnecting the PLC from the offending voltage on the network Even if you choose to replace the RS485 driver by an LT1785AIN8 IC instead of using the zener fuse pair wiring you should still use shielded twisted pair cables as t
153. n However the PLC continues to scan the I Os and processes host link commands sent to it and will report the current I O data and internal variables to the host computer 16 32 Resume PLC Operation Command Format Response Format 5 When the PLC receives this command it will resume execution of the ladder program if it had been halted previously by the C2 command Otherwise this command has no effect CE 16 33 Read Analog Input This command forces the PLC to refresh the value of its ADC data at the analog channel before returning its value in the response string i e no need for the PLC to execute ADC n function to refresh the analog input User s Manual Page 16 13 Chapter 16 Host Link Command Response Format Command Format Starting Analog Channel count Channel 01 08h 01 to 08h Response Format PR A 16 16 te te 16 16 16 H x_ r _y66_ m__21n2z2lkln rrTrr_ ___ eu Starting channel Ending channel 16 bit Data Hex 16 bit Data Hex E g To read 4 channels of Analog inputs starting from Ch 2 Send RA0204 The response string will contain 4 sets of data for channel 2 3 4 and 5 16 34 Read EEPROM Integer Data Command Format EEPROM starting Word Count Address Hex 01 to 20h Response Format PR xX 1 16 16 te 16 eleng a 1 EEPROM Integer Last EEPROM 16 bit Data Hex 16 bit Data Hex
154. n Setup amp Test 3 0 x Port Name comi Baud Rate 38400 Data Bits 8 D Stop Bits 1 DI Parity None Time Out ms 500 Open Port Close Port modem Auto Answer Phone No Command String Press Enter to Send 01RI02 Response Strings amp Modem Messages Hang Up Connect Change PLCID You now can enter the complete command string as 01R10258 and it will be accepted by TLServer Note If the PLC has executed a SETPROTOCOL n 5 to configure its serial port into pure native mode then wildcard FCS will not be accepted and you must use the actual FCS with your command The FCS button makes it much easier than computation by hand If you have changed some data using the write command then activate On Line Monitoring and examine the changes made using the View Variables window 16 42 Visual Basic Sample Program To help users get started writing their own Visual Basic program to communicate with the PLC we have created a sample Visual Basic program with full source code listing Please visit the following web page to download the visual basic sample program http www tri plc com applications VBsample htm User s Manual Page 16 20 Chapter 16 Host Link Command Response Format 16 43 Inter PLC Networking Using NETCMD Command All Nano 10 PLCs are able to send out host link commands to other F M H or E10 series PLCs using the built in TBASIC function NETCMDS This
155. n ground reference for the two power supplies User s Manual Page 1 3 Chapter 1 Installation Guide The two power supplies are also recommended to be of the same output voltage Otherwise if the voltage of the load power is lower than the voltage of the CPU power the output LED will light up even when the output driver is not energized This is because the current could flow out of the PLC s output into the lower voltage load power supply and therefore light up the LED This can be very confusing to users even though it should not damage the LED Should this happen you will need to add a series diode to the output terminal to block the output LED currents from flowing through the load and back to the load power Please use only an industrial grade linear or switching regulated power supply from established manufacturers Using a poorly made switching power supply can give rise to a lot of problems if the noisy high frequency switching signals are not filtered properly Note If your application demands very stable analog I Os you should choose a linear power supply instead of a switching power source for the CPU Always place the power supply as close to the PLC as possible and use a separate pair of wires to connect the power to the PLC Keep the power supply wires as short as possible and avoid running them along side high current cables in the same cable conduit The Nano 10 PLC will enter a shut down procedure when the power supply v
156. n in the following example A NETCMD 4 01RI00 Multiple NETCMD commands can be executed as long as the connection is alive You can test the connection status by checking the result of the STATUS 3 function Once all the command exchanges have been completed you should send a lt gt tag to close the client connection to the remote server so that other NS commands can be executed in other parts of the program Page 2 12 Chapter 3 I O and Internal Relays Programming Example Please refer to the fnConnect and fnNetCmd custom functions in the demo program TestEthernet PC6 2 3 5 Remote File Services Format lt REMOTEFS IP Address of remote TLServer 2 1 amp above gt File Service tag for TLServer lt REMOTEFS gt Response The response strings sent by the remote TLServer in response to the File Service tag sent by this PLC Or ERR 04 Not Connected Failed to connect to remote TLServer Example Please refer to the fnRFS1 and fnRFS2 custom functions in the demo program TestEthernet PC6 Description This commands allows the Nano 10 PLC to connect to a remote TLServer to perform any of the Files amp Email Services that a TLServer normally provides to PLCs that are connected to it This includes creating text files on a remote PC running the TLServer software and writing or appending data to it anytime This makes it very convenient for the PLC to c
157. n of these PLCs always checks the integrity of the response string for correct FCS Frame Check Sequence characters before returning the string Please refer to the Programmer s Reference for detail description of the NETCMD function However the program must still check the following items in the response string to verify that the string returned from NETCMD function indeed comes from the PLC that it had talked to and not from another PLC which tries to send a command to someone else i The ID is correct ii The header is identical to the command string iii The length of response string is correct Pros and Cons This method does not incur any hardware cost but it requires careful programming and strict checking of the response string and hence requires more effort to program It is also the least User s Manual Page 15 8 Chapter 15 Host Link Communication Protocol desirable if the network traffic is moderately high as many collisions will occur and there is danger of some undetected error being allowed to pass through 15 5 4 2 Token Awarding Scheme A token is a software means of telling a PLC that it has been given the right to temporarily act as the master A Nano 10 PLC or a host PC can serve as the token master An internal relay bit or a variable of the PLC can be defined as the token The token master will begin by giving the token i e by setting the token relay bit to 1 or the token variable to
158. n to the PLC by clicking on Set PLC s Clock KS Set Target PLC s Real Time Clock Month Day Year 1 7day 10 28 2008 2 Tue EN 2 a Hour Set PLC s Clock i Cancel Figure 12 1 Set Real Time ClockSetting the RTC Using TBASIC The PLCs RTC can be set from TBASIC using the DATE and TIME registers shown in section 12 2 Figure 12 2 Set Date amp Time in TBASIC shown below is an example of a custom function where the date is set to October 1 2008 the day of the week is Wednesday and the time is 14 30 01 2 30 01 pm XE Custom Function 1 SET_RTC Year Month Day Day of Week Hour Minute Second Figure 12 2 Set Date amp Time in TBASIC User s Manual Page 12 2 Chapter 12 Real Time Clock 12 5 Setting the RTC from Internet Time Server Please refer to Section 2 5 for more detailed information on how your PLC may be able to automatically set its own real time clock using the time server data available on the Internet A sample program is also included in that section 12 6 Setting up an Alarm Event in TBASIC Since to the TBASIC program the RTC data are simply integer arrays DATE 1 to DATE 4 and TIME 1 to TIME 3 they are fully accessible at any time by your PLC program Therefore if you want your program to execute a certain routine on a specific date and or time you would need to periodically check these variables against the desired settings and activate the action when th
159. nd RTU protocols is that the latter transmits binary data directly instead of converting one byte of binary data into two ASCII characters A message frame is determined by the silent interval of 3 5 character times between characters received at the COMM port Other than that the function codes and memory mappings are identical to the MODBUS ASCII protocol Table 14 1 therefore applies to the MODBUS RTU protocol as well MOBBUS RTU has the following command and response format Start Address Function Data Silence of 3 5 1 byte 1 byte byte 2 bytes char times The following Function Codes are supported 06 PresetSingle Word Register Z CRC16 END Silence of 3 5 char times 14 6 3 OMRON Host Link Command Support Command Type Level of Support d IR Area READ RR Fullsupport 0000 to 1000 amp TC Status READ f DM AREA READ RD Fulisuppot O Z O i 9 PVREAD RC Dumny always returns 0000 RC h Status Write Dummy always OK I IR Area WRITE Full Support HR AR LR Area Dummy always OK amp TC Status WRITE WL WG KRCIO Dummy for other areas for Channel or Bit QQIR Dummy for other areas always 0000 Some OMRON host link commands are described in Section 16 40 For other commands please refer to the Omron C20H C40H PLC Operation manual published by OMRON Corporation If your purpose is only to use the PLC s OMRON mode with SCADA or HMI then there is no need to l
160. net for a 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 http pigtail net LRP dig For example executing the command line host mail sbcglobal 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 its 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 it 2 1 4 DNS Server IP Address DNS Domain Name Server allows the FServer to contact a remote server by means of domain name instead of IP Address The DNS takes in the given domain name such as yahoo com and returns the IP address of the target server You will need to fill in the DNS IP Address if you intend to ask the Fserver to resolve a domain name into an IP address or you intend to contact a client directly by using domain name instead of using IP Address Note Only Nano 10 PLC with firmware version r72 and above supports the use of domain name when contacting a remote server The DNS server IP address could be the same as the Gateway IP Addr described in section 2 1 3 But it will be more efficient to define the actual DNS server IP address that your ISP provides You can usually obtain the DNS server IP ad
161. ng the DNctr command on the counter that has been defined as a sequencer This is useful for creating a reversible sequencer or for replacing a reversible drum controller 4 4 6 Program Example Assume that we wish to create a running light pattern which turns on the LED of Outputs 1 to 4 one at a time every second in the following order LED1 LED2 LED3 LED4 LED4 LED3 LED2 LED1 all LED OFF and then restart the cycle again This can be easily accomplished with the program shown in Figure 4 5 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 as a normally open contact to turn 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 LEDs are turned ON by Step 0 all LEDs will be OFF Clk1 0s Seq2 HH E Sen SIT SM LED OUT Seg2 8 Seq2 2 LED2 A OUT Seq Seq2 3 LED3 QUT Seq2 6 A 5eq2 4 LED4 OUT Segz Stop Seq PRS 8829 Figure 4 5 4 5 Programming Sequencers in Custom Function You can change the current step of Sequencer easily from within a Custom Function by changing the present value of their equivalent counter E g Sequencer 3 is the same as Counter 8 thus if you wish to assign Sequencer 3 to Step 10 you can achieve it as follows CTRPV 3
162. ng the DAYTIME TIME and NTP protocols The simplest are those that send responses in ASCII data and you can extract the date and time information from the response ASCII string once you know the format You can search on the Internet for a suitable timeserver and use the TELNET program on your PC to access them to examine their display format Most timeservers listen either on port 13 or port 123 so you need to specify the port number together with their IP address when sending the lt TCPCONNECT gt command Format lt TCPCONNECT IP address portno of time server gt Response none Successfully connected to the Modbus TCP server of the specified IP address ERR 05 Prev Conn ON Another NS command has been executed and left the client socket opened but did not execute the PRINT 4 lt gt to close the client socket ERR 04 Not Connected Failed to connect to the targeted server STATUS 3 This TBASIC function returns 1 if connected or 0 if connection fails Description Once a connection is made you can then interact with the remote server using the PRINT 4 and INPUT 4 command You use the INPUT 4 command to read CR terminated text strings sent by the server You can also send data to the remote server using the PRINT 4 command Example Please refer to the fnTCPconn1 custom function in the demo program TestEthernet PC6 to see an example of how the PLC can connect to an NIST tim
163. nn nnn 15 6 15 5 3 Single Master RS485 Networking Fundamentale 15 7 15 5 4 Multi Master Peer to Peer RS485 Networking FundamentalS ene 15 8 15 5 4 1 Multiple Access with Collision Detection ii 15 8 15 5 4 2 Token Awarding Scheme sanrnnnnrrnnnnrnnnnnnnnerrvnnnrrennnnnnnerrennnrresnrnnsnnnnnenressnnrnnsnnnenenne 15 9 15 5 4 3 Rotating Master Gong 15 9 15 5 5 TROUBLE SHOOTING AN RS485 NETWORK i 15 9 16 HOST LINK PROTOCOL FORMAT 16 1 16 1 Device ID Read rrnnnnnnvennnnnnvnnnnnnnvennnnnnvnnnnnnnnvenennnnvnnnnnnnnnnnnnnnvnnnnnnnnnnnnnnnnennnnnnnnennnnnnnennnnnneennnnne 16 1 16 2 Device ID Wri E a a ali ala n iii 16 1 User s Manual Page viii USER S MANUAL 16 3 Read Digital Input ChannelsS rrssavnnnnvnnnnvnnnnnvnnnnnnnnnnvnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 16 1 16 3 1 Definition of Input Channels i 16 2 16 4 Read Digital Output ChannhelS rr 16 2 16 5 Read Internal Relay Channels iii 16 3 16 5 1 Definition of Internal Relay Channel Numbers 16 3 16 6 Read Timer ContactS runssnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 16 4 16 6 1 Definition of Timer Contact Channel NUuMbErs i 16 4 16 7 Read Counter Contacts ie oi 16 4 16 7 1 Definition of Counter Contact Channel Numbers i 16 4 16 8 Read Timer Present Value P V
164. nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnennnnnnnnnnnnnnnnnnn 9 2 9 3 Power Failure Interrupt PFI nsnerennnnnnnnnnnnnnvnnnnnnnnnnnnnnnnvennnnnnnnnnnnnnnennnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnenn 9 3 10 STEPPER MOTOR CONTROL 10 1 10 1 Technical Specifications rernnnvvnnnnvnnnnnvnnnnvnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnennnnnnnnnnnennn 10 1 10 2 Nano 10 As Stepper Motor Controller rrssrrnnvvnnnnvnnnnnvnnnnnnnnnnvennnnnnnnnnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnn 10 1 10 2 1 Interfacing to 5V Stepper Motor Driver Inputs 10 2 10 3 Programming Stepper Control Channel rssvnnnnvnnnnnnnnnnnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnennnn 10 3 10 3 1 Introduetonss 2 in i a an 10 3 10 3 2 Setting the Acceleration Properties 10 3 10 3 3 Using the STEPMOVE Command i 10 4 10 3 4 Using the STEPMOVEABS Commande 10 4 Example fucia ili alone EE EE STS 10 5 10 3 5 Demo Program for Stepper Motor Control 10 5 11 PULSE WIDTH MODULATED OUTPUTS 11 1 11 1 ut e DT e EE 11 1 11 2 Nano 10 PLC PWM QutputS ri 11 1 11 3 Increasing Output Drive Current Opto Isolated strie 11 2 11 4 Position Control Of RC Servo Motor rrnnssrrnnvvnnnnvnnnnnnnnnnnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnennn 11 3 11 4 1 Using Nano 10 PWM Output To Control RC Servo Non Isolated 11 4 11 4 2 Using Nano 10 PWM Output To Contr
165. ns we have to adhere to their definitions 14 7 1 Nano 10 PLC As MODBUS RTU Master The Nano 10 PLC can also act as a MODBUS RTU master The same READMODBUS and WRITEMOBUS commands can be used to send and receive MODBUS RTU commands What you need to do is add 10 decimal to the COMM port number to signal to the processor that you wish to use MODBUS RTU instead of MODBUS ASCII to talk to the slaves In other words you should specify port 11 to use RTU commands on COMMI E g the statement DM 10 READMODBUS 11 8 16 will access via COMM1 the slave with ID 08 and read the content of register 16 This register corresponds to MODICON address 40017 and is the OUTPUT 1 of the slave PLC The ability to speak MODBUS RTU greatly extends the type of peripherals that can be used with a Nano 10 PLC You can now make use of many off the shelf third party RTU devices to extend the PLC capability User s Manual Page 14 12 Chapter 15 Host Link Communication Protocol Chapter 15 Host Link Communication Protocol User s Manual Chapter 15 Host Link Communication Protocol 15 HOST LINK PROTOCOL INTRODUCTION While a Nano 10 PLC is running it may receive ASCII string commands that read or write to its inputs outputs relays timers counters and all the internal variables from a host computer or another Nano 10 F Series or T100M PLC These ASCII commands are known as the Host link commands and are to be serially transmitted via
166. ns small letter u instead of U in the RU command 16 12 Read Variable Integers A to Z Command Format Pv 1 fame 7 O _ A B C Z Response Format PR vy i fie 16 16 164 16 16 16 16 D 8 Hexadecimal Digit for 32 bit integer E g To read the value of the variable K send host link command RVIK If variable K contains the value 12345619 1E2401g the PLC will send the response string as RVI0001E240 16 13 Read Variable Strings A to Z Command Format Pe v s lamme gt _ A B C Z Response Format plv s afafa ela la D ASCII characters of the string variable length E g To read the value of the string variable M send host link command Rv m If variable M contains the string Hello World the PLC will send the response string as RVSHello World User s Manual Page 16 6 Chapter 16 Host Link Command Response Format 16 14 Read Variable Data Memory DM 1 to DM 4000 Command Format Henson _ rr t gt 0001 to OFAO 400010 Response Format PR Lv 16 16 16 16 O NT 4 Hexadecimal Digit for 16 bit integer E g To read the value of DM 3600 send host link command RvD0E10 If variable DM 3600 contains the value 123450 30396 PLC will send the response string as RVD3039 16 15 Read Variable System Variables This comm
167. nterface to the PLC which is already taken care of As mentioned in the previous section the two html files that come with the Nano 10 are 0 HTM and 2 HTM and the JavaScript file is N JS The N JS file should generally be left alone unless you are very experienced with JavaScript and would like to expand on the interface between the Nano 10 PLC and the html files Note that we do not support customizing the N JS file if you choose to do so 2 10 1 Accessing the HTML Files from a Standard Browser In order to access the web pages stored in the Nano 10 web server you need to open your web browser and enter the IP address and port number of the Nano 10 server in the address bar You also need to append the filename of the web page to the end of the address All this should be done in the following format IP Port Filename For example if the IP address of the Nano 10 is 192 168 1 5 and the port number is 9080 these are the default values then you should enter the following in the address bar in order to access the 2 HTM file http 192 168 1 5 9080 2 HTM If you want to access the O HTM then you can change the filename in the address or you can remove the filename so that only the IP Port are in the address bar This will work only for the O HTM file because it is loaded by default when no other filenames are specified If you have removed 0 HTM from the Nano 10 server then you will always hav
168. o 1KQ biasing resistors connected to a 9V at least 5V and OV supply as shown in Figure 15 2 Otherwise random noise on the pair could be falsely interpreted as data The two biasing resistors are necessary to ensure robust data communication in actual applications Some RS485 converters may already have biasing built in so the biasing resistors may not be needed However if the master is an F series M series or Nano PLC then you should use the biasing resistor to fix the logic states to a known state Although in a lab environment the PLCs may be able to communicate without the biasing resistors their use is strongly recommended for industrial applications 15 5 2 Protection of RS485 Interface The simple direct multi drop wiring shown in Figure 15 2 will work well if all the networked PLCs are in close proximity and they all share a common power supply They will even work for long distance as long as there are no wiring errors However in an industrial environment the PLCs are most likely far apart and may each have their own power supply Since processes are often modified regularly should somebody on one occasion by mistake short one of the PLC s RS485 to high voltage all the PLCs connected to the same RS485 wiring will be fried simultaneously This can result in very costly down time for the whole process because all of the PLCs connected to the network will need to be repaired Hence for networking over long distances and involving
169. oad from http www tri plc com applications VBsample htm VB6sample 15 43 Communication Procedure Unlike the point to point communication protocol the host computer must NOT send the CTRL E character before sending the command frame After the host computer has sent out the multi point host link command frame only the controller with the correct device ID will respond Hence it is essential to ensure that every controller on the RS485 network assumes a different ID If a master PLC is used then User s Manual Page 15 4 Chapter 15 Host Link Communication Protocol the master PLC should also have a different ID from all the slaves Otherwise contention may occur i e two controllers simultaneously sending data on the receiver bus resulting in garbage data being received by the host On the other hand if none of the controller IDs match that specified in the command frame then the host computer will receive no response at all The PLC automatically recognizes the type of command protocols point to point or multi point sent by the host computer and it will respond accordingly If a multi point command is accepted by the controller the response frame will start with a character followed by its device ID and the same header as the command This will be followed by the data requested by the command a response frame FCS and the terminator 15 4 4 Framing Errors When the controller receives a multi point host link command fra
170. oaded from any weserver The 0 HTM and 2 HTM background images are loaded from the TRI PLC server LCD Display Los Angeles 18 28 58 New York 21 28 58 London 2 28 58 Tokyo 9 28 58 Figure 2 10 3 The LCD display is positioned at the top of the image in 0 HTM and it is displaying a world clock which is controlled by the Relay PC6 PLC program The display in the HTML files is showing the 4 line by 20 character virtual LCD display controlled by the Nano 10 program using the SETLCD command This means you can configure your PLC program to display up to four lines and up to 20 characters on each line User s Manual Page 2 33 Chapter 3 I O and Internal Relays Programming Internal Relay Bits Figure 2 10 4 The 4 Output buttons and 4 Input buttons shown on 0 HTM are all mapped to internal relay bits 129 to 134 in the Nano 10 PLC Even though the buttons are labeled as Input and Output they are not actually connected directly to any physical I O so it is up to the PLC program to map the internal relay bits to the physical I O in the PLC program The i Relay PC6 program maps these relay bits to the physical inputs and outputs of the PLC However the relay bits don t have to just interact with physical I O they can control anything in the PLC program such as custom functions timers counters etc Note The Nano 10 PLC is preloaded with the i Relay PC6 program A copy of the program may be
171. of the ladder logic circuit PO User s Manual Page 3 1 Chapter 3 I O and Internal Relays Programming 3 2 4 Programming Examples 3 2 4 1 Example 1 Editing Label Names The Digital I O can be named by selecting I O Table from the Edit menu and choosing the particular digital UO that you want to name In Figure 3 1 physical input 1 is being named Input1 Figure 3 1 I O Table 3 2 4 2 Example 2 Creating a Simple Ladder Logic Circuit You can place components in the circuit by clicking in the green area to the right of the red arrow as shown in Figure 3 2 below This will bring up the component tool bar in the gray area above the green circuit area WE TRiLOGI Version 6 13 Untitled File Edit Controller Simulate Circuit Help Circuit 1 DAAA vene quickTags Once the component toolbar is shown you can place your input relay contact by selecting the 1 Figure 3 2 Creating Ladder Circuit component from the toolbar EI and then selecting the digital input from the I O Table The contact will then be automatically placed in the ladder logic circuit The same can be done for the output coil by selecting the 7 component from the toolbar ES and then selecting an output that has been entered into the I O Table After selecting one input and one output the ladder logic circuit should like something like Figure 3 3 below KS TRILOGI Version 6 13 Untitled File Edit Controller Simulate Circuit Hel
172. ol RC Servo Opto Isolated 11 5 11 4 3 RC Servo Positioning Resolution ii 11 5 12 REAL TIME CLOCK 12 1 12 1 Introduction ilari ee 12 1 12 2 TBASIC variables Used for Real Time ClocK ri 12 1 12 3 RTC Error Status On Ladder LOGgiC nnsnnnnnvnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 12 1 12 4 Setting the RTC Using TRILOGI Software rriii iii 12 2 12 5 Setting the RTC from Internet Time Server rrrssrrnssvnnnsvnnnnnnnnnnvvnnnnvnnnnnnnnnnnnnnnvnnnnnnnnnnnnennn 12 3 12 6 Setting up an Alarm Event in TBASIG rennnnnnnnvvnnnnvennnnnnnnnnnnnnvnnnnnvnnnnnnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnn 12 3 12 7 Retrieving RTC Clock values using STATUS 18 rrnnnnvnnnnnvnnnnvnnnnvnnnnnvnnnnnnnnnnvennnnnnnnnnnnnnn 12 3 12 8 RTC Calibration For FRAMRTC onlly cccccsseeeeeeeescceeeseseeeeesesceesesesceeseeseseeeenseseanens 12 4 12 9 Control of RTC Hardware mmssrrnsnvnnnnvennnnnvnnnnnnnnnvnnnnnvnnnnnnnnnnnnnnnnennnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 12 5 12 10 Troubleshooting the FRAMRTC sevrrnavnnnnnvnnnnnnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnner 12 5 13 LCD DISPLAY PROGRAMMING 13 1 EEN WT a Beie Rei ul D 13 1 13 2 Special Commands For LCD Display rrnnvrnnnnvnnnnnvnnnvvnnnnnvnnnnnnnnnvvnnnnvnnnnnnnnnnnnnnnvnnnnnnnnnnnnnnnn 13 1 13 3 Displaying Numeric Variable With Multiple Di
173. ollect large amounts of data and save them to the easily accessible virtually limitless hard disk storage space that is available in today s PCs For detailed descriptions of the available File Service Tags please refer to TRiLOGI programmer s reference manual under the chapter File amp Email Services All TLServer s File amp Email Services tags such as lt Email gt lt WRITE gt lt APPEND gt lt READ gt and lt READ RTC gt are available to the Nano 10 PLCs through the use of the lt REMOTEFS gt tag You simply have to wrap the abovementioned command tags between the lt REMOTEFS IPAddr port gt and lt REMOTEFS gt tag where IPAddr port is the IP address and listening port of the remote TLServer E g through the lt READ RTC gt tag the PLC can synchronize its Real Time clock with a remote TLServer As you will later see this feature is probably not very useful for the Nano 10 PLC anymore since Nano 10 has the ability to connect to the NIST Time Server to update its real time clock to Atomic clock accurately Note Only TLServer version 2 1 or above can handle the lt REMOTEFS gt command tag sent by the Nano 10 or F series PLC 2 3 6 Other Network Services Tags We will describe two more Network Services commands lt TCPCONNECT gt and lt MBTCPCONNECT gt in separate sections later in this manual User s Manual Page 2 13 Chapter 3 I O and Internal Relays Programming 2 4 MODBUS TCP Server an
174. oltage dips below approximately 16V It is a good idea to connect a 470uF to 1000uF 50V electrolytic capacitor near the power supply connector to suppress any undesirable voltage glitches from conducting into the PLC If other high current devices such as a frequency inverter were to affect the operation of the PLC you should then also connect a diode before the capacitor to prevent reverse current which might flow back to the power supply as shown in the following diagram Surge suppressor Recommended 470uF 50V OV Figure 1 4 If the AC main is affected by nearby machines drawing large amounts of current Such as large three phase motors you should use a surge suppressor to prevent any unwanted noise voltage from being coupled into the Nano 10 power supply The required current rating for the power supply depends mainly on the total output current taking into consideration the peak current demand and the duty cycle of the operation 1 4 Digital Input Circuits All 4 digital inputs are NPN type with green colored LED indicators meaning that to turn ON an input you should connect it to the low voltage rail OV terminal of the power supply as shown in the following diagram The input numbers are marked on the PCB alongside the side of the screw terminal block All digital inputs are directly programmable in Ladder Logic as well as in TBASIC custom functions Some programming examples are detailed in Chapter 3 Digi
175. onable accuracy the pulse width of incoming pulses not exceeding 10KHz User s Manual Page 8 2 Chapter 8 Frequency Speed Measurement 8 3 Frequency Measurement on High Speed Counter Inputs For applications that require frequency measurement and pulse counting of the same signal you only need to feed the pulse input into any pair of the inputs 1 amp 2 or inputs 3 amp 4 or inputs 5 amp 6 and define it as a High Speed Counter see Chapter 7 This is because an input pin that has been defined as an HSC will automatically be enabled for pulse measurement In other words if you need to use the HSC and the Pulse Measurement on the same channel then you don t execute both the HSCDEF and PMON you only need to execute the HSCDEF The HSCDEF function will automatically start the Pulse Measurement hardware so it is not necessary to use the PMON statement If you use only the PMON statement it would not enable the HSC function However if you execute the HSCDEF statement and followed by the PMON statement the HSC will be disabled even though it was previously enabled User s Manual Page 8 3 Chapter 9 Interrupts Chapter 9 Interrupts User s Manual Chapter 9 Interrupts 9 INTERRUPTS 9 1 Input Interrupts During normal PLC ladder program execution the CPU scans the entire ladder program starting from the first element progressively solving the logic equation at each circuit until it reaches the last element After whi
176. onnection will listen on port 502 and the remaining connections will only be listening on the secondary port number If you have a MODBUS TCP client program e g you can download a trial version of Modbus Poll from http www modbustools com for testing you simply specify the Nano 10 IP address and connect to it Once connected you will then be able to read from or write to most of the Nano 10 PLC s internal data from the MODBUS TCP client The PLC s I O and internal variables are mapped to the MODBUS device space according to Table 2 1 2 4 1 1 Bit Address Mapping All the Nano 10 PLC I O bits are mapped identically to both the MODBUS Ox and 1x space The bit register offset is shown in the last column of Table 2 1 Although MODBUS names the Ox address space as Coil which means output bits and the 1x address space as Input Status which means input bits only the Nano 10 PLC treats both spaces the same Some MODBUS drivers only allow a read from Ox space and a write to 1x space but you still use the same offset shown on Table 2 1 Example 1 To map an element to the PLC Input 4 you select the MODBUS register address 0 0004 You can also map the element to the PLC s output 2 In that case you should map it to MODBUS register address 0 0258 2 To map an HMI toggle switch symbol to the PLCs input 4 if you are restricted to select only MODBUS 1x address space then you will have to
177. ough Ethernet cable will only work if one or more of the Ethernet ports can perform auto switching How to Set Up Your PC Before you can communicate with the PLC you will need to configure the Ethernet port on your PC to match the settings that you configured in the PLC For more information on configuring the PLC Ethernet settings see section 2 1 Configuring The Ethernet Port Once you have configured your PLCs Ethernet settings you will need to set your PCs Ethernet port to have a static IP address that is on the same subnet as the IP address you had set for your PLC How you do this is a bit different depending on your operating system so the following sections will show step by step instructions for configuring your PCs Ethernet settings on Windows XP and then on Windows Vista Windows XP Ethernet Configuration The first thing you will need to do is open the Network Connections window from the Start menu by selecting Show all connections from the Connect To menu as shown here User s Manual Page 2 24 Chapter 3 I O and Internal Relays Programming 3 Calculator es HyperTerminal Internet Mozilla Firefox E mail Outlook Express All Programs gt Defaults Figure 2 8 1 KW Wireless Network Connection Show all connections Next the Network Connections window should open which will display all of your network connections File Edit Back Network Tasks View Favorites
178. out 100 000 cycles which should not be exceeded Note The CPU will also automatically backup the pseudo EEPROM memory to the flash memory whenever the PLC executes a software reset or reboot or if the PLC is reset or rebooted via the serial or Ethernet communication Upon power up the CPU automatically loads the data from the flash memory into all the pseudo EEPROM memory and therefore this memory can be used just like the standard EEPROM data memory in the M series and the F series PLCs Automatic Backup Using Power Failure Interrupt On a Nano 10 PLC an onboard power failure detection circuit detects a power failure when the power supply voltage drops below approximately 16V and you can setup the PLC to execute a user s defined power failure interrupt custom function It is therefore tempting and indeed possible to include the SETSYSTEM 252 0 function inside the power failure interrupt custom function to automatically backup the pseudo EEPROM data during power failure This is actually possible provided you are using a good power supply that provides a gradual decay of supply voltage during power down This is because the process of backing up the shadow RAM to the flash memory as well as executing other user s power failure interrupt service routine would require an execution time of at least tens of milliseconds It is therefore very important for the power supply voltage to the PLC to gradually decrease User s Manual Page 1 8 Cha
179. ows Firewall can help prevent hackers or malicious software from gaining access to program or port exception to allow communications through the firewall low a program through your computer through the Internet or network Windows Firewall 1 Windows Firewall is currently using settings for the public network location What are the risks of unblocking a program GI Windows Firewall is helping to protect your computer To enable an exception select its check box Program or port Windows Firewall is on Change settings z BITS Peercaching Inbound connections that do not have an exception are blocked M Bonjour E Display a notification when a program is blocked No CICOM Network Access N kl Publi k M Core Networking Seat location ubic rietwor Distributed Transaction Coordinator What are network locations 9 File and Printer Sharing SESCH MFilezilla MFP Server DISCSI Service MiTunes Okey Management Service MNetlogon Service LEl D sen x Add program Add port Properties Delete notify me when Windows Firewall blocks a new program See also Network Center x canca Apply Figure 2 9 4 2 9 3 Transferring and Retrieving Files from the Nano 10 Server Now that you have a connection to the Nano 10 server and can view the directory listing you should be able to see the three preloaded files 0 HTM 2 HTM and N JS Downloading Files The first thing to do is download the preloaded files from th
180. p Circuit 1 SAE JGR IGE a Fra enig S ce Input Ku 4 Figure 3 3 Completed Ladder Circuit 3 2 4 3 Example 3 Creating a Latching Relay Circuit The first part of the circuit follows the same procedure as the previous example except that the 7 coil should be a Relay coil So it should look similar to the circuit in Figure 3 3 The next part requires a parallel contact to be added to the Input1 contact This is done by selecting the Input contact or whichever contact was used and then adding the 3 contact Hh as shown in Figure 3 4 below User s Manual Page 3 2 Chapter 3 I O and Internal Relays Programming XE TRILOGI Version 6 13 Untitled File Edit Controller Simulate Circuit Help create TS Hals del tol ril i gt 2 Input Relay1 RLY Relay1 Figure 3 4 Completed Latching Circuit 3 3 Programming DIO in a Custom Function In order to program digital I O or anything in a custom function a custom function must be created in the I O Table and added in a ladder logic circuit Custom functions act the same way as coils in ladder logic in that that they need a contact to activate them Once they are activated the code inside them will execute To create a custom function circuit follow these 3 steps 1 Edit the name of the custom function in the I O Table 2 Place the activating contact in the ladder logic circuit 3 Place the custom function at the end of the circuit 3 3 1 Editing
181. pplies usually have large filtering capacitors at the DC output which means that the power supply to the load would normally decrease slowly when power supply to the AC side has been cut Note if the user intends to execute the SAVE_EEP or SAVE_EEP commands during power failure then these commands must be executed BEFORE executing the SETSYSTEM 252 0 command so that they can be backed up to the flash memory FRAMRTC Based Non Volatile Memory The optional FRAMRTC module provides a large array of state of the art Ferromagnetic RAM FRAM memory to the Nano 10 PLC and these FRAM memories will be used as primary storage for the user s EEPROM data With FRAMRTC the PLC would have a total of 11 000 words of all FRAM based EEPROM memory These 11000 words of EEPROM data can also be used to store up to 549 strings of 40 characters per string Since these FRAM are truly non volatile and they do not have to be backed up to any flash memory the data are therefore not easily corrupted by any unplanned power disruptions Also these FRAM memories allow an unlimited number of read and write cycles at full soeed and they are thus much better than the traditional EEPROM memory on the M series PLC However for legacy reasons we are still calling them EEPROM memory since they are to be accessed using the TBASIC s SAVE_EEP LOAD_EEP SAVE_EEP and LOAD_EEP commands 1 6 3 RAM Data Memory All the TBASIC variables used in the Nano 10 PLC A to Z
182. pter 1 Installation Guide to zero over several hundred milliseconds during power down Le a nice power down voltage gradient is required This ensures that the CPU has sufficient time before it loses its operating voltage required for it to properly backup the pseudo EEPROM data to the flash memory If you simply cut off the DC voltage to the PLC e g by disconnecting the power supply terminal to the PLC abruptly then what could happen is that the PLC may only have time to erase the flash memory sector for backing up the pseudo EEPROM but does not have enough time to backup the pseudo EEPROM data to the flash memory The result could be loss of all tte EEPROM data when the power is returned to the PLC You will know that the backup area of the EEPROM has been erased but not re written if all the EEPROM data reads only 1 upon power up The additional diode and 470uF or larger capacitor connected to the PLC s power supply input screw terminal as shown in Figure 1 4 also shown below would also help to obtain a good voltage decay gradient during power down and is therefore highly recommended if you need to execute any power failure interrupt service routines Surge suppressor 470uF 50V Recommended OV To ensure that the power supply provides a slow voltage gradient during power down the power switch must be connected to the AC side of the power supply instead of to the DC side of the power supply All industrial DC power su
183. pter 15 Host Link Communication Protocol PLCs by executing the NETCMD function or the READMODBUS or the WRITEMODBUS commands the latter two are for communicating using MODBUS protocols only and are covered in Section 14 8 Only the master can issue commands to the slave PLCs To transmit a command the master controller must first enable its RS 485 transmitter and then send a multi point command to the network of controllers After the last stop bit has been sent the master controller must relinquish the RS485 bus by disabling its RS485 transmitter and enabling its receiver At this point the master will wait for a response from the slave controller that is being addressed Since the command contains the ID of the target controller only the controller with the correct ID would respond to the command by sending back a response string For the network to function properly it is obvious that no two nodes can have the same ID You can use the Setup Serial Port command in TLServer to set the ID for each PLC on the node You can also use the IW Host Link command to set the device ID Also all nodes must be configured to the same baud rate and communication format Care should be taken to ensure that the power supplies for all the controllers are properly isolated from the main so that no large ground potential differences exist between any controllers on the network 15 5 4 Multi Master Peer to Peer RS485 Networking Funda
184. put 1 and 2 already incorporate intrinsic Zener bypass diodes to protect the driver it only activates when the inductive kick voltage rises above the maximum breakdown voltage about 55VDC This could User s Manual Page 1 6 Chapter 1 Installation Guide result in a large dose of noise being introduced into the system and may have undesirable effects For DC we recommend using a fast recovery diode such as UF4001 to UF4007 connected as shown in the above diagram to absorb the inductive noise For AC loads output 3 amp 4 you ll need to select a suitable Metal Oxide Varistor MOVs to protect the relay contacts as shown below AC Power b Metal Oxide NANO 10 Varistor MOV Relay Output 1 6 Program and Data Memory Default Configuration With FRAM RTC Add On Program Memory 8000 words 16000 words Non Volatile Data Storage Integers 16 bit 1024 words 11000 words Strings 40 chars max 51 549 RAM Data Memory DM 1000 words volatile 4000 non volatile A to Z 32 bit Yes volatile Yes J1 non volatile A to Z 70 chars string Yes volatile Yes J1 non volatile EMINT EMLINT EMEVENT Yes volatile Yes volatile Each word is 16 bit two bytes 1 6 1 Program Memory Standard Nano 10 PLC can store up to 8000 16 bit words of program memory stored in the CPU Flash memory area This can be expanded to 16 000 words with the addition of an optional FRAM RTC module
185. r s Manual Page 5 1 Chapter 5 Analog I Os However if you need to connect to 0 10V inputs or a 4 20mA analog source to either channel you have to take into consideration the low A D input impedance in your design The following figures show how to connect 4 20mA current source signals and 0 10V signals to the A D inputs 1 to 2 AD 1 2 0 20mA or 4 20MA Current loop 2500 1 Internal 20 00K 3 16Q 1 Converting 20mA current loop to 0 5V Converting 0 10V signal to 0 5V Figure 5 1 You can see that interfacing to a 0 10V analog signal is extremely simple since all you need is to add a 20 0K ohm series resistor and it will be divided into 0 5V when it enters the AD 1 or 2 However to convert a 0 20mA or 4 20mA current source into 0 5V or 1 5V voltage signal you should use a 253 16 ohm resistor which when paralleled with the 20K ohm of internal impedance will yield a 250 0 ohm total resistance You can obtain 253 16 ohm by combining a 250 ohm and a 3 16 ohm metal film resistor 5 2 1 Interfacing to two wire 4 20mA sensors Many 4 20mA analog sensors only have two wire connections and are designed to be powered by the 4 20mA output current that flows through it These types of sensors can be interfaced easily to the 0 5V analog inputs of the PLC as shown in the following diagram User s Manual Page 5 2 Chapter 5 Analog I Os PLC s V V 24V P S for PLC And Sensors ADC Input Sensor 253 16 Q
186. rate real time clock by updating its internal RTC every hour when the seconds and minutes both become zero This can be optionally disabled by using the SETSYSTEM command described in Chapter 12 1 9 CPU Status Indicators There is a single red LED indicator on Nano 10 board marked PAUSE This indicator will light up for about 0 5 seconds during power on Thereafter it should go off The PAUSE indicator will be turned ON if one of the following has occurred 1 The PLC s program is corrupted 2 APAUSE statement has been executed 3 The user halts the PLC by pressing the lt P gt key during On Line Monitoring 4 Jumper J4 is turned ON which halts the program 5 A run time error has occurred If this light is ON please connect the host computer running i TRILOGI to the PLC and run the On Line Monitoring program You will be informed of the reason that caused the PAUSE condition Except for condition 1 and 4 you can release the PLC from the PAUSE state by clicking on the Pause button or by pressing the lt P gt key during On Line Monitoring If the PLC s program is corrupted then you must re transfer your program to the PLC If a run time error has occurred the PLC will halt at the CusFn where the error took place If the programmer now executes the On Line Monitoring command in I TRILOGI the cause of the run time error and the CusFn where the error occurred will be reported on TRILOGI screen Althoug
187. ring the line then you will see the following string being displayed Pressure 98345 What happens is that the string Pressure 983 is correctly displayed but the two old characters 45 left over from previous display would appear to be part of the new data This can cause confusion There are several ways you can eliminate such a display problem 1 Clear the line first before overwriting with a new string You can create a custom function just to clear a particular line E g if you pass the parameter DM 100 to the custom function and inside the custom function you do the following DI SETLCD DM 100 1 Hence calling this custom function with DM 100 1 2 3 or 4 would clear the corresponding line 2 A quick and lazy way to do it is to add a few more characters to the back of the string to be displayed which will wipe out old characters that could be present adjacent to the new string DI E g SETLCD 1 1 Money 8 STR D 3 If there is data to the right of the currently displayed string that you cannot overwrite with spaces then you can restrict the number of digits that a numeric variable may be converted to using the two parameters from the STR or HEX command E g SETLCD 1 1 Temp STRS T 4 The STR T 4 function will always return 4 digits of the data stored in T If T is less than 4 digits then one or more preceding 0 s will be added E g if T 12 then t
188. rning SETIO Pump ENDIF 12 8 RTC Calibration For FRAMRTC only The RTC calibration routine is only applicable to the FRAMRTC module installed on a Nano 10 PLC The FRAMRTC uses a battery back real time clock that derived its clock from a 32 768KHz crystal which should provide reasonably good accuracy for normal use However if you like the FRAMRTC to be of greater accuracy you can calibrate it using the Advanced Configuration page of the Ethernet Configuration Tool in the PLC configuration routine mentioned in Chapter 2 The data field to be used is the RTC Calib textbox as shown below RTC Calib seconds 72 hours In the above field you will need to enter the number of seconds that you want the PLC to add or subtract over a period of 72 hours Therefore first you must check the PLC s RTC reading against a super accurate clock source e g a clock that regularly updates itself with atomic clock data in the airwaves and find out how many seconds the clock would have gained or lost over 72 hours For example if the RTC is too slow and it loses 5 seconds over 72 hours you would want the RTC to add 5 seconds over 72 hours and you therefore should enter the value of 5 in the RTC Calib field If the RTC is too fast and gains 8 seconds over the 72 hours then you should enter a value of 8 in this field to compensate for the inaccuracy Note that the RTC does not compensate for temperature variat
189. rogramming 2 2 On line Monitoring Programming via FServer If you have used the i TRILOGI software to connect to TLServer or the X Server previously the procedure is identical To test i TRILOGI communication with the Nano 10 PLC click on Controller gt On Line Monitoring or simply press lt CTRL M gt keys 8 a E TRILOGI Version 6 13 Untitled les Login To TLSever File Edit Controller Simulate Circuit Help Servers IP Address port Circuit 1 select Controller Ctrl I rcontext sensitive Helps eg Detect ID rey E fe 1192 168 1 519080 bi nin 1PLC Only ID Hex C localhost 127 0 0 1 9080 I Use Http Proxy Server Program Transfer to PLC Ctrl T Open Matching Source File Username samples Get PLC s Hardware Info Set PLC s Real Time Clock Password ee VM Memorize Username amp Password Cancel OK Figure 2 2 1 When the Login To TLServer screen pops up enter the IP address port the username and the password that you have defined for the FServer earlier using the configuration tool and click on the Detect ID button to detect the PLC s ID If i TRiLOGI is able to connect to the Nano 10 PLC via the Ethernet network then the PLC s ID will appear in the ID box When you click the OK button the on line monitoring screen should appear and you should see the Activity LEDs on the RJ45 connector blinking away You have now successfully connected to the FServ
190. rs space The Inputs Outputs Relays Timers and Counters bits are mapped to the MODBUS Bit address space as shown in Table 14 1 Note that input and output bits are always mapped according to Table 14 1 whether it is MODBUS function 01 02 or 05 However 32 bit variables and string variables are not mapped since they are fundamentally quite different in their implementation among different PLCs Internal variables that are not mapped can be still be accessed by copying the contents of these variables to unused data memory DM n this can be easily accomplished within a CusFn so that they can be accessed by these third party protocols 14 6 1 MODBUS ASCII Protocol Support The Nano 10 PLC supports MODBUS ASCII protocols with the following command and response format START LRC Check CRLF po 2chars 2chars oe 2chars Zeta The following Function Codes are supported 01 02 Read I O bit Use Bit Address Mapping in Table 14 1 03 04 Read I O Word registers 7 Force I O Bit Use Bit Address Mapping in Table 14 1 06 Preset Single Word Register Preset Multiple Word Registers The exact command response format of the MODBUS protocol can be found at http www modbus org However if your only purpose is to interface the PLC to other MODBUS hosts such as an LCD touch panel or SCADA software then there is no need to know the underlying protocol command format All you need to know is which PLC s system Variable is mapped to whi
191. s The two jumpers have the following functions when they are closed i e a jumper block is placed over the two pins to short them together J1 All RAM data memory If FRAM RTC is installed then A to Z A to Z and DM 1 are volatile to DM 4000 are non volatile J4 Normal Run mode Suspends execution of the ladder logic program But host communication remains active 1 7 1 Usefulness of Jumper J4 We have taken every effort to ensure that the host communication is always available even when the user program ends up in a dead loop This allows the user to re transfer a new program to the PLC and overwrite the bad program However you may still encounter a situation whereby after transferring a new program to the PLC you keep encountering communication errors and you are unable to erase the bad program This is especially common if you have been experimenting with the communication commands such as SETBAUD SETPROTOCOL PRINT or OUTCOMM These commands may modify the communication baud rate format or protocol or set the PLC to send data out of a COMM port that conflict with i TRILOGI In such cases you can short the jumper J4 and perform a power on reset for the PLC The PLC will not execute the bad program that causes communication problems and you can then transfer a new program into the PLC to clear up the problem Note that when the PLC has been power reset with Jumper J4 closed the COMM1 RS485 serial port will boot up with de
192. s 192 168 1 xxx then the PLC should have an IP address of 192 168 1 yyy and it will not work if the PLC has IP address such as 192 168 0 yyy or 192 168 2 yyy since this means that the two devices are on different subnets Likewise if your PC s IP address is 192 168 0 xxx then please change your PLC s IP address to 192 168 0 yyy Also ensure that the PLC s IP address is not already User s Manual Page 2 8 Chapter 3 I O and Internal Relays Programming assigned to another device on the same network otherwise a conflict would occur and communication is not possible 2 3 Using Fserver Network Services Commands The F Server firmware in the Nano 10 PLC implements a list of Network Services commands similar to what you may have read in the User s Manual of the X Server NS commands and TLServer Files and Email Services These Network Services or NS in short can be used to instruct the Nano 10 PLC s operating system to perform a number of network related client connection via the Ethernet port These commands allow the PLC to connect remotely to another PLC in another building or another part of the world via the Internet This allows peer to peer networking or so called M2M machine to machine communication to take place between the PLCs Notes 1 In the case of the X Server and TLServer the PLC typically communicates with these external hardware or software servers via its C
193. s especially suitable for use with the Nano 10 PLC because you can simply connect the 10K thermistor directly to the analog input due to its internal impedance of 20 00K ohm 0 1 accuracy User s Manual Page 5 5 Chapter 5 Analog I Os AID 1 2 Internal Figure 5 6 Connecting 10K Thermistor to NANO 10 ADC 1 2 Note that since the thermistor resistance value vs temperature change is a non linear function you cannot simply use a formula to calculate the temperature from the voltage value For better accuracy you need to use a look up table plus a linear interpolation technique to determine the temperature based on the ADC readings The look up table and interpolation method can be implemented using TBASIC quite easily For your convenience we have provided a sample TBASIC program that you can download from the following URL http www tri plc com appnotes Nano10 ThermistorSensor zip This example uses the R T Resistance Temperature graph of the Precon Type Ill thermistor to implement the temperature look up We have provided an Excel file that computes the ADC reading vs ambient temperature for this thermistor type The TBASIC program uses these ADC readings to determine the temperature The sample program is structured such that the lookup table values are stored in DM area and you can readily adapt it to other types of thermistors with a different R T graph The program only implements lookup for a temperature range of 1
194. s the input numbers as defined in TRiLOGI s Input entry table corresponding to the input channel number Bit7 Input Output Numbers Bito cH pe Tale SV SE om ie 15 14 ia 2 1 10 9 CH02 CHO3 CHO4 CHO5 CHO6 CHO7 CHO8 CHO9 CHOA e CHOBie CHOC 6 CHIE ve Our The 8 bit inputs of each channel are represented by a two byte ASCII text expression of its hexadecimal value For example if inputs 1 to 3 are logic 0 s inputs 4 to 10 are logic 1 s and all other inputs are logic O s then if you send command RI00 you will get the response RIF8 F816 1111 10002 16 4 Read Digital Output Channels Command Format CE Oe hin rant ft oe 8 bit Channel Hex Response Format Eos 8 bit data Hex User s Manual Page 16 2 Chapter 16 Host Link Command Response Format Please refer to the Input Output vs Channel Number table described in the section 16 3 Read Digital Input Channels for details 16 5 Read Internal Relay Channels Command Format LA SENZA ES 8 bit Channel Hex Response Format KJENDE ENN 8 bit data Hex 16 5 1 Definition of Internal Relay Channel Numbers All Nano 10 PLCs support 512 internal relays the channel definition of the first 256 internal relays is the same as the inputs and the outputs The remaining relays and their assigned channels are shown in the following table bit7 Relay numbers bito CH2016 CH21 46 CH22 e 273
195. s two built in Server programs that listen on a few different ports on the PLC for incoming TCP IP request packets 1 The FServer supports the TRi proprietary programs such as the i TRILOGI software and TRi ExcelLink program By default the FServer listens on the default port 9080 User s Manual Page 2 2 Chapter 3 I O and Internal Relays Programming 2 A MODBUS TCP server that listens on port 502 and supports the industry standard MODBUS TCP protocols Note e These two servers share the same Ethernet port and therefore the same IP address and gateway addresses described in the following sections e Nano 10 PLCs host both the FServer and the Modbus TCP servers each providing multiple simultaneous connections to external clients This means that it is possible to connect multiple TRILOGI ExcelLink and Modbus TCP clients to the PLC all at the same time Section 2 1 5 shows you how you can change the maximum number of connections for each server 2 1 1 IP Address One of the most important Ethernet parameters that you must define here is the IP Address field By default every Nano 10 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 connect
196. scribed in Section 2 10 for controlling the Nano 10 PLC using a web browser The virtual LCD would then become a real display on the web browser If you require a physical LCD display to be used with the Nano 10 PLC then there are many options One of which is to purchase an RS485 based MDS100 BW that is produced by TRi However it is important to note that what we describe in this chapter is not applicable to MDS100 BW MDS100 BW is a peripheral device and it is controlled by a set of communication protocol described in the MDS100 BW installation guide 13 1 SETLCD Command The SETLCD y x string TBASIC command allows you to easily display any string of up to 20 characters on the y line starting from the x column E g to display the message Super Nano 10 on the 3 line starting from the 5th character position from the left end of the screen you use the command SETLCD 3 5 Super Nano 10 Normally y 1 2 3 4 x 1 2 20 Integers must be converted to strings using the STR or HEX function before they can be displayed using SETLCD You can use the concatenation operator to combine a few components together in the command E g SETLCD 1 1 Rm Temp STR ADC 1 100 3 CHR 223 C The function STR ADC 1 100 3 reads the content of ADC channel 1 divides it by 100 and converts the result into a 3 digit string The CHR 223 appends a special character which corresponds to the
197. se Measurement PM as described in Chapter 6 7 and 8 if these inputs are defined as interrupts using the INTRDEF statement then they will lose their other special function i e they can only be defined either as a HSC PM or as an interrupt input and not both 2 When the digital inputs are used as interrupt inputs the PLC operating system does not perform software filtering on these inputs That means these interrupt inputs are extremely sensitive and will trigger the interrupt service routine even with the shortest input pulse While the high sensitivity could be useful for some applications that need to capture events that produce very short sharp pulses it could be problematic for other applications that need to filter out such narrow pulses since they can trigger the interrupt inputs multiple times You can add in some hardware filtering by connecting a small 100pF or large capacitor across the interrupt input and the power supply ground OV 9 2 Periodic Timer Interrupt PTI The Periodic Timer Interrupt PTI not available on T100M PLC lets you define a custom function that will be executed by the CPU precisely every x number of milliseconds ms The syntax for setting up a PTI is as follow INTRDEF 18 cfnum x Interrupt 18 is reserved for PTI cfnum custom function number to execute when PTI event takes place x The period in number of milliseconds between two PTI events E g INTRDEF 18 101 15 call f
198. sed as a MODBUS TCP client to access any industrial control or HVAC device and sensors that support a MODBUS TCP server Best of all you can do it without learning any specifics of TCP IP programming To open a client socket and connect to a Modbus TCP Server that is listening on port 502 default Modbus TCP port you only need to send the command tags lt MBTCPCONNECT xxx xxx xxx xxx 502 gt to the CPU via virtual COMM port 4 E g PRINT 4 lt MBTCPCONNECT 192 168 1 105 502 gt If connection is successful the system will return the string lt CONNECTED gt on virtual comm port 4 which you can check with the INPUT 4 command User s Manual Page 2 17 Chapter 3 I O and Internal Relays Programming Once the connection is successfully established you can begin to use the built in TBASIC commands READMODBUS WRITEMODBUS READMB2 and WRITEMB2 operating on virtual comm port 4 to send MODBUS commands and receive processed dresponses from a remote MODBUS TCP Server This greatly simplifies your programming task since it is very similar to communicating with a Modbus RTU slave that is connected to the serial port 1 2 or 3 Although in this case the Modbus TCP device could be located in the other hemisphere and connected via the Internet The full syntax for the lt MBTCPCONNECTS tag is described below Format Response STATUS 3 Description Example User s Manual lt MBTCPCONNECT IP address 502 of
199. servo feedback mechanism within the RC Servo produces a huge amount of torque relative to its weight for positioning the actuator to the position determined by the pulse width at the control User s Manual Page 11 3 Chapter 11 Pulse Width Modulated Outputs input Yet once it is in the correct position the servo draws only minimum current required to maintain its position Hence being a closed loop controller an RC Servo is actually a much more efficient and effective positional control device for a limited range than a stepper motor which relies on a constant current in its winding to provide the holding torque for positioning The open loop nature of stepper motor means that it does not know if the device is actually being knocked out of its desired location whereas in the Servo any deviation from its desired location is instantly being corrected by the servo mechanism 11 4 1 Using Nano 10 PWM Output To Control RC Servo Non Isolated As you probably have realized by now that you can use a single PWM output to very easily position the RC Servo to whatever position within its range of travel However since the Nano 10 power supply is 24V vs 4 8 to 6V on the typical RC Servo and the PWM output is NPN current sink type the signal to the servo is actually inverted if you connect the PLC s da output to the Servo s control input directly 24V DC 4 8V to 6V Power DCPower For PLC For Servo Control amp
200. sful connection the GS cen RS E status should be Host Username Password Port Quickconnect v PA rT setae gt Connected and Directory SS Gorete directory listing listing successful Response 257 Command TYPE I Comma PORT 192168 1 190227 12 Also you should be able to esponse 200 OK Comandi ust see all three of the preloaded See Se listing successful e fi es i n th e re mote S ite reset Nes TTTTTT directory which is the bottom 2 9 Compute zl E right window shown here H S C OS D a Fi RECOVERY z The three files are 0 HTM in 2 HTM and N JS Filename Filesize Filetype Last modified Filename Filesize Filetype Last modified Permissior amp c Local Disk a af RECOVERY Local Disk ei 0 HTM 3 228 Firefox Doc 1 1 2007 nanna eS CD Drive X Blnys 10 783 JScript Scri 1 1 2007 RV m m 5 directories 2 files Total size 14 011 bytes Server Local file Direction Remote file Size Priority Status Queued files Failed transfers Successful transfers i D Queue empty ee Figure 2 9 3 If you are not able to connect to the Nano 10 server or if you can t get a successful directory listing then you should first double check the settings you have configured for FileZilla compared to the settings configured in the Nano 10 server The next thing to check is your Windows firewall which seems to affect Vista users mainly You can disable the firewall
201. signed automatically if your network supports this capability Otherwise you need to ask your network administrator for the appropriate P settings Use the following IP address Obtain DNS server address automatically Use the following DNS server addresses Prefered DNS server Altemate DNS server Figure 2 8 4 User s Manual Chapter 3 I O and Internal Relays Programming Now you want to highlight the Internet Protocol TCP IP item and click on Properties This will open up a new window that allows you to change the network settings for the Ethernet port that you selected The Ethernet hardware you are configuring is shown under Connect using in the current window By default your Ethernet settings will be configured to be obtained automatically in this case only the IP settings are set to be obtained automatically This setting will not work since the NANO does not have the ability to assign IP address to the PC s Ethernet port So you need to manually set the IP address and the Subnet mask The IP address should be on the same subnet as the IP address you have set for your PLC For example if your PLCs IP address is set to the default address of 192 168 1 5 then you should set your PCs IP address to be 192 168 1 xxx The xxx can be any number between 1 and 255 except for 5 your PC can t have same IP address as your PLC The Subnet mask should be set to 255 255 25
202. some fixed value to the first PLC on the list The PLC that has the token can then send host link commands to other PLCs When it has finished the job it can then send a command to the token master to relinquish its token If it is based on a fixed timing scheme the master can assume that the PLC will complete its job after a fixed time say 0 1 seconds and turn off its corresponding token relay bit The token master then passes the token to the next PLC on the list and so on until the last PLC has relinquished its token and the token is passed back to the first PLC on the list again This way at any one time there will only be one active network master the one with the token and hence there is no danger of conflicting signals or garbled messages to handle Pros and Cons This method also does not incur any hardware cost but it requires the programmer to draw up a plan on what internal relay or variable to use as the token and how the PLC can relinquish its token to the token master It could be by fixed timing or by returning a message to relinquish the token It is a challenging job for programmers unfamiliar with networking schemes but with some experimentation it can be achieved readily 15 5 4 3 Rotating Master Signal In this scheme we make use of the digital inputs of the PLC to grant the PLC the right to act as the network master Lets call this input the Be the Master input We can use a low cost H series PLC running a sequencer
203. sted IP Mobdus TCP UseTrusted IP FServer UseTrusted IP O Yes No Yes No ADC Calib hl Ch2 Ch4 Ch5 Ch6 Ch ch p 000x 20 fioo 25 feo e 50 fso feo Note The FServer can also be enabled to Zero Offset p o In Im o only allow connections from devices that DAC Cab i match one of the Trusted IP defined in 0 000x o In jo Jo this panel This is on top of the Zero Offset o bo ln i username password login sequence that ADC Moving Aug pers ci can be enabled disabled from the Basic ct dan nante dj Configuration screen In other words you can choose either security method to Retrieve Parameters from PLC E Reboot PLC after Save access the FServer or implement both Eg Basic Config security methods at the same time Se After you have defined the list of trusted fe Dong IP addresses and checked the Use Trusted IP radio button click on the i Save Parameters to PLC to save your Figure 2 4 1 data to the PLC s non volatile 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 2 4 3 Making A Modbus TCP Client Connection to Other Modbus TCP Server By using the Network Services commands described in Section 2 4 it is unbelievably easy for the Nano 10 PLC to be u
204. t deploy the MODBUS ASCII or RTU protocols 14 2 3 Interfacing Other Devices to Modbus TCP Host or to the Internet Since the Nano 10 PLC supports serial MODBUS protocols it can operate as a master PLC and serve as a gateway to interface non MODBUS enabled PLCs such as the H series and E10 PLCs or the l 7000 analog modules to third party SCADA software or MMI hardware that speaks MODBUS The Nano 10 PLC also makes it easy for these devices to be controlled or monitored over the Internet The master Nano 10 will use its RS485 port to pull data from these devices into its data memory The data memory in the Nano 10 is in turn accessible by a SCADA program using the Modbus TCP protocol Through the Nano 10 PLC these other connected devices thus become accessible from the Internet 14 2 4 Distributed Control Another important use of the RS485 port will be to connect a Nano 10 PLC to other Nano 10 F Series M series H series or E10 PLCs One of these PLCs will act as the master and all other PLCs will act as slaves Each PLC must be given a unique ID The master will send commands to all the slaves using the NETCMD or READMODBUS WRITEMODBUS READMB2 WRITEMB2 statements and coordinate information flow between the PLCs In this way a big system can be built by employing multiple units of Nano F M E or H series PLCs connected in a network This results in more elegant implementation of complex control systems and simplifies maintenance jobs
205. tal I Os and Internal Relays User s Manual Page 1 4 Chapter 1 Installation Guide 24V NANO 10 Limit Switch NANO O Normally Open ma gt NPN sensor OV OV Input logic 1 when Limit Switch is closed Input logic 1 when object is sensed Input Voltage for Logic 0 Open Circuit or 10V to 24VDC Input Voltage for Logic 1 OV to 2 5V DC Figure 1 5 Interfacing to Limit Switch and NPN Sensor 1 5 Digital Output Circuits 1 5 1 Electrical Specifications Output 1 amp 2 Output 3 amp 4 Output Driver type NPN Darlington Voltage free Contacts CT Isolated cca per output Maximum Breakdown Voltage Breakdown Maximum Breakdown Voltage sss S5V 1000V RMS 1000VRMS 1 min min Maximum Output Current 5A 24V 120VAC 2A 250VAC Continuous Output Current 5A 24V 1 20VAC 2A 250VAC Output Voltage when OFF Resistor pulled up to None 24V power rail Output Voltage when ON 0 2V 4A OV 2A Inductive Back EMF Bypass Yes None Intrinsic Zener 55V All outputs have red colored LED indicators The Nano 10 PLC employs sinking NPN type power MOSFET on its two solid state output 1 and 2 that turn ON by sinking current from the load to the OV terminal Note Output 1 and 2 can also be configured as 1 PWM outputs to drive heating elements or proportional valves using the SETPWM command please see Chapter 11 for more information 2 Stepper Motor Controller to send pulse
206. the CPU Any one or all of the Nano 10 s digital inputs 1 to 4 can be defined as interrupt inputs using the INTRDEF statement The Interrupt inputs may also be defined as either rising edge triggered input goes from OFF to ON or falling edge triggered input goes from ON to OFF or both using the following statement INTRDEF ch fn_num edge parameters ch channel number fn num Custom Function to execute when interrupt edge occurred This is the Interrupt Service Routine ISR edge 1 rising edge triggered 1 falling edge triggered 0 both rising and falling edge triggered When the defined edges occur the defined CusFn will be immediately executed irrespective of the current state of execution of the ladder program User s Manual Page 9 1 Chapter 9 Interrupts A simple interrupt test function is as follow E Custom Function 1 fnINTRDEF EEJ TRILOGI Version 6 14 D TESTINTRDEF PC6 LoL ENTRDEF 9 10 1 Define input 9 as r r File Edit Controller Simulate Circuit Help interrupt and ca z Custom Fn 10 SIGUR aeece BELE Quick Tags to service it Ast Scan dCusF KS Custom Function 10 A A 1 Variable A will be incremented on every rising edge sensed on Input 9 not available on Nano but available on F series PLCs Note 1 Since inputs 1 to 4 can also be used as other special inputs such as High Speed Counter HSC inputs and or Pul
207. the larger file will be corrupted and no longer accessible For Example the file O HTM is about 3 5kb so it takes up two 2kb locations 0 and 1 which is why the second preloaded file is 2 HTM If you attempted to add a file named 1 HTM it would corrupt O HTM but 1 HTM would work Uploading Files When you are ready to transfer your modified HTM file you just need to drag it from the folder it is saved to on your computer into the bottom right window of FileZilla where the current files are shown If you didn t change the filename you can tell the new file to overwrite the old file Otherwise you will need to manually delete the old file O HTM or 2 HTM from the Nano 10 server in FileZilla by right clicking on it and selecting Delete 2 9 4 Download the Web Page Files If you have modified the original O htm and 2 htm or N JS files that were preloaded in the Nano 10 server and need to retrieve the original files it is possible to download them from the following web page http www tri plc com nano updates nanoHMI zip Note that the N JS file within the above zip file is password protected so you will need the password to open it This information is stored at the beginning of the N JS file which can be opened with any standard text editor such as Notepad If you have lost this file then you will need to email support support tri plc com with proof of purch
208. the sensor will generate a series of pulses The frequency of this pulse train directly measures the rotational speed of the motor RPM Frequency x 60 and can be used to provide precise speed control Note that the above setup can also double as a low cost position feedback encoder when used with the high speed counter since the number of pulses counted can be used to determine the displacement With the Nano 10 PLC the pulses can be both counted and measured simultaneously on the same input 8 2 2 Measuring Transducer with VCO Outputs Some transducers incorporate a Voltage Controlled Oscillator VCO type of output that represents the measured quantities in terms of varying frequency of the output waveform Such transducers may be used conveniently by the Nano 10 PLCs using the pulse measurement capability However the frequency of such signals should be below the maximum input pulse rate 8 2 3 Measuring Transducer with PWM Outputs Some transducers may output the readings of their measurands the quantity that is being measured in the form of pulse width modulated outputs This means that the transducer would send rectangular pulses with varying duty cycles that are proportional to the measured quantities You can then easily use the PULSEWIDTH and PULSEPERIOD functions to compute the duty cycle of the incoming PWM pulses and readily convert it to the actual units of the measurands The Nano 10 PLC should be able to measure with reas
209. tly from within a custom function simply by assigning their present value counter to a desired value E g To start a 50 seconds timer TIMERPV 2 500 Timer 2 will time out 50 0 seconds later E g To decrement a counter or a sequencer CTRPV 10 CTRPV 10 I Counter 10 is decremented by 1 4 4 Programming Sequencers on Ladder Logic 4 4 1 Introduction TRILOGI Version 6 xx 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 Seq1 to Seq8 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 counter to be used by the sequencer can only assume label names Seq1 to Seq8 corresponding 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 step number for the program sequence in the Value column of the table A circuit that uses the special function Advance Sequencer AVSeq will need to be constructed 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 changes of the sequencer s execution condition from OFF to ON will advance increment the sequencer by one step This operation is actually identical to th
210. to activate the Be the Master input line of each PLC one at a time Each PLC is given a fixed amount of time to be the master e g 0 1s each Only when the Be the Master input is ON can the new master PLC start sending out host link commands to other PLCs So at any one time there will only be one master on the network and no conflict will occur as a result Pros and Cons This method is the easiest to program since there is no need to handle the token with the token master or perform extensive error check on the response string However this method uses one input of each PLC and as many outputs on the master signal generator PLC as there are PLC masters It also requires wiring the PLCs to the master signal generator PLC 15 5 5 TROUBLE SHOOTING AN RS485 NETWORK 1 Single faulty device If a single device on the RS485 network becomes inaccessible problems can be isolated to this particular device Check for loose or broken wiring or wrong DIP switch settings Also double check the device ID using the host link command IR sent via the RS232C port of the PLC If all attempts fail either replace the entire PLC or the 75HVD3082 chip that handles the RS485 interfacing and try again 2 Multiple faulty devices If all the PLCs are inaccessible by the host computer it may possibly be due to a faulty RS232C to RS485 converter at the host computer If this is the case disconnect the RS485 converter from the network and check it using
211. to one or multi drop manner If your PC already has an RS232 port or your already own a USB to RS232 converter then you can convert the RS232 port into RS485 port using the Auto485 adapter in order to communicate with the PLC If your PC only has USB ports then the easiest way is to purchase a USB to RS485 adapter U 485 which is port powered so you only need to connect two wires from the U 485 to the PLC s RS485 port to establish communication Programming via COMM1 is particularly useful if the Nano 10 PLC is not yet connected to the LAN and if your PC does not have a spare Ethernet port for direct connection see Section 2 8 that can be used for programming Another reason for programming via RS485 is if your Ethernet port default IP address is not compatible with the subnet of your network You will then need to connect i TRILOGI to the PLC via RS485 port in order to change the IP address User s Manual Page 14 1 Chapter 14 Serial Communications 14 2 2 Accessing 3 Party RS485 based Devices There are more and more industrial devices such as electric power meters analog I O modules e g the I 70xx modules by ICPDAS variable frequency drives servo controller etc that allows data communication via their RS485 port The Nano 10 PLC can readily use its RS485 port to communicate with these devices The PLC has many built in commands for reading writing to the serial port including built in commands for communicating with devices tha
212. ts from the public Internet to reach the devices on the private LAN In other words the NAT router allows the PLC outgoing access to the Internet but by default does not allow incoming access Most small NAT routers for home use such as those produced by Linksys Netgear D Link or Belkin do allow you to configure the router to open and forward a specific port number to a specific device on the private network For example if your PLC static IP address is 192 168 1 5 and you wish to open its FServer port 9080 but not its Modbus TCP port 502 to the public internet you would configure your router such that it will forward the incoming TCP IP packet destined for port number 9080 to the device at IP address 192 168 1 5 Once you have done that you will then be able to access the FServer from the Internet using the router s public IP address this is typically assigned by the Internet Service Provider and the port number 9080 However the Modbus TCP port is not accessible from the Internet since this port number is not opened and not mapped by the router You should read your router s User s Manual to find out how to configure the router to perform the port forwarding described above since each router model has a different user interface For example on the D Link DI 624 router you configure the router by clicking on the Advanced tab and selecting Virtual Server from the router configuration page as shown below
213. two channels of PWM on its digital outputs 1 and 2 PWM channel 1 and 2 Since both PWM outputs are high voltage high current outputs 24V 8A peak 4A continuous they can be used to directly control the speed of a small DC motor They can also directly drive proportional variable position valves whose opening is dependent on the applied voltage Note When using the PWM output to drive a motor or solenoid valve please take note of the need to add a bypass diode to absorb the inductive kick that will occur when the output current to the load is turned OFF as mentioned in Chapter 1 5 3 11 3 Increasing Output Drive Current Opto Isolated The advantage of using the PWM is that you can easily amplify the drive current to a larger load such as a larger permanent magnet DC motor by using a power transistor or power MOSFET to boost the current switching capability If the load is of a different voltage and the load current is high you should use an opto isolator to isolate the PLC from the load as in Figure 11 2 Flyback Diode Bridge Rectifier 4N35 Optoisolator 24V DC Power For PLC cesarea ene ermanno OUTPUTS 220K Spie ba E N channel Power MOSFET Voltage divider to obtain approx e g IRF530 can sink 12A DC 10V DC at gate G For DC48V at up to DC100V max load choose R1 3 9K R2 1K Figure 11 2 PWM Speed Control of a large DC Motor Note 1 The opto isolator must be able to operate at
214. ual Page 16 17 Chapter 16 Host Link Command Response Format 16 40 2 WRITE IR Registers This command refers to Table 14 1 in Chapter 14 to map the PLC s I Os to OMRON IR register space from IR000 to IR519 Command Format d d W R n n n n 16 16 16 16 NE EEE JME Device ID Header IR Start Addr Dec 1 data 16 rr Last data FCS Device ID Header Status FCS 00 OK E g To Write to CtrPV 1 to 2 using this command send OLWRO256xxxxyyyyff where xxxx and yyyy are the hex values to be written to CtrPV 1 amp 2 16 40 3 Read Data Memory DM 1 to DM 4000 Command Format eJfafafrfo nfnfnfn fefefel e rr EE soe r rr _ t Device ID Header DM Address Dec DM count Hex FCS Response Format e fafafr n sl el ie 1816 16 Fer ere __ e Device ID Header Status 1 Data Hex 00 OK 16 ee NT Last data FCS User s Manual Page 16 18 Chapter 16 Host Link Command Response Format E g To read DM 1 12 to 130 19 words send 01RD0112001357 The PLC will send return a response 01RD00xxxxvyyyzzzz 16 40 4 WRITE Data Memory DM 1 to DM 4000 Command Format e afafw ofnfnf n n 16 16 16 160 o EEE Device ID Header DM Start Addr Dec 1 data 16 Z Last data FCS Response Format Device ID Header Status FCS 0
215. unction 101 every 15 ms The Periodic Timer Interrupt runs independently of the ladder logic and its execution is therefore not affected by the total PLC program scan time User s Manual Page 9 2 Chapter 9 Interrupts When the PTI timer times up the CPU will suspend the execution of the ladder logic or a non interrupt TBASIC function and immediately calls up the custom function defined by the INTRDEF 18 statement However if the CPU is currently executing a user interrupt service routine e g an input interrupt or HSC interrupt then the CPU will have to complete the current interrupt service routine before it will run the PTI interrupt function Notes 1 Limit the use of PTI only for critical code that requires precise timing between two evenis Program bugs that occur due to problems in the PTI interrupt routine may be quite hard to debug 2 For normal periodic routines such as checking for temperature or checking serial port for incoming bar code data every few seconds it is better to use the system clock pulses e g Clk 1 0s to trigger a dCusF 3 Always try to keep your interrupt service routine short and simple and ensure that it will not end up in an endless loop The TBASIC custom function execution time should be much shorter than the period of the PTI events Otherwise you may find that the CPU will be spending most of its time servicing the PTI interrupt routine leaving very little time for scanning the ladd
216. ur system administrator on the required procedure User s Manual Page 2 23 Chapter 3 I O and Internal Relays Programming 2 8 Setting up Ethernet Communication Directly Between a PC and Nano 10 PLC With the Nano PLC it is possible to communicate through the Ethernet port directly from a PC in addition to connecting through a router This means that you can have a peer to peer connection between the Nano PLC and your PC without an Internet connection or any additional network equipment The PC being used would need a spare Ethernet port in order to do this This is useful because the Nano has a limited number of communication ports due to its small form factor and this is the only way to communicate with a PC if you don t have an RS485 port on your PC What You Will Need 1 A PC with a spare Ethernet port RJ45 connection 2 An Ethernet cable 3 ANano 10 PLC There are two types of Ethernet cables A standard straight through cable which is used in most situations and a crossover cable which is required when there is no auto switching hardware in either of the two Ethernet ports PC and PLC The Nano PLC does NOT have auto switching capabilities so it will depend on the PCs Ethernet port whether or not a crossover cable is required If you are not sure if your PC s Ethernet port is able to perform auto switching then it is best to use a crossover cable A crossover Ethernet cable will work in both situations but a straight thr
217. using TBASIC Another advantage for using LM34 instead of LM35 is that you can measure down to 0 F 17 degree C without using a negative voltage source as shown in the circuit on the right in Figure 5 5 5 3 3 Using Thermocouple Thermocouples are very rugged devices that are widely used in the industry because of their stability accuracy and wide functional temperature range They are commonly used in measuring temperature in ovens that may go up to several hundred degrees C However thermocouple output signals are in the range of tens of microvolts to mille volts which is too small to be measured by the Nano 10 s analog input directly You will need a signal conditioner that can amplify the thermocouple output to 0 5V which can then be connected to the PLC s analog input 5 3 4 Using PT100 Temperature Sensor PT100 is a positive temperature coefficient thermistor that is made from platinum It has the advantage of being very stable and highly accurate It is usually connected to a signal conditioner in a balanced bridge configuration and the signal conditioner will convert temperature changes to 0 5V output for the PLC 5 4 Calibration of ADC amp Moving Average Definition The ADC on the Nano 10 are factory calibrated such that a voltage of 2 500V should return a value of 2048 when read by the ADC n function However if there is a need to re calibrate the ADC you can follow the procedure outlined below To perform calibr
218. w as shown in Figure 4 1 below This will bring up the component tool bar in the gray area above the green circuit area KE TRiLOGI Version 6 13 Untitled File Edit Controller Simulate Circuit Help Circuit 1 QAQA vene quick Tags Figure 4 1 Creating Timer Circuit Once the component toolbar is shown you can place your activating contact by selecting the 1 component from the toolbar EIS and then selecting the activating contact from the I O Table The contact will then be automatically placed in the ladder logic circuit The same can be done for the timer coil by selecting the 7 component from the toolbar ES and then selecting a timer that has been entered into the I O Table Then a timer contact needs to be added as an input to a ladder logic circuit This contact will activate once the timer counts down This could be used to turn on an output a certain amount of time after the timer coil is activated Placing a timer contact in a circuit is the same as placing any contact in a ladder circuit except that the corresponding timer should be selected from the Timers section of the I O table After creating a ladder circuit that contains one input and one timer output and another ladder circuit that contains one timer contact and one output the ladder logic circuit should like something like Figure 4 2 below User s Manual Page 4 2 Chapter 4 Timers Counters amp Sequencers KE TRiLOGI Version 6 14 Untitled
219. when it Password C Yes G No fails to open the COM port The selected COM port Esseg Serial number is shown in a small text box below the Access Level 1 Programmer Ei Sa Serial Setup button so that you can see the COM5 currently selected COM port readily r Reset PLC After Save Exit Fi Successfully Retrieved Setup Data igure 2 1 5 Next click on the Retrieve Parameters from F PLC so that you can capture a copy of the current configuration stored in the Nano 10 PLC You can then selectively modify the parameters of interest The main difference between this standalone version of the F series Ethernet Configuration software and the built in version on i TRILOGI 6 3x is that the stand alone version can only communicate directly with the PLC via the serial port and it does not require the i TRILOGI or TLServer software The built in version in i TRILOGI on the other hand can communicate with the PLC through either locally via the serial port or remotely via the Ethernet connection The standalone version can be useful for OEMs who want to provide their customers a way to configure the Ethernet settings and or calibrate the ADC and RTC settings but don t want to provide access to the programming software However the OEMs must remember that their customers PC would require the RS485 interface converter to use this standalone software with the Nano 10 PLC User s Manual Page 2 7 Chapter 3 I O and Internal Relays P
220. y a 2 500V to the PLC s analog input 3 ADC 3 should return a value of 2 500 5 000 x 4096 2048 Note that the CPU only accesses the analog input n when the TBASIC function ADC n is called Hence in order to monitor the analog input you have to execute the ADC function periodically The frequency that the ADC function is called is known as the sampling rate and it depends on how fast the analog User s Manual Page 5 3 Chapter 5 Analog I Os data changes If the analog data changes slowly such as room temperature then there may be no need to sample the analog at high frequency A very simple example of sampling the analog input 1 to 2 every second and converting the data into voltage readings of 0 to 5000 which represents 0 to 5 000V is shown as follow IS Custom Function 1 ReadADC i FE TRILOGI Version 6 14 DA ReadADC PC6 File Edit Controller Simulate Circuit Help Minimize Circuit it 1 DAAA vene quick Tags Clk 1 05 ReadADC _______ ytfusr DM 11 to DM 14 contains readings from Analog input 1 to 4 FOR I 1 to 4 DM I 10 ADC I 5000 4096 NEXT Figure 5 3 You can examine the readings of DM 11 to DM 12 from the Online Monitoring View Variables DM n screen These readings represent the voltages measured at the analog input pins You can also read the raw ADC readings which will change in the range between 0 to 4095 from the
221. y the full load voltage Vu Since the voltage applied to the load is either Fully ON or Fully OFF it is highly efficient because the switching transistors are working in their saturated and cut off region and dissipate very little power when it is fully turned ON 11 2 Nano 10 PLC PWM Outputs Technical Specifications No of Channels Duty Cycle range 0 00 to 100 00 Worst case resolution Available Frequencies Hz 50Hz to 50 KHz Frequency Errors lt 0 01 100Hz lt 0 5 10KHz lt 2 50KHz Relevant TBASIC commands SETPWM User s Manual Page 11 1 Chapter 11 Pulse Width Modulated Outputs Unlike in the T100M PLCs which only support 8 fixed frequencies settings the PWM channels in the Nano 10 PLC can generate pulses with frequency ranging from 50Hz all the way to 50KHz At the lower frequency range the output frequency can be extremely accurate less than 0 01 error Even at 10KHz the output frequency error is less than 0 5 This makes it possible to use the PWM channels to generate square wave pulses of a certain frequency Usually it is better to select as high a frequency as possible because the resulting effect is smoother for higher frequencies However some systems may not respond properly if the PWM frequency is too high in such cases a lower frequency should be selected The TBASIC SETPWM statement controls the frequency and duty cycle settings of the PWM channel The Nano 10 PLC features
222. y transparent to the user and does not need to be handled by the user s program All Nano 10 PLCs support both the point to point one to one and multi point one to many communication protocols Each protocol has a different command structure as described below 15 3 Point To Point Communication Format In a point to point communication system the host computer s RS485 serial port is connected to the PLC s COMM1 At any one time only one controller may be connected to the host computer The host link commands do not need to specify any controller ID code and are therefore of a simpler format as shown below User s Manual Page 15 1 Chapter 15 Host Link Communication Protocol 15 3 1 Command Response Frame Format Point to Point Header Data Terminator Each command frame starts with a two byte ASCII character header followed by a number of ASCII data and ends with a terminator which is comprised of aw character and a carriage return ASCII value 13 The header denotes the purpose of the command For example RI for Read Input WO for Write Output etc The data is usually the hexadecimal representation of numeric data Each byte of binary data is represented by two ASCII characters 00 to FF To begin a communication session the host computer must first send one byte of ASCII character Ctrl E 05Hex via its serial port to the controller This informs the controller that the host computer wishes to send a point to

Download Pdf Manuals

image

Related Search

Related Contents

Installation Manual TSP200  USERS OPERATING MANUAL RG5000-E  XDVA0405 – XDVA0805 – XDVA1605 Videoregistratori digitali  Sega circolare portatile ISTRUZIONI PER L`USO E ISTRUZIONI DI  CRONOGRAMA ESTRU II B 2015  HP E5000 Quick Start Guide  User Manual - PATH medical Solutions  Choosing the right tools for the job  Hotpoint BG05 User's Manual  AVCHD Converter Utility  

Copyright © All rights reserved.
Failed to retrieve file