Human Readable list of all persistent variables #182
Replies: 2 comments 1 reply
-
Hi lpillsbury, TcClient = new TcAdsClient(); You can refer to this link - https://infosys.beckhoff.com/english.php?content=../content/1033/tc3_adsnetref/7313443979.html&id= |
Beta Was this translation helpful? Give feedback.
-
You would need to read the type information for the structure from the run-time. This can be done, but is not trivial.
An easier solution is to write your persistent data structures to json using the json library - this would give you a human readable file with the current values. Or use the xml data server. Either gives you a text file you can diff.
I gave up using persistent data a long time ago - it can get corrupted, losing all the data.
…On Fri, 1 Apr 2022, at 12:35, Hristo Ganchev wrote:
Hi lpillsbury,
If you use C# (surely it can be done on Python or any other language supporting ADS) you can use ADS communication to read all the symbol info of the PLC. Or you can give a path to the global list and read only specific global list.
TcClient = new TcAdsClient();
TcClient.Connect("127.0.0.1.1.1", 851);
// this is the example code where TcClient is connected to local NetID
TcSymbolInfo = TcClient.CreateSymbolInfoLoader().FindSymbol(path);
You can refer to this link https://infosys.beckhoff.com/english.php?content=../content/1033/tcsample_bdelphi/html/TcAdsOcx_Delphi_Sample02.htm&id= .
Tell me if this helps you.
Best Regards!
—
Reply to this email directly, view it on GitHub <#182 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AH3VKDSOCPIH7HNB5UIKFCDVC3NO7ANCNFSM5SGC7YWQ>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hi folks,
While this isn't specific to unit testing, you all know a lot about TwinCat and I'm hoping someone would know the answer to this problem.
I have different assets operating in the field and I want to know and keep track of all of the the persistent variables (that have been customized differently on each asset). I could log into each unit and look up each of the variables I need (or write a script to do so), but there are so many variables it will be hard to get them all manually. I’m wondering if there is any simple way to look up the values of all the variables on a running PLC or at least the persistent ones? The TwinCat built in utilities functions WritePersistentData or FB_WritePersistentData are exactly the sort of thing I want, but I haven't found a human readable way to access this output. Is there a different function to get a human readable output? Or anyone know how to read the outputs of these utilities?
Thanks so much!
Beta Was this translation helpful? Give feedback.
All reactions