mycroes / Sally7

C# implementation of Siemens S7 connections with a focus on performance
MIT License
56 stars 22 forks source link

Small cast error in ConvertFromLong #19

Closed AndreDrubig closed 3 years ago

AndreDrubig commented 3 years ago

I tested you great software and i got errors with writing all long data types. I was looking and i found mistake in ConvertFromLong() in ToS7Conversions.cs line 64 ConvertFromInt((int) value >> 32, 1, output);. Now the cast is done before the shift but it should be fist shift and than cast: ConvertFromInt((int) (value >> 32), 1, output); I came after this by looking at the hexadecimal values in the PLC.

mycroes commented 3 years ago

Thanks a lot! Will try to fix this ASAP (busy schedule though, no promises).

mycroes commented 3 years ago

Just released v0.10.0, which includes the above fix. Thanks again for reporting!