-
Notifications
You must be signed in to change notification settings - Fork 101
Description
Issue :
When we change isByteSwap and isWordSwap from False to true, both False and True produce the same result for dataType value is set to 64 bit
With 64 bit data type, byte swaps and word swaps do not work as expected, but they do work as expected with 32 bit data type.
Expected :
As long as isByteSwap and isWordSwap are both true, the results of False and True should vary as if they were 32 Bit or 64bit or anything what it is actually meant for (which data type).
Steps followed :
- In Edgex - Device profile added isByteSwap and isWordSwap as below
- description: ""
name: device_float
isHidden: false
tag: ""
properties:
valueType: Float64
readWrite: RW
units: ""
minimum: ""
maximum: ""
defaultValue: ""
mask: ""
shift: ""
scale: "0.1"
offset: ""
base: ""
assertion: ""
mediaType: ""
attributes:
isByteSwap: false
isWordSwap: false
primaryTable: HOLDING_REGISTERS
startingAddress: 4225
- Navigated to Device Command
Selected Floating device profile "device_float"
and have set device_float values as "999999999"
Observed Docker logs
level=INFO ts=2022-04-25T06:12:33.983200131Z app=device-modbus source=modbusclient.go:84 msg="Modbus client GetValue's results [66 2 160 95 31 176 0 0]"
level=INFO ts=2022-04-25T06:12:33.983425579Z app=device-modbus source=driver.go:155 msg="Read command finished. Cmd:device_float, DeviceResource: device_float, Float64: 9.99999999e+09 \n"
- Changed isByteSwap and isWordSwap to true
attributes:
isByteSwap: true
isWordSwap: true
primaryTable: HOLDING_REGISTERS
startingAddress: 4225
- Navigated to EdgeX - Device Command
Selected Floating device profile "device_float"
and have set device_float value as "999999999"
Observed Docker logs
level=INFO ts=2022-04-25T06:15:42.238756376Z app=device-modbus source=modbusclient.go:84 msg="Modbus client GetValue's results [66 2 160 95 31 176 0 0]"
level=INFO ts=2022-04-25T06:15:42.23880021Z app=device-modbus source=driver.go:155 msg="Read command finished. Cmd:device_float, DeviceResource: device_float, Float64: 9.99999999e+09 \n"
When we are changing isByteSwap and isWordSwap from False to true , both the results of False and True shows the same result in Docker logs (check - Observed Docker logs of Step 2 and 4).