Comments (13)
Hi Brendan,
I agree that it would be helpful to have the data converted to the correct data types. For now, this can be done in a separate custom module. We will consider integrate this function in the module.
Thanks,
Stephen
from iot-edge-modbus.
from iot-edge-modbus.
Hi Brendan,
Correct me if I misunderstood anything.
The JSON configuration is for the Modbus module to know what read operations need to be done. Adding any custom key-value pair to the configuration will not influence the output message, since they are handled with different piece of code. Furthermore, the module won't understand what such "datatype" means because there's no code logic handling it and thus will simply ignore that. One easy way to accomplish your goal is to rely on the "Address" field of the output message. Modbus module will always output values per register and by Modbus spec it's uint16.
Take the following for an example.
Let's say you are trying to read two registers as a full voltage value.
{
"PublishInterval": "2000",
"SlaveConfigs": {
"Slave01": {
"SlaveConnection": "192.168.0.1",
"HwId": "PowerMeter-0a:01:01:01:01:01",
"Operations": {
"Op01": {
"PollingInterval": "1000",
"UnitId": "1",
"StartAddress": "400001",
"Count": "2",
"DisplayName": "Voltage"
}
}
}
}
[
{
"DisplayName":"Voltage",
"HwId":"PowerMeter-0a:01:01:01:01:01",
"Address":"400001",
"Value":"19775",
"SourceTimestamp":"2017-11-17 08:43:50"
},
{
"DisplayName":"Voltage",
"HwId":"PowerMeter-0a:01:01:01:01:01",
"Address":"400002",
"Value":"15650",
"SourceTimestamp":"2017-11-17 08:43:50"
}
]
In your custom module, you can always combine register 400001 and register 400002 as a float32 or whatever datatype you like.
Thanks,
Stephen
from iot-edge-modbus.
Close for inactivity. Reopen if you still want to discuss.
from iot-edge-modbus.
from iot-edge-modbus.
Hi Brendan,
I understand your concern. But I am not quite sure how I can modify the module to fit your request. Could you kindly provide a few example so I can look into it.
Thanks,
Stephen
from iot-edge-modbus.
This is tough on every one (cloud and edge) using this module. Now the edge v2 cloud developer has to write JSON configs for iot-edge-modbus module, and then JSON config for custom module all in sync. Then again, handle all borderline cases like failure to read one of registers of multi register type.
Also this case of Modbus is different from ble core[1] and ble_printer[2] where the ble_printer modules makes sense of data. Over there we are dealing with vast variety of varying BLE devices with varying specifications and types. That is different from this Modbus case where we can prespecify a set of data types.
from iot-edge-modbus.
Thanks for all the feedback. We will see how we can add this feature to the module.
from iot-edge-modbus.
Has there been any progress on adding the ability to define the data and byte swap types for an operation? I have upcoming applications that will require being able to do so, looking through some of the v2 preview documentation and code there are references to data types (Float, Int16 and Int32) and swap modes (BigEndian, BigEndianByteSwap, LittleEndian, LittleEndianByteSwap) but no mention of if they're implanted in the 1.0.5 release?
from iot-edge-modbus.
@whendric guidance is to use v2 for new workloads. We have designed it in a way to allow extensibility of data types etc. as you have figured out.
from iot-edge-modbus.
from iot-edge-modbus.
- Marketplace version is 1.x, we have not got around to publish v2 to marketplace yet, plan is to do that in near future but that shouldn't block you. You can still compile v2 and create iotedge module/container image from the solution. There's even an Azure DevOps pipeline definition in v2 to get you started.
- It's defined by "ValueType" which maps to "ModbusValueTypes" Enum in V2 code. More info on this available in unit tests project in v2 solution.
HTH
from iot-edge-modbus.
Close for inactivity.
from iot-edge-modbus.
Related Issues (20)
- No longer being maintained HOT 2
- Invoke method not working without internet HOT 2
- ‘Operation timeout expired’ error HOT 1
- Exception Code 2 - StartAddress being passed as 0 HOT 4
- Modbus TCP problem with Siemens PAC2200
- Update to new iotedge version HOT 2
- modbus tcp connection refused on Raspberry pi 3 HOT 3
- Data not being recieved in IoT Central HOT 3
- Please update RTU configuration in Readme.md HOT 2
- Windows Container Modbus module on Windows 10 1809 LTS supports RTU? HOT 1
- Only device that contains lots of registers, how to organize data? HOT 2
- Error building image HOT 2
- Support for arm64v8 HOT 3
- Add content properties to the message sent to the output HOT 4
- REAL type value is not correct in the output HOT 3
- Signalizing slave communication error HOT 1
- The While loop in the Start method freezes, when the module has more than 500 active operations HOT 2
- Cannot read data from slave HOT 2
- IoT Central Device template for iot-edge-modbus module HOT 1
- Module healthy but no data received from the device HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iot-edge-modbus.