logo Welcome, Guest. Please Login or Register.
April 24, 2014, 10:23:35 PM
Home Help Search Login Register
 News: Self-Registration temporarily suspended due to abuse.To Register as a member, please email to webmaster@triplc.com with your email and username.

  Internet PLC Forum
  General
  Frequently Asked Questions
(Moderator: support)
  Tech Tip & Sample Codes
? previous next ?
Pages: [1] Go Down Reply Notify of replies Send the topic Print
   Author  Topic: Tech Tip & Sample Codes  (Read 3041 times)
support
Global Moderator
*****

Posts: 2729





View Profile WWW E-Mail
Tech Tip & Sample Codes
« on: March 22, 2012, 02:15:59 PM »
Reply with quote

As per a user's suggestion, we will attempt to post links for sample programs in this forum thread.

The first place to find sample programs is to look in your TRiLOGI installation folder path as follow:

i-TRiLOGI

  C:\TRiLOGI\TL6\usr\samples

WinTRiLOGI

  C:\TRiLOGI\WTL3\

You can find many well-commented ladder logic and ladder+TBASIC sample programs there.

Also if you are new to ladder logic, you may like to download the free PLC programming eBook from our website at:

http://www.tri-plc.com/reqplcbook.htm

All the examples in the book are created using i-TRiLOGI program so you can enter and simulate them immediately using your i-TRiLOGI simulator.

Note: The book main focus is to explain ladder logic programming and it does not cover TBASIC.
« Last Edit: March 22, 2012, 05:29:46 PM by support » Report to moderator   Logged

Email: support@triplc.com
Tel: 1-877-TRI-PLCS
support
Global Moderator
*****

Posts: 2729





View Profile WWW E-Mail
PLC-Specific Sample Programs
« Reply #1 on: March 22, 2012, 02:24:29 PM »
Reply with quote

Nano-10 PLC

  http://www.tri-plc.com/trilogi/Nano10Samples.zip

F-series PLC

  http://www.tri-plc.com/trilogi/FPLCsamples.zip
« Last Edit: March 22, 2012, 06:13:01 PM by support » Report to moderator   Logged

Email: support@triplc.com
Tel: 1-877-TRI-PLCS
support
Global Moderator
*****

Posts: 2729





View Profile WWW E-Mail
Modbus Master Sample Programs
« Reply #2 on: March 22, 2012, 04:57:04 PM »
Reply with quote

The PLC can easily act as a Modbus master to read or write to any 3rd party devices that support the Modbus RTU, Modbus ASCII or Modbus/TCP protocols.

1)Built-in Modbus functions

Built-in READMODBUS, WRITEMODBUS, READMB2 and WRITEMB2 commands can be configured to use the MODBUS function 03, 04, 06 and 16 to communicate with Modbus slave. The following are sample programs for communicating with the Modbus RTU slave:

http://www.tri-plc.com/trilogi/Built-inModbusMasterFunctions.zip

Program fragment for communicating with a Modbus/TCP server (over Ethernet) is already contained in the TestEthernet.PC6 file that is stored in your i-TRiLOGI samples folder as follow:

  C:\TRiLOGI\TL6\usr\samples\ 


2) Modbus functions implemented using TBASIC

Although there is no built-in function to communicate with Modbus RTU slaves using Modbus function code 01, 02, 05, it is possible to create these functions using TBASIC low level INCOMM and OUTCOMM commands.  Sample programs can be downloaded from:

http://www.tri-plc.com/trilogi/TBASICModbus.zip

The zip file also includes two sample programs constructed in TBASIC to use function 04 and 06 in order to run on older T100MD+ PLCs that do not support the Modbus function code 04 or 06.
« Last Edit: March 22, 2012, 06:20:16 PM by support » Report to moderator   Logged

Email: support@triplc.com
Tel: 1-877-TRI-PLCS
support
Global Moderator
*****

Posts: 2729





View Profile WWW E-Mail
Temperature Measurement
« Reply #3 on: March 22, 2012, 06:11:00 PM »
Reply with quote

1) Measuring temperature using 10K Thermistors

Thermistors can be used to measure temperature in many different environments. They are both rugged as well as low cost but are non-linear device.  The application note below explains how to physically connect a 10K Precon thermistor to the PLC using the PLCs on board ADC as well as how to use a look up table and interpolation method to calculate accurate temperature readings from the non-linear thermistor inputs.

http://www.tri-plc.com/appnotes/ThermistorSensor.zip

2) Measuring temperature using LM34 Semiconductor sensor

This is explained in Section 5.3.2 of the Nano-10, FMD or F-series PLC User's Manual. Please download the relevant manual from:

http://www.tri-plc.com/documentlist.htm


« Last Edit: March 22, 2012, 06:14:22 PM by support » Report to moderator   Logged

Email: support@triplc.com
Tel: 1-877-TRI-PLCS
support
Global Moderator
*****

Posts: 2729





View Profile WWW E-Mail
Serial Port HMI Sample Projects
« Reply #4 on: March 26, 2012, 04:17:54 AM »
Reply with quote

1) MMI6050 As the Master and PLC as Slave
 
    http://www.tri-plc.com/KEPHMI.zip

2) MMI6050 As Slave and PLC as the Master

    http://www.tri-plc.com/MMI6050_as_slave.zip

« Last Edit: March 26, 2012, 04:19:37 AM by support » Report to moderator   Logged

Email: support@triplc.com
Tel: 1-877-TRI-PLCS
support
Global Moderator
*****

Posts: 2729





View Profile WWW E-Mail
Visual Basic Programs For Communicating with PLCs
« Reply #5 on: June 25, 2012, 02:34:41 PM »
Reply with quote

All Super PLCs (Nano-10, FMD and F-series) support both Modbus protocol and the native "Hostlink" protocol. PC programmers can choose protocol that they are most comfortable to work with in order to communicate with the PLC.

To assist users who wish to communicate with these PLCs using the native Hostlink protocol, a few Visual Basic sample programs have been written, tested and posted online which can be downloaded from:

http://www.tri-plc.com/appnotes/AppnoteMain.htm

« Last Edit: June 25, 2012, 02:35:54 PM by support » Report to moderator   Logged

Email: support@triplc.com
Tel: 1-877-TRI-PLCS
support
Global Moderator
*****

Posts: 2729





View Profile WWW E-Mail
General purpose Lookup Tables
« Reply #6 on: October 14, 2012, 01:31:00 AM »
Reply with quote

Look up Table is a powerful technique used for computing data of a non linear function. For example, the resistance of typical NTC thermistors do not vary linearly with the temperature change. If you supply a constant current source to an NTC thermistor you will obtain a voltage value that can be read by the ADC input, but the readings do not vary linearly with the temperatures and therefore you can't simply use a formula to calculate the temperature corresponding to a particular analog reading.

However, since all thermistor manufacturers supply resistance vs temperature tables for their thermistor, you can therefore compute the corresponding ADC values and enter these values into a "look up table".  When you obtain an ADC reading you can then search the LUT to find the temperature that match the analog reading.

Of course very often the data obtained may not match the LUT data exactly since the table only provide discrete data points, a linear interpolation technique is typically used to find data that fall between two table points.

Other uses of LUT  can be to compute the square, trigonometric or logarithm function and their inverse without floating point support.

To assist user in implementing a LUT quickly, we are providing two LUT examples which can be downloaded from the following link:

http://www.tri-plc.com/download/LookupTables.zip

One of the example implements a square and a square root function, and the other implements a SINE and Inverse SINE function. These two programs are almost identical except for the data values that are stored into the lookup table.

You can copy the standard lookup table functions supplied in the sample program and use them in your program immediately without modification. All you need to modify is the INIT function that populate the lookup table with data that are relevant to your project. Using the supplied code you should find it very easy to implement other look up tables such as COSINE, LOG, pressure sensor, force sensors etc. 
« Last Edit: October 14, 2012, 01:52:03 AM by support » Report to moderator   Logged

Email: support@triplc.com
Tel: 1-877-TRI-PLCS
Pages: [1] Go Up Reply Notify of replies Send the topic Print 
? previous next ?
Jump to: 


Login with username, password and session length

Powered by MySQL Powered by PHP Internet PLC Forum | Powered by YaBB SE
© 2001-2004, YaBB SE Dev Team. All Rights Reserved.
Valid XHTML 1.0! Valid CSS!