You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@plc4x.apache.org by "alison-gravley (via GitHub)" <gi...@apache.org> on 2023/05/22 17:18:39 UTC

[I] [Feature Request]: UDT Examples (plc4x)

alison-gravley opened a new issue, #959:
URL: https://github.com/apache/plc4x/issues/959

   ### What would you like to happen?
   
   PLC/Protocols:
   Not sure which one below is for AB PLCs, I think EIP? Specifically Logix and Compact Logix PLCs. Also Siemens (S300, 1200, and 1500) and probably OPC UA. All are over Ethernet connections. The table [here](https://plc4x.apache.org/users/protocols/index.html) seems to suggest that EIP is not supported? 
   
   I would like to have a POJO for UDTs. I tried to find an example in your repo and it looks like the OPM requires the tag address to be hardcoded? We would have multiple tags of the same type. Potentially hundreds of the same type. This is the first time I have used this library and I am pretty lost. We are using Java with microservices (Spring Boot) and we would like to use open source libraries if possible.
   
   I used [PLCIO](https://www.ctiplcio.com/), which is paid, for a few years at my previous company, and it was pretty nice to use, for C at least. One of the nice utilities it had was a discovery program that scans all of the tags in the PLC and then it could spit out C style structs for any UDTs, with a special conversion string you can pass once you get the plc read part of your program. I think it can work without the conversion string, but their manual doesn't mention it.
   
   What I am trying to accomplish is this:
   Create POJOs of PLC structs/UDTs that are commonly used in our programs. These may be fairly nested. Similar functionality to jackson xml/json.
   
   Then, we would have our list of tags to read via polling, or subscription if supported, using the root tag name in the case of a struct, or the normal types such as BOOL, DINT, STRING, etc. We would like the UDTs to map to a registered POJO, or however you would need to do it.
   
   Example:
   POJO without nested UDTs. 
   ```
   package com.mycompany.devicecommunication.plc4x.UDT;
   import lombok.Data;
   
   @Data
   public class HoldStatusRequestUDT {
       //Do I use PlcDINT, PlcBOOL, etc  type or just an int, log, etc?
       //Probably need some sort of Alias annotation, or make the field name exactly the same as the PLC.
       private boolean TRIGGER;  
       private int sequenceId;
       private String barcode; 
   }
   ```
   
   List of tags of type "HoldStatusRequestUDT" that we would read from
   SCAN100_REQ
   SCAN101_REQ
   SCAN102_REQ
   
   ![image](https://github.com/apache/plc4x/assets/5222103/c545d7f4-4490-46f9-b354-5d3e766e3ae6)
   
   and then I would expect updates for each tag and when we read, we would be able to map those values into the POJO.
   
   Please let me know if this is already possible and maybe an example or two of how to do it. Thank you!
   
   ### Programming Languages
   
   - [X] plc4j
   - [ ] plc4go
   - [ ] plc4c
   - [ ] plc4net
   
   ### Protocols
   
   - [ ] AB-Ethernet
   - [ ] ADS /AMS
   - [ ] BACnet/IP
   - [ ] CANopen
   - [ ] DeltaV
   - [ ] DF1
   - [X] EtherNet/IP
   - [ ] Firmata
   - [ ] KNXnet/IP
   - [ ] Modbus
   - [X] OPC-UA
   - [X] S7


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@plc4x.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Feature Request]: UDT Examples (plc4x)

Posted by "chrisdutz (via GitHub)" <gi...@apache.org>.
chrisdutz commented on issue #959:
URL: https://github.com/apache/plc4x/issues/959#issuecomment-1558658711

   Ok ... making good progress on my ControlLogix setup ... however it seems that the Logix Designer in the Lite edition doesn't seem to support UDTs ... so guess I won't be able to test this feature.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Feature Request]: UDT Examples (plc4x)

Posted by "chrisdutz (via GitHub)" <gi...@apache.org>.
chrisdutz commented on issue #959:
URL: https://github.com/apache/plc4x/issues/959#issuecomment-1557697130

   Hi,
   
   well actually you're joining the party to the exact right time ;-) ... Today I finally got the last parts delivered for setting up my CompactLogix controller ... we recently got quite a major refactoring of the existing EIP driver. However I wasn't able to actvely test it ... till now. 
   
   So it is possible to read the tags and datatype information from the PLC and to read and write these UDT (User Defined Types ... for the others). 
   
   We have somerhing similar in the Beckhoff ADS driver ... however the default is returning a map of strongly typed PlcValue objects (Objects wrapping the typical IEEE datatypes). 
   We also have OPM (Object Persistence Mapping???) ... which you could use to annotate POJOs ... however this is a tool that hasen't received any updates for the last years. In theory it would make sense to combine the two ... to pass in an annotated class type and to receive populated objects, but that would be something someone would have to work on ... maybe you? ;-)
   
   So I will be working on the EIP driver quite a lot in the next 1,5 months ... However can't I do any pormisses as another paid gig has priority over this.
   
   However, if you want to help working on this, any help is greatly appreciated and I would be happy to help you.
   
   Interested?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Feature Request]: UDT Examples (plc4x)

Posted by "chrisdutz (via GitHub)" <gi...@apache.org>.
chrisdutz commented on issue #959:
URL: https://github.com/apache/plc4x/issues/959#issuecomment-1558707974

   Scrap that last message of mine ... thankfully @hutcheb knows his AB stuff and he pointed out that UDTs are a quite essential part of the Studio 5000 software and I actually found it ... it just seems that they moved the location of the UDTs from the top-level of the tree ...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org