Comments (17)
Hi all - the feature to determine the strucuture of UDT's for a controller has been released and can be used in libplctag.NET v1.0.10.
See https://github.com/libplctag/libplctag.NET/blob/master/src/Examples/CSharp%20DotNetCore/ListPlc.cs for an example program
from libplctag.net.
It depends what you're asking about...
- If we know the structure of the UDT, can we pull all the values, either individually or as one object? Yes
- If we are given a PLC, can we discover the structure of a UDT on that PLC? No
The discovery of UDT (and other 'subtags') is something that I'd love to see @kyle-github support in the base libplctag
library. It's basically a required feature for most of my professional work. But, it's complicated and made even more so by the fact that libplctag
supports multiple PLCs, some of which don't even have the concept of UDTs.
Depending on how it actually works for Logix 5000 PLCs, it might be a feature we can support in just the .NET library (maybe with a libplctag.net.CLogix extension package or something).
from libplctag.net.
Hi thank for the comment. The answer that I would like to know is from point 2. Hope that the new feature to get 'subtag' can be implemented in this library.
from libplctag.net.
Can you tell us a little more about your use-case? I'm assuming CLogix, right? And it sounds like you don't know the PLCs tag structure at C# compile time? Are you looking for a particular tag or a number of instances, or what? Even if you can auto-discover at runtime from the PLC, things can get really dynamic really quick depending what you are trying to do with the discovered tags... Whatever you can share would be helpful.
Another option - would it be feasible to use an L5X that's read in at runtime to enumerate tags?
from libplctag.net.
I am actually doing real-time data collection by getting data from PLC and stored into database. For the ease of usage for this library, I had created an user interface for this work so that the user interface can be deploy in different machine. For my user interface, I able to retrieve a list of tag available in the PLC, which including the tagname, datatype, array size, etc. Unfortunately, the UDT type, I only able to get the tagname and its UDT name, but not the property name inside the UDT ('subtag'). The reason why I need to get 'subtag' is because there are some useful information that required to get the value from 'subtag'.
from libplctag.net.
I do plan to support this as soon as possible in the core library, but at this point, it is stacked up behind completion of the new event core. I just got this to read a tag in a PLC-5, so while it is making progress, it is far from finished. All the tag-metadata operations will be based on the new core as it drastically reduces the amount of code required.
Unfortunately, I cannot provide ETAs for this work. My day job is keeping me very busy and while COVID means fewer outside activities, I do need to spend time with my family :-) I had hoped to get the event core completed over the holiday break, but only got the happy path flow to work for PLC-5 last night.
That's a long way of saying that the UDT operations are a priority but I cannot give an ETA yet as a key project is in front of it.
from libplctag.net.
No problem, take your time. Just part of my suggestion for this improvement. Will be very useful in future if the feature is available.
from libplctag.net.
It looks like this one is outside the scope of the .NET wrapper project - is somebody OK to move this to https://github.com/libplctag/libplctag?
from libplctag.net.
The core library will support this similar to how it supports tag listing. A lot will be left to the upper layers. I would keep this open. I may just do direct raw CIP support as that it going to be a lot easier with the new internal core. I went back and forth on the right level before so I am not sure. It would be nice to have *Logix tags automatically use symbol IDs instead of name segments. Less overhead and faster responses.
from libplctag.net.
Are there any issues in the core library that this can be linked against?
from libplctag.net.
@kyle-github - I imagine this could be a lot like the "@tags" in that it's really more of a data parsing problem than a protocol issue? And pretty specific to a PLC type?
from libplctag.net.
Very specific to at least a PLC make. AB only supports tag listing of any kind in some PLCs. I.e. not in Micro800 apparently. To list out "tags" in a PLC-5, SLC or MicroLogix, it appears that you need to read out a fair amount of the PLC's low level memory structures and decode them. I have not looked too hard for examples for that.
I will be looking for examples of how to pull in multiple UDTs at a shot. The docs do not give too many details.
from libplctag.net.
For anyone who stumbles upon this thread, support will depend on some implemtation in the core libplctag library. Conversation is tracked here: libplctag/libplctag#231
from libplctag.net.
Can you update list all tag in UDT(@udt/...) for .NET?
@kyle-github @timyhac
from libplctag.net.
@TrongViet94 Support will depend on some implemtation in the core libplctag library. Conversation is tracked here: libplctag/libplctag#231
from libplctag.net.
Hi team - there is a pre-release version of libplctag which supports accessing of UDT definitions - Kyle has been discussing (see libplctag/libplctag#231 (comment)).
There is some support for this in a branch on libplctag.NET - see https://github.com/libplctag/libplctag.NET/blob/%23124-udt/src/Examples/CSharp%20DotNetCore/ListUdtDefinitions.cs
To run this you'll need to get the pre-release version of the core library and use plctag.ForceExtractLibrary = false
.
The output will look something like this:
Id=4046 Name=ASCIISTRING82 NumFields=2 Size=88
Name=LEN Offset=0 Metadata=0 Type=196
Name=DATA Offset=4 Metadata=82 Type=8386
Id=3970 Name=COUNTER NumFields=8 Size=12
Name=CTL Offset=0 Metadata=0 Type=211
Name=PRE Offset=4 Metadata=0 Type=196
Name=ACC Offset=8 Metadata=0 Type=196
Name=CU Offset=3 Metadata=7 Type=193
Name=CD Offset=3 Metadata=6 Type=193
Name=DN Offset=3 Metadata=5 Type=193
Name=OV Offset=3 Metadata=4 Type=193
Name=UN Offset=3 Metadata=3 Type=193
Id=3971 Name=TIMER NumFields=6 Size=12
Name=CTL Offset=0 Metadata=0 Type=211
Name=PRE Offset=4 Metadata=0 Type=196
Name=ACC Offset=8 Metadata=0 Type=196
Name=EN Offset=3 Metadata=7 Type=193
Name=TT Offset=3 Metadata=6 Type=193
Name=DN Offset=3 Metadata=5 Type=193
Id=3969 Name=CONTROL NumFields=11 Size=12
Name=CTL Offset=0 Metadata=0 Type=211
Name=LEN Offset=4 Metadata=0 Type=196
Name=POS Offset=8 Metadata=0 Type=196
Name=EN Offset=3 Metadata=7 Type=193
Name=EU Offset=3 Metadata=6 Type=193
Name=DN Offset=3 Metadata=5 Type=193
Name=EM Offset=3 Metadata=4 Type=193
Name=ER Offset=3 Metadata=3 Type=193
Name=UL Offset=3 Metadata=2 Type=193
Name=IN Offset=3 Metadata=1 Type=193
Name=FD Offset=3 Metadata=0 Type=193
Id=2908 Name=AB:1769_DO16:I:0 NumFields=2 Size=8
Name=Fault Offset=0 Metadata=0 Type=196
Name=ReadBack Offset=4 Metadata=0 Type=195
.....
from libplctag.net.
NICE!
from libplctag.net.
Related Issues (20)
- Array tag notification on change HOT 1
- Array of BOOL ErrorBadParam HOT 2
- ASP.Net error HOT 6
- Unable to load DLL plctag or one of its dependencies HOT 4
- List all tags in Omron NJ: ErrorUnsupported HOT 20
- How to batch read multiple tags at once? HOT 3
- Tag write timing HOT 4
- DotNetFramework can not work HOT 2
- Read array tags for Omron PLC broken with v1.4.0 HOT 85
- Using `raw_tag_type_bytes` for dynamic tags HOT 2
- Allow `AutoSyncReadInterval` and `AutoSyncWriteInterval` to be set after tag is Initialized HOT 1
- Expose `max_requests_in_flight` on `Tag` or `Tag<M,T>`. HOT 4
- LibPlcTagException ErrorNullPtr HOT 3
- Accessing Union Tag on Omron HOT 16
- Provide a way to get raw bytes from tag buffer, specifying an offset and length HOT 1
- Remove Mapper system (`Tag<M,T>`, `IPlcMapper`, `DintPlcMapper`, `TagReal` etc). HOT 14
- UDT ID / Tag Type HOT 9
- Net Framework 4.5 HOT 3
- Compile with custom core C library HOT 8
- Improvements to deployment of core libraries in libplctag.NativeImport
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libplctag.net.