mirror of
https://github.com/OpenLogics/MewtocolNet.git
synced 2025-12-06 03:01:24 +00:00
Move examples from root to /Examples
This commit is contained in:
31
Examples/Examples.ProgramReadWrite/Program.cs
Normal file
31
Examples/Examples.ProgramReadWrite/Program.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using MewtocolNet;
|
||||
using MewtocolNet.Logging;
|
||||
|
||||
namespace Examples.ProgramReadWrite;
|
||||
|
||||
internal class Program {
|
||||
|
||||
static void Main(string[] args) => Task.Run(AsyncMain).Wait();
|
||||
|
||||
//MewtocolNet.ProgramParsing.PlcBinaryProgram.ParseFromFile(@"C:\Users\fwe\Documents\sps\FPXH_C30_Test1.fp").AnalyzeProgram();
|
||||
|
||||
static async Task AsyncMain () {
|
||||
|
||||
Logger.LogLevel = LogLevel.Error;
|
||||
|
||||
using (var plc = Mewtocol.Ethernet("192.168.178.55").Build()) {
|
||||
|
||||
await plc.ConnectAsync();
|
||||
var prog = await plc.ReadProgramAsync();
|
||||
|
||||
if (prog != null) {
|
||||
|
||||
prog.AnalyzeProgram();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user