Hi,
Compiling and testing plc4j Modbus this morning on the plc4go branch, when
writing a WCHAR it looks as though it is trying to parse it as a PlcSTRING
and then trying to get the integer value.
Exception in thread "main" java.lang.NumberFormatException: For input
> string: "c"
> at
> java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
> at java.base/java.lang.Integer.parseInt(Integer.java:652)
> at java.base/java.lang.Integer.parseInt(Integer.java:770)
> at org.apache.plc4x.java.api.value.PlcSTRING.getInteger(PlcSTRING.java:124)
> at
> org.apache.plc4x.java.api.value.PlcValueAdapter.getInt(PlcValueAdapter.java:131)
> at
> org.apache.plc4x.java.modbus.readwrite.io.DataItemIO.staticSerialize(DataItemIO.java:726)
> at
> org.apache.plc4x.java.modbus.protocol.ModbusProtocolLogic.fromPlcValue(ModbusProtocolLogic.java:424)
> at
> org.apache.plc4x.java.modbus.protocol.ModbusProtocolLogic.getWriteRequestPdu(ModbusProtocolLogic.java:294)
> at
> org.apache.plc4x.java.modbus.protocol.ModbusProtocolLogic.write(ModbusProtocolLogic.java:181)
> at
> org.apache.plc4x.java.spi.optimizer.BaseOptimizer.lambda$optimizedWrite$2(BaseOptimizer.java:116)
> at
> org.apache.plc4x.java.spi.optimizer.BaseOptimizer.send(BaseOptimizer.java:141)
> at
> org.apache.plc4x.java.spi.optimizer.BaseOptimizer.optimizedWrite(BaseOptimizer.java:116)
> at
> org.apache.plc4x.java.spi.connection.AbstractPlcConnection.write(AbstractPlcConnection.java:161)
> at
> org.apache.plc4x.java.spi.messages.DefaultPlcWriteRequest.execute(DefaultPlcWriteRequest.java:69)
> at
> org.apache.plc4x.java.examples.helloplc4x.write.HelloPlc4xWrite.run(HelloPlc4xWrite.java:67)
> at
> org.apache.plc4x.java.examples.helloplc4x.write.HelloPlc4xWrite.main(HelloPlc4xWrite.java:90)
>
Also noticed a RAT check on go.sum and the plc4go/...../model folders
haven't been ignored.
Kind Regards,
Ben
On Fri, Oct 23, 2020 at 4:38 AM Christofer Dutz <christofer.dutz@c-ware.de>
wrote:
> Hi all,
>
> now that I have a read-only version of a PLC4Go Modbus driver ready, I
> would like to merge back all the stuff I did.
>
> As with every new language there are minor tweaks needed to get the code
> generated in all languages, I would like these changes back in develop asap
> in order to also keep the PLC4Py initiative in-sync.
>
> If there are no objections, I would do this on Monday.
>
> So please feel free to investigate the changes … currently these should be:
>
>
> * Some minor name changes in mspecs for protocols where names collide
> with go reserved names (function, error, …)
> * Enums now support string types as base-type
> * Stings no longer need the encoding in mspec (default is UTF-8)
> * Auto generated “valueOf” method were renamed to enumForValue as for
> Sting types enums the built-in valueOf(String) collided
> * Renamed the PlcString to PlcSTRING (to match the other types)
> * Moved the Unit-Test and Integration-Test xmls into the protocol
> modules (currently bundled in test-jars)
> * In S7 bumped some enum base-types to unsigned counterparts as the
> hex-values were sometimes out of range for a signed type (all languages
> except java)
> * Modbus: Switched the modbus mspec to use the new named types for
> DataIo instead of using constants (First step for a shared PlcValueHandler)
>
> Hope I got them all …
>
> If you find something that’s worth discussing … please do so. If no
> objections come in, I’ll merge it on Monday
>
> Have a nice weekend,
>
> Chris
>
|