Integrating Lintouch and Classiclader
From LintouchWiki
The goal of this tutorial is explain the integration of Lintouch and Classicladder.
Classicladder is a simple but powerful program for Ladder and Grafcet programming. It makes your computer to act like a PLC. Lintouch and Classicladder integration is possible through Modbus/TCP, but some details must be led in account.
1 - Classicladder is compiled to work in port 9502 so you can run it as a normal user, any application needs privileges to open ports < 1024, but some applications, mainly in others OS, only works in port 502. Then is interesting to recompile the source code to work in port 502;
2 - Classiladder have 50 inputs and outputs physical, and 1000 variables (inputs= %I, outputs= %Q, bits= %B and words= %W); we will work with B. For example, if you want to change the output Q0 to ON and visualize it on Lintouch, it could be like this:
I1 Q0
-||----------------------()
| B1
|---()
Or:
I1 Q0 -||----------------------() Q0 B1 -|/|---------------------()
For acquire the data in Lintouch, make a connection of type Modbus/TcpMaster, and in the configuration window of this connection, define the following data:
- Host: IP of machine that is running the classicladder, or "localhost" if on the same computer;
- Port: If you are using the original Classicladder (not recompiled) use the value 9502, if you recompile it, then use 502;
- Others: Use default;
Now, make the variable for connection, choose type Bit, and in address input CO1 (that's the capital letter O), press Ok.
Draw windows for test:
In editor, select Display tab and click Rectangle Lamp, then click on Panel window. Double click on the lamp, the window properties will appear, in tab Inputs choose the newly created connection and in Variables choose the bit variable created, press Ok.
Save the application and then start the app in runtime mode by clicking the arrow , and you see that when to change the state of the I1 input in Classicladder, the color of rectangle change.
