Coder Social home page Coder Social logo

twincatadstool's Introduction

TwinCatAdsTool

.NET Core Build The TwinCAT Tool you ever wanted and your lite alternative to visual studio

Features

  • View, save and restore a Backup of all persistent variable
  • Compare different backup
  • Search, explore or observe the symbols of a plc

Requirements

This software requires Twincat ADS installed.

In order to get connected with a PLC you also need to setup a route.

Get more information here or download ADS.

Credits

This software was sponsored by

and was realized with Twincat.JsonExtension

twincatadstool's People

Contributors

fbarresi avatar temmat avatar thomasstangl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

twincatadstool's Issues

Connecting to Device

When multiple IPC's are on the same network. Tool is able to find all the devices but not able to connect to any of them until a root has been added for the device in Beckhoff router. Is this how it is suppose to work?

Reading/writing structures as objects vs resolving to single element access

This is an issue (or aggregation of issues) in the sense that the approach to reading/writing the tool uses limits its usability with several real-world Beckhoff PLC applications I came across, more than it being some kind of a direct bug or error.

Firstly, I have several PLC application at hand (third party but also some of my own) that declare persistant variables somewhere inside function blocks or even nested function blocks within multiple instance function blocks that do not have "IsPersistent" flag at top level, but neither would it make sense nor be appropriate to read them out as objects at top structure level, because it would mean we would read out variables -and potentially write them back - that were not designed to be persistent by the software engineer. (Note that this might inherently not be problematic since all it would require is a subsequent PLC restart to loose the non-persistent variable values, but anyway that's just something to be aware of.)
So ... several persistent variables in real-world applications using function blocks, nested UDTs and other OOP approaches are not taken care of by the TwinCatAdsTool. (But they could be with a non-complicated addition - please read on.)

Secondly, persistant variable backups are often used, for security reasons (meaning from the possibility of loosing vital setting values, recipe data and similar) when upgrades are made to PLC programs. That includes changes to UDT/structure or function block changes. With the approach used for writing in the TwinCatAdsTool - or specifically the underlying TwinCar.JsonExtension WriteJson / WriteRecursive if there are new elements added to structure / FB definitions on the PLC, which are not not in the previously saved json file, then a "Null object cannot be converted to a value type" is produced. (Beckhoff's own local approach using the .bootdata file for backup does not have this problem in such situations for example.)
So ... json file backup produced with TwinCarAdsTool can't be used to write values back to the PLC if structure / FB definition are augmented - specifically if elements are added - removing elements actually seems to go through without problems. (But thus could also be functional with a non-complicated addition of a similar nature as for the first point - please read below.)

Both issues / real-world situations could be solved or improved on by the possibility of resolving the variable tree down to the actual lowest element level both for reading (and checking if the variable is actually persistent) and writing instead of stopping at the top object/structure level. The second approach could be just by using an absolute "flat" variable structure approach instead of a hierarchical tree approach. Both come down to dealing with individual variable elements.
This could and should be implemented as an on-demand read and write processes, (that is in addition to the existing ones) because the user should be aware and able to chose whether to use the current "hierarchical/object" approach or the "by elements" approach based on what needs to be done. The "by elements" approach could potentially cover all needs, but it probably should not, because it is theoretically a much slower and intensive process for the ADS communication channel.

I suppose this could be implemented on the level of the TwinCatAdsTool, but some supporting functions could be added on the JsonExtension level too - specifically for writing.

Just to see if my argument has any merit I tried a simple brute force addition (as in dirty and quick) to the WriteVariables task in RestoreViewModel.cs, by adding a WriteVariables_Elements (and it's own separate trigger Restore button) so that it resolves the structure futher instead of calling clientService.Client.WriteJson when p.Value is JObject. I know a recursive approach with maximum depth limitation should be used but I just nested some levels of foreach loops to check it out. It works ... this way I can use TwinCadAdsTool to backup variables...change/add to the the structure definition on the PLC and write back the previously stored variable values in case of disaster (which I simulated in this case with a Reset Origin on the PLC).
Something similar could be attempted for the reading side in the ReadPersistentVariables method.

Thinking about it further a "flat" approach might be even better in the end because it could cover other situations too and include arrays with changing index limits, but that might be a further evolution.

Please take this "issue" as a constructive endeavor towards making the Tool even more useful for occasions and purposes where it currently doesn't help and are quite present in real-world - including some Beckhoff's own PLC program implementations.

Best regards.

Problem signature using program in PLC CX5120 Windows 7

Hello, I'm trying to start the program directly inside the PLC to point and read its variables, but the program gives me this error:

Problem signature:
Problem Event Name: APPCRASH
Application Name: TwinCatAdsTool.exe
Application Version: 1.0.0.0
Application Timestamp: ddb21eed
Fault Module Name: KERNELBASE.dll
Fault Module Version: 6.1.7601.24540
Fault Module Timestamp: 5ddf3fbb
Exception Code: e0434352
Exception Offset: 0000845d
OS Version: 6.1.7601.2.1.0.320.65
Locale ID: 1033
Additional Information 1: 0a9e
Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
Additional Information 3: 0a9e
Additional Information 4: 0a9e372d3b4ad19135b953a78882e789

Read our privacy statement online:
http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409

If the online privacy statement is not available, please read our privacy statement offline:
C:\Windows\system32\en-US\erofflps.txt

The OS PLC is Windows 7. How I can run this program?
Thanks
Massimo

Support not-global persistent variables

As mentioned in #14 the Software is designed for looking only for global persistent variables. Any other persistent parameter not global reachable is ignored.

Goal

Support all persistent variables

Problems

  • Search may last longer
  • Restore action cannot be applied in batches (because an FB or a Pgr cannot be serialized as json)

Approaches

  • Add a custom section into the backup json (like {"$_non-global":{...})
  • maybe with a deep search disabled by default, but with manual switch

Add to graph in 1.1.38

In version 1.0.30, I had the option to add a variable to the graph. In the newest version, this button is gone. How do I add to graph in the newest version?

Reading never finishes

I'm trying to use this tool to backup some important Persisted data. I can connect to my target, but when I click read from plc, The message Reading GVL.gDryingDialData appears and nothing else happens. This variable is a global persisted var and is not very big. about 400 bytes total. I also was not able to find the logfile output anyhwere? where does the log get stored? Also whats the Select A Connection dropdown for? It always has an * with no other options.

Support for multidimensional arrays

I would like to send you my project with all persistent vars. I can read vars from PLC and save the file to PC.
I change the value (for example: Pers_CC._Setting[2][1]._DimensioneCass from 0.0 to 580.0) using Notepad++ and then load this file to TwinCAT ADS Tool. Pushing the button WRITE, I receive an error and nothing are written to PLC.

Please are you able to find the problem and to fix this? Thanks very much.

Massimo

Backup_2020-07-07-111226.zip

TestFB.zip

Very looong time to read/write

Hello, I'm using a CX5130 PLC and my program use about 8500 persistent vars.
I have a big problem reading/writing persistent vars: It takes a lot of time (about 45minutes using v.1.2.16 or 35 minutes using v.1.1.51).
Attached is the file of vars.
Backup_2021-12-09-172159 new 1.2.16.zip

What do you think about this problem?

update: using v.1.0.27 installed in PLC it takes 8 minutes to read vars and 1,5 minutes to write them. (15.000 vars)

Write Variable Value - uses "old"-Value

Write Variable do not uses the new value from input-field.

Maybe fixed in ExploreView.xaml (Line 81 - change to TwoWay Mode)
<xctk:DoubleUpDown Value="{Binding NewValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="100"/>

Problems on restoring Variables

I have a problem with restoring variables:
The json file is complete with all variables correctly backed up, but restoring is not complete.
It seems to restore correctly all multidimensional array vars, but not the simple vars.
Attached there is my example.

The only vars non restored are:
HmiSpazioTeoricoPreReale : REAL;
HmiMisuraPaccoMinimo : REAL;
HmiEnableConfermaPacco : BOOL;
HmiIdProgressivoPacco : UDINT;
HmiDataPrecedente : WORD;
HmiNastro_1_TantiPacchi : BOOL;
HmiTimeOutPreImbustatrice : DINT;
HmiTimeOutPreEtichettatrice : DINT;
HMIMisuraScadenzaAttesaPacco : INT;
HmiTerenConApplicatore : BOOL;
HmiTerenConMati : BOOL;
HmiGiraPacchiFORZATO : BOOL;

I hope that I'm able to explain correctly the situation and that you are able to fix the problem.

Actually, after restored vars, I compare json file with PLC and fix manually all vars not restored...

Thanks in advance.
Massimo

Teren-CX5130-4024_10-TcXaeShell.zip
Backup_2020-08-31-085438.zip

Writing back a variable value of type TIME doesn't work

Reading a persistant variable of type TIME works correctly (time value displayed is ok), but writing it back doesn't work.
There seems to be a problem with parsing the json string to the actual data type.

Error displayed is (example) "Error converting value "00:00:00.3000000" to type 'Twincat.PlcOpen.TIME',

(value readout is actually correct of T#300ms)

This occurs at least from version 1.1.48 and newer, haven't had the chance to check older.

Add description of variables

Do you think it is possible to add this feature? In .json file, after every variable, add the description of the same variable?

Thanks.
Your application is very very useful!

Massimo

Compare tab displays "empty" colored rows

The Compare tab doesn't display legible data - both when loading from a file or reading from a PLC. It seems it actually loads the data for comparison because there are colored rows displayed, but no actual data is visible.

Building and launching from source in debug mode produces numerous binding errors on this tab.
I haven't had the chance to check this further in depth. Will update if there is enough time.

Build error NETSDK1151

Please take notice that as of .NET 5.0.300 there are some additional checks done regarding project referencing in VS and there's an error NETSDK1151 building the current source code (1.20.11 as speaking)

Since the point is not having separate runnable exe files, it's probably OK to just include
<ValidateExecutableReferencesMatchSelfContained>false</ValidateExecutableReferencesMatchSelfContained>
in the configuration for the TwincatAdsTool project to solve the problem.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.