C# & Libnodave Siemens PLC

mrludvig

Level-1
Beiträge
5
Reaktionspunkte
0
Zuviel Werbung?
-> Hier kostenlos registrieren
Hi all

Im facing a problem with my C# code.
Im reading 10 Bytes from the PLC, some integers and float. I want to update my WPF UI textbox continuously.

i use dispatch timer to run the code but my UI freeze. The first cycle is working fine, but when it starting second cycle it freeze.
Any help would be greatfull.
01.11.png




Ludvig
 
define the connection and open it only once and not with every tick.
before reading the bytes just check the connection status and restart it, if necessary.
 
may it is necessary to check the isReading state and do nothing while reading

e.g.
Code:
if (gLPlc.isReading)
                {
                    do { } while (gLPlc.isReading);
                }
 
Zuviel Werbung?
-> Hier kostenlos registrieren
Hi

Thanks for your reply.
I fixed my last issue, the problem was to bad definition to my connection. Just like Vierlagig told me... ;)
i got a new problem that i hope you guys can help me with..
In my project i need to have an alarm managment, and i want to read out 2 bytes and check whenever a bit is set and then throw out an alarm.
Do you guys have any example for this?


Thanks in advice.
 
Zurück
Oben