Re: [MODBUS][DISCUSS] Improving handling of datatypes ...

2020-09-14 Thread Christofer Dutz
Sounds like a good plan ... :thumbsup: :) Chris Am 14.09.20, 13:58 schrieb "Ben Hutcheson" : Hi Chris, If it's ok, I would feel better about splitting the FieldHandler changes into a separate PR. It looks as though that would be a decent PR in itself as well as probably a

Re: [MODBUS][DISCUSS] Improving handling of datatypes ...

2020-09-14 Thread Ben Hutcheson
Hi Chris, If it's ok, I would feel better about splitting the FieldHandler changes into a separate PR. It looks as though that would be a decent PR in itself as well as probably a change to the build utils package. For this PR I'll update the Big Integer issue and add additional PLCValue types.

Re: [MODBUS][DISCUSS] Improving handling of datatypes ...

2020-09-14 Thread Christofer Dutz
Hi Ben, as long as we keep everything as open as possible (not tie it to Java or any other specific language) and it simplifies things: I'm all +1 to that. I guess you have a concrete idea ... how about you update your PR and then we'll merge all in one go as soon as we have your ICLA on file.

Re: [MODBUS][DISCUSS] Improving handling of datatypes ...

2020-09-14 Thread Ben Hutcheson
Hi, Thanks for the feedback Chris, means a lot. :) Otto, I hadn't put that together that the mspec was language independent definitely makes sense. We could use the pseudo types like we do in the spec already, uint 16, int 32, etc...? Chris, the aim of having the FileHandler class automatically

Re: [MODBUS][DISCUSS] Improving handling of datatypes ...

2020-09-14 Thread Christofer Dutz
And @Ben, I am not sure if you have already done that, but if you haven't it would be cool if you could fill out, sign and send to secret...@apache.org your ICLA. Cause your PR is a little more than I would consider a minor contribution. https://www.apache.org/licenses/icla.pdf Chris Am

Re: [MODBUS][DISCUSS] Improving handling of datatypes ...

2020-09-14 Thread Christofer Dutz
Hi Ben, thanks for that PR ... Just had a look at it and it looks really good to me. I think this way we would simplify the whole PlcValue handling quite a bit and we'll reduce the risk of having it right in one driver and wrong in another. But I have to admit that I don't quite understand

Re: [MODBUS][DISCUSS] Improving handling of datatypes ...

2020-09-11 Thread Otto Fowler
the MSPEC is supposed to be multi-language, so I don’t think java specific types would go into the file definition, but there might be another way to do something and have it generated correctly On September 11, 2020 at 17:05:06, Ben Hutcheson (ben.hut...@gmail.com) wrote: Hi, After creating a

Re: [MODBUS][DISCUSS] Improving handling of datatypes ...

2020-09-11 Thread Ben Hutcheson
Hi, After creating a PR for the modbus data types and moving the max/min checks and data conversion tasks to the individual PLCValue classes, the ModbusFieldHandler class has been reduced to a bunch of cases which map a Java Datatype to a PLC Datatype. Looking at the S7FieldHandler class it seems

Re: [MODBUS][DISCUSS] Improving handling of datatypes ...

2020-09-08 Thread Ben Hutcheson
Hi Chris, I'm not sure I follow your last email, I have pushed a commit to *hutcheb:Feature/ModbusDataType , *which includes some of the changes I've proposed. 1) Within

Re: [MODBUS][DISCUSS] Improving handling of datatypes ...

2020-09-08 Thread Christofer Dutz
Hi Ben, well the PlcValue types are based on the types used in the language they are used in. In PLC4C, which supports signed and unsigned types, I implemented them differently. Initially I thought that if the PlcValues would simply have a byte-array and a type, then it would be universal ...

Re: [MODBUS][DISCUSS] Improving handling of datatypes ...

2020-09-08 Thread Ben Hutcheson
Hi Chris, The case where PLC data types are mapped to 16 bit registers isn't a special case, as the Modbus protocol only supports 16 bit registers but it doesn't specify what format the data should be in,any PLC data type can be mapped to these and then passed over Modbus. It would definitely be

Re: [MODBUS][DISCUSS] Improving handling of datatypes ...

2020-09-08 Thread Christofer Dutz
Hi Ben ... Sorry for my email... I should really finish reading before replying :-( About your suggestion to add it to the type to the ModbusField ... I agree. But I would simply extend the Address string the same way the TIA addresses were extended. Cause the problem I'm seeing is that for

Re: [MODBUS][DISCUSS] Improving handling of datatypes ...

2020-09-08 Thread Christofer Dutz
Hi Ben, if you have followed the latest discussions here ... currently the modbus protocol supports 16bit integer values for registers and Boolean values for coils. The protocol doesn't directly support anything else. However I have seen that vendors use arrays of registers to support higher

Re: [MODBUS][DISCUSS] Improving handling of datatypes ...

2020-09-08 Thread Ben Hutcheson
Hi, Looking at the example I had with the hello-world-write example trying to write a String to the Modbus protocol. ava -jar plc4j-hello-world-plc4x-write-0.8.0-SNAPSHOT-uber-jar.jar --connection-string modbus://127.0.0.1:5467 --field-addresses 40010 -field-values 32000 The value 32000 then

Re: [MODBUS][DISCUSS] Improving handling of datatypes ...

2020-09-06 Thread Christofer Dutz
Hi all, well I doubt that we could really centrally handle this. If you have an idea how to unify this, I'd be happy for a suggestion. I guess most will have to be handled in the individual drivers themselves. But I really would like all drivers to support the same base-set of datatypes. Chris

Re: [MODBUS][DISCUSS] Improving handling of datatypes ...

2020-09-06 Thread Cesar Garcia
Hello, I think it can be applied from several points of view, the one typified as you indicate (HREGISTER: REAL) or (HREGISTER [2]), each one has its advantage. To be able to handle the types indifferently (specifically between Modbus and S7), I modify the field of the Modbus driver so that it

Re: [MODBUS][DISCUSS] Improving handling of datatypes ...

2020-09-06 Thread Ben Hutcheson
Hi, I ran into this issue this morning when using the hello-world-write example and trying to write to a Modbus connection. It looks like it assumed the input value is a string whereas the Modbus protocol doesn't have support for it yet. I was thinking about expanding

Re: [MODBUS][DISCUSS] Improving handling of datatypes ...

2020-09-02 Thread Christofer Dutz
Hi Julian, I agree ... if one driver would define an "INT" as 32bit integer and the others would treat it as 16bit ... that could be a problem. Perhaps having a statement of the project that we use the IEC 61131 types as a basis and if you want to use a given protocols different types, that you

Re: [MODBUS][DISCUSS] Improving handling of datatypes ...

2020-09-02 Thread Julian Feinauer
Hi, agree with your suggestion! Although we have to be careful to not mix it up with specific implementations of datatypes in some drivers. Julian Am 02.09.20, 15:21 schrieb "Christofer Dutz" : Hi all, today I was at a customer’s site and used the Modbus driver to get data. This