-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
61253d3
commit 6a2314e
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
applications/Clients/MTConnect.NET-Client-Example-01/EntityClient.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using MTConnect.Clients; | ||
|
||
//var deviceName = "OKUMA-Lathe"; | ||
//var deviceName = "M12346"; | ||
|
||
//var agentUrl = "localhost:5006"; | ||
//var agentUrl = "localhost:5005"; | ||
//var agentUrl = "http://localhost:5001"; | ||
//var agentUrl = "http://DESKTOP-HV74M4N:5001"; | ||
//var agentUrl = "https://localhost:5002"; | ||
//var agentUrl = "https://DESKTOP-HV74M4N:5002"; | ||
var agentUrl = "localhost:5000"; | ||
//var agentUrl = "192.168.1.136:5000"; | ||
//var agentUrl = "mtconnect.mazakcorp.com:5719"; | ||
//var agentUrl = "https://trakhound.com"; | ||
|
||
|
||
for (int i = 0; i < 1; i++) | ||
{ | ||
var client = new MTConnectMqttClient("localhost", interval: 1000); | ||
//var client = new MTConnectHttpClient(agentUrl); | ||
//var client = new MTConnectClient(agentUrl, deviceName); | ||
//client.Interval = 100; | ||
//client.Heartbeat = 10000; | ||
//client.ContentEncodings = null; | ||
//client.ContentType = null; | ||
client.DeviceReceived += (sender, device) => | ||
{ | ||
Console.WriteLine($"Device Received : {device.Uuid}"); | ||
}; | ||
client.ObservationReceived += (sender, observation) => | ||
{ | ||
Console.WriteLine($"Observation Received : {observation.DataItemId} = {observation.GetValue("Result")} @ {observation.Timestamp}"); | ||
}; | ||
client.AssetReceived += (sender, asset) => | ||
{ | ||
Console.WriteLine($"Asset Received : {asset.AssetId}"); | ||
}; | ||
|
||
client.Start(); | ||
//client.StartFromBuffer(); | ||
//client.Start("//*[@type=\"PATH_POSITION\"]"); | ||
} | ||
|
||
Console.ReadLine(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters