'Is it easy to convert JSON to ModBus format?

I am currently looking for ways to convert data from JSON format to Modbus format, ideally a JS script that is readily usable in Node-RED. I thought such wouldn't take long to search given the wide application and usage of the two formats (especially in the IoT space) but boy I was dead wrong. After scouting thoroughly on YouTube and Google for a week, I failed to find any useful resources. However, when I inquired a few field veterans on this, they all told me it's a simple to write such conversion code and wanted to charge me for a day rate.

Question: Does anyone here knows how to do it/generous enough to share a sample JS code of such conversion? I believe script customisation will be heavily needed but having a sample to based on is really all I need now. Thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source