Re: [DISCUSS] Change PlcField interface
One other thing … I think we need to replace the getNumberOfElements/GetQuantity with something else. I’ve defined a new Type ArrayInfo, which contains a from and a to index of an array. In case of single values, the arrayinfo list would be empty. If we use a simple array, it would have the “from” set to 0 and the “to” to the array size, if a to and from is provided, these values would be used. As there are multi-dimensional arrays, I would make this a list. List getArrayInfo() Chris From: Christofer Dutz Date: Saturday, 5. November 2022 at 15:35 To: dev@plc4x.apache.org Subject: [DISCUSS] Change PlcField interface Hi all, no matter if we’re going to rename the PlcField to PlcTag, I think now is the time to give the interface a little cleanup: We currently have: Java: Class getDefaultJavaType() String getPlcDataType() int getNumberOfElements() Go: GetAddressString() string GetTypeName() string GetQuantity() uint16 I would like to: Java: Strin getAddressString() PlcValueType getPlcValueType() Int getQuantity() Go: GetAddressString() string GetValueType() values.PlcValueType GetQuantity() uint16 I think as we’e mapping all values returned to a fixed set of standard PlcValues, the getDefaultJavaType doesn’t really make much sense anymore. Also would I like to restrict the data-type to only the valid PlcValueType elements. Using anything else here doesn’t make much sense for me, as we don’t have any PlcValue implementations to wrap other types. A fieldHandler can continue to for example parse an “INT16” (which we don’t support) to it’s PLC4X representation “INT” and would simply set the field to PlcValueType.INT. This would make many areas in our code a lot more typesafe. What do you think? Chris
[DISCUSS] Change PlcField interface
Hi all, no matter if we’re going to rename the PlcField to PlcTag, I think now is the time to give the interface a little cleanup: We currently have: Java: Class getDefaultJavaType() String getPlcDataType() int getNumberOfElements() Go: GetAddressString() string GetTypeName() string GetQuantity() uint16 I would like to: Java: Strin getAddressString() PlcValueType getPlcValueType() Int getQuantity() Go: GetAddressString() string GetValueType() values.PlcValueType GetQuantity() uint16 I think as we’e mapping all values returned to a fixed set of standard PlcValues, the getDefaultJavaType doesn’t really make much sense anymore. Also would I like to restrict the data-type to only the valid PlcValueType elements. Using anything else here doesn’t make much sense for me, as we don’t have any PlcValue implementations to wrap other types. A fieldHandler can continue to for example parse an “INT16” (which we don’t support) to it’s PLC4X representation “INT” and would simply set the field to PlcValueType.INT. This would make many areas in our code a lot more typesafe. What do you think? Chris
Re: Configuring and using plc4x
Hello Mihai, First of all welcome to the mailing list. :-) I hope that you managed to subscribe. Did you have a look here: https://plc4x.apache.org/users/blogs-videos-and-slides.html ? https://youtu.be/SNFKqrLMIZI this hands on should give you a good starting point on how to get started with our Java Driver talking to S7. If you have further questions. Please let us know. The best way is to also have some code running. So that you can show us where you got stuck. Helps us improve documentation and hopefully help you further. :-) Kind regards otluk Am Sa., 5. Nov. 2022 um 12:15 Uhr schrieb Mihai Demian < mihai.dem...@easyea.ro>: > Hello, > My name is Mihai Demian, I am from Romania and I own an automation firm > (with no > activity yet, unfortunately). > Looking for ways to make a plc communicate with a pc, I came across plc4x. > I have an old laptop at home, running as a small home server (the best I > could, I am very > new to Linux world), and I downloaded and installed (with ./mvnw install). > It took me a > while, the distribution had some bugs in it with missing licences in > header ( >) and then some wrong references, but I cannot remember the files. I > managed to correct > the issues and install it. > I also have 2 plcs Siemens S7-1200 connected on the same network as the > server. From > my understanding of OPC Server, the server takes care about the > communication with the > plc and the client (user's computer) connects to the server and reads and > writes data > from/to the plc. At my current employer, OPC Server and a custom app > developed in-house > is the default way of doing things. > Can you help me figuring out how to make them "talk" to each other? I want > to be able to > offer this option to companies. > > Thank you very much. > -- > Cu stima, / Best regards, > Mihai Demian > Administrator & PLC Programmer > Easy Engineering and Automation SRL[1] > > > [1] https://easyea.ro >
[DISCUSS] Rename Fields -> Tags?
Hi all, I’m currently working on harmonizing our different API variants a bit and hopefully finalizing our Browse API (Which sort of wen’t through multiple levels of change between Java and Go, back to Java and now back to Go. One thing I learned at Rivian is, that everyone seems to be talking about “Tags” on PLCs. So I asked on LinkedIn and it seems pretty obvious that “Tag” seems to be the term mostly used in the automation industry. So, I would like to consequently rename “Field” to “Tag”. What do you folks think? Chris
Configuring and using plc4x
Hello, My name is Mihai Demian, I am from Romania and I own an automation firm (with no activity yet, unfortunately). Looking for ways to make a plc communicate with a pc, I came across plc4x. I have an old laptop at home, running as a small home server (the best I could, I am very new to Linux world), and I downloaded and installed (with ./mvnw install). It took me a while, the distribution had some bugs in it with missing licences in header () and then some wrong references, but I cannot remember the files. I managed >to correct the issues and install it. I also have 2 plcs Siemens S7-1200 connected on the same network as the server. From my understanding of OPC Server, the server takes care about the communication with the plc and the client (user's computer) connects to the server and reads and writes data from/to the plc. At my current employer, OPC Server and a custom app developed in-house is the default way of doing things. Can you help me figuring out how to make them "talk" to each other? I want to be able to offer this option to companies. Thank you very much. -- Cu stima, / Best regards, Mihai Demian Administrator & PLC Programmer Easy Engineering and Automation SRL[1] [1] https://easyea.ro