Skip to content

Commit 88a33ef

Browse files
Add example Modbus Diagnostic
1 parent ea431a0 commit 88a33ef

16 files changed

+4016
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<CONFIG>
3+
<ProjectOptions>
4+
<Version Value="12"/>
5+
<PathDelim Value="\"/>
6+
<General>
7+
<Flags>
8+
<CompatibilityMode Value="True"/>
9+
</Flags>
10+
<SessionStorage Value="InProjectDir"/>
11+
<Title Value="Modbus_Diagnostic"/>
12+
<ResourceType Value="res"/>
13+
<UseXPManifest Value="True"/>
14+
</General>
15+
<i18n>
16+
<EnableI18N LFM="False"/>
17+
</i18n>
18+
<BuildModes Count="1">
19+
<Item1 Name="Default" Default="True"/>
20+
</BuildModes>
21+
<PublishOptions>
22+
<Version Value="2"/>
23+
</PublishOptions>
24+
<RunParams>
25+
<FormatVersion Value="2"/>
26+
<Modes Count="1">
27+
<Mode0 Name="default"/>
28+
</Modes>
29+
</RunParams>
30+
<RequiredPackages Count="2">
31+
<Item1>
32+
<PackageName Value="lnetbase"/>
33+
</Item1>
34+
<Item2>
35+
<PackageName Value="LCL"/>
36+
</Item2>
37+
</RequiredPackages>
38+
<Units Count="12">
39+
<Unit0>
40+
<Filename Value="Modbus_Diagnostic.lpr"/>
41+
<IsPartOfProject Value="True"/>
42+
</Unit0>
43+
<Unit1>
44+
<Filename Value="unit1.pas"/>
45+
<IsPartOfProject Value="True"/>
46+
<ComponentName Value="Form1"/>
47+
<HasResources Value="True"/>
48+
<ResourceBaseClass Value="Form"/>
49+
<UnitName Value="Unit1"/>
50+
</Unit1>
51+
<Unit2>
52+
<Filename Value="unit2.pas"/>
53+
<IsPartOfProject Value="True"/>
54+
<ComponentName Value="Form2"/>
55+
<HasResources Value="True"/>
56+
<ResourceBaseClass Value="Form"/>
57+
<UnitName Value="Unit2"/>
58+
</Unit2>
59+
<Unit3>
60+
<Filename Value="utcp.inc"/>
61+
<IsPartOfProject Value="True"/>
62+
</Unit3>
63+
<Unit4>
64+
<Filename Value="uuart.inc"/>
65+
<IsPartOfProject Value="True"/>
66+
</Unit4>
67+
<Unit5>
68+
<Filename Value="uiwrapper.inc"/>
69+
<IsPartOfProject Value="True"/>
70+
</Unit5>
71+
<Unit6>
72+
<Filename Value="..\..\DatenSteuerung\uimodbus.pas"/>
73+
<IsPartOfProject Value="True"/>
74+
</Unit6>
75+
<Unit7>
76+
<Filename Value="..\..\DatenSteuerung\uiwrapper.pas"/>
77+
<IsPartOfProject Value="True"/>
78+
</Unit7>
79+
<Unit8>
80+
<Filename Value="..\..\DatenSteuerung\utcp.pas"/>
81+
<IsPartOfProject Value="True"/>
82+
</Unit8>
83+
<Unit9>
84+
<Filename Value="..\..\DatenSteuerung\ucrc.pas"/>
85+
<IsPartOfProject Value="True"/>
86+
</Unit9>
87+
<Unit10>
88+
<Filename Value="..\..\synapse\synaser.pas"/>
89+
<IsPartOfProject Value="True"/>
90+
</Unit10>
91+
<Unit11>
92+
<Filename Value="..\..\DatenSteuerung\uuart_deprecated.pas"/>
93+
<IsPartOfProject Value="True"/>
94+
</Unit11>
95+
</Units>
96+
</ProjectOptions>
97+
<CompilerOptions>
98+
<Version Value="11"/>
99+
<PathDelim Value="\"/>
100+
<Target>
101+
<Filename Value="Modbus_Diagnostic"/>
102+
</Target>
103+
<SearchPaths>
104+
<IncludeFiles Value="$(ProjOutDir)"/>
105+
<OtherUnitFiles Value="..\..\synapse;..\..\DatenSteuerung"/>
106+
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
107+
</SearchPaths>
108+
<Linking>
109+
<Options>
110+
<Win32>
111+
<GraphicApplication Value="True"/>
112+
</Win32>
113+
</Options>
114+
</Linking>
115+
</CompilerOptions>
116+
<Debugging>
117+
<Exceptions Count="3">
118+
<Item1>
119+
<Name Value="EAbort"/>
120+
</Item1>
121+
<Item2>
122+
<Name Value="ECodetoolError"/>
123+
</Item2>
124+
<Item3>
125+
<Name Value="EFOpenError"/>
126+
</Item3>
127+
</Exceptions>
128+
</Debugging>
129+
</CONFIG>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
(******************************************************************************)
2+
(* *)
3+
(* Author : Uwe Schächterle (Corpsman) *)
4+
(* *)
5+
(* This file is part of Modbus_diagnostic *)
6+
(* *)
7+
(* See the file license.md, located under: *)
8+
(* https://github.com/PascalCorpsman/Software_Licenses/blob/main/license.md *)
9+
(* for details about the license. *)
10+
(* *)
11+
(* It is not allowed to change or remove this text from any *)
12+
(* source file of the project. *)
13+
(* *)
14+
(******************************************************************************)
15+
program Modbus_Diagnostic;
16+
17+
{$mode objfpc}{$H+}
18+
19+
uses
20+
{$IFDEF UNIX}{$IFDEF UseCThreads}
21+
cthreads,
22+
{$ENDIF}{$ENDIF}
23+
Interfaces, // this includes the LCL widgetset
24+
Forms, Unit1, Unit2, uuart_deprecated, lnetbase;
25+
26+
{$R *.res}
27+
28+
begin
29+
RequireDerivedFormResource := True;
30+
Application.Initialize;
31+
Application.CreateForm(TForm1, Form1);
32+
Application.CreateForm(TForm2, Form2);
33+
Application.Run;
34+
end.
35+
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
# This script tests if cc exists
3+
# if it exists it will be started,
4+
# otherwise it will be build and then started.
5+
clear
6+
FILE="/sda5/sda5/Tools/Projects/Sample/TCP_IP/Modbus_Diagnostic/Modbus_Diagnostic"
7+
if [ -f $FILE ]; then
8+
$FILE &
9+
else
10+
lazbuild -B $FILE".lpi"
11+
$FILE &
12+
fi
13+
14+
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[General]
2+
Protocol=2
3+
Timeout=5000
4+
Client=42
5+
Register=45232
6+
Size=2 = 1 Register
7+
8+
[Seriel]
9+
Parity=Even
10+
Port=/dev/ttyUSB0
11+
Baudrate=19200
12+
13+
[ModbusTCP]
14+
Host=127.0.0.1
15+
Port=1234
16+
17+
[ModbusTCPRTU]
18+
Host=192.168.168.1
19+
Port=8000
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
(******************************************************************************)
2+
(* *)
3+
(* Author : Uwe Schächterle (Corpsman) *)
4+
(* *)
5+
(* This file is part of Modbus_diagnostic *)
6+
(* *)
7+
(* See the file license.md, located under: *)
8+
(* https://github.com/PascalCorpsman/Software_Licenses/blob/main/license.md *)
9+
(* for details about the license. *)
10+
(* *)
11+
(* It is not allowed to change or remove this text from any *)
12+
(* source file of the project. *)
13+
(* *)
14+
(******************************************************************************)
15+
(*
16+
* Set to enable Modbus RTU
17+
*)
18+
{$DEFINE useUUart}
19+
(*
20+
* Set to enable Modbus TCP
21+
*)
22+
{$DEFINE useTCP}
23+

0 commit comments

Comments
 (0)