chrisdutz commented on issue #2377:
URL: https://github.com/apache/plc4x/issues/2377#issuecomment-3611342706

   Well ... I think we really should remove the option to pass in raw values to 
write operations. The ideal way would be to pass in a PlcValue. This would have 
fired an error the moment you tried to create it. The other way just contains 
way too much potential for things going wrong.
   
   ```
           PlcValue val = new PlcINT(0x8000);
           System.out.println(val);
   ```
   
   This results in:
   
   ```
   org.apache.plc4x.java.api.exceptions.PlcInvalidTagException: Value of type 
32768 is out of range -32768 - 32767 for a PlcINT Value invalid
   
        at com.toddysoft.connect.java.spi.values.PlcINT.<init>(PlcINT.java:87)
        at 
com.toddysoft.connect.java.s7.tags.S7TagTest.testDataBlockShortPattern_NonBoolTypeWithBitOffset_ShouldError(S7TagTest.java:526)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
   
   ```
   (Ignore the different package ... I just tested that in my commercial 
offering)


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to