yoyo
yoyo

Reputation: 69

Can you convert MODBUS to CANBUS?

I'm completely new to the space and i have a project that i would like to complete, the project is basically: extracting sensor data in the form of MODBUS than sending the data out through CANBUS. i already have a mod-bus input and a can-bus output.

researching into MODBUS has been a bit confusing so sorry if these questions seem a bit stupid.

Is it possible to write code which can convert MODBUS to CANBUS? or will i need external hardware. additionally, i'm looking to add a microprocessor to my dev board, is there anything in specific i should look for that would help with my modbus and canbus operations? or will any microprocessor work.

thank you

Upvotes: 0

Views: 3293

Answers (1)

Lundin
Lundin

Reputation: 213689

The basics of all data communication is the OSI model. Start there. Then you'll eventually find out that Modbus is an application layer protocol standard and CAN is a physical/data-link layer standard.

Therefore your question doesn't make any sense. You can't convert an application layer into a physical/data-link layer. You can however convert Modbus to some specific application tier protocol for CAN, such as for example CANopen, Device Net or J1939. Or a custom one.

The lowest layers underneath Modbus is UART and most likely RS-485. Possibly RS-232.

You will need a RS-485 or RS-232 transceiver between the Modbus sensor and your MCU. And you will need a CAN transceiver between your MCU and the CAN bus. Additionally, it is very strongly advised to pick a MCU with built-in CAN controller hardware.

Pick a target hardware that suits your project, don't pick some random dev board and then try to duct tape it with misc hardware to suit the project requirements.

However, the hardware is the easy part. Buying and configuring protocol stacks for whatever application protocols you are using is the hard and expensive part.

Also, there are lots of companies making gateways, so why re-invent the wheel. If you need to convert between for example Modbus and CANopen, these are both well-known industry standards. Consider just buying a gateway.

Upvotes: 3

Related Questions