Unhandled Exception TempAnlage

Wenn die TempCAN keine Verbindung aufgbauen kann wird keine Unhandled Exception mehr ausgegeben
This commit is contained in:
HuskyTeufel
2021-03-11 16:47:08 +01:00
parent 09ec9b1cd1
commit 6df0d11cca
2 changed files with 14 additions and 3 deletions

View File

@@ -26,8 +26,18 @@ namespace TempCAN
{
IPConnection ipcon = new IPConnection();
BrickletTemperature t = new BrickletTemperature(UID, ipcon);
ipcon.Connect(HOST, PORT);
try
{
ipcon.Connect(HOST, PORT);
}
catch(Exception)
{
erfolg = false;
ipcon = null;
t = null;
return;
}
short temp;
try
{