# Using Modbus program on another machine

**URL:** <https://community.br-automation.com/t/using-modbus-program-on-another-machine/7934>\
**Category:** B&R Software & Runtime\
**Tags:** modbus\
**Created:** [August 12, 2025, 9:43am UTC](https://community.br-automation.com/t/using-modbus-program-on-another-machine/7934 "2025-08-12T09:43:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kenneth.tham](https://avatars.discourse-cdn.com/v4/letter/k/FF8800/32.png) [@kenneth.tham](https://community.br-automation.com/u/kenneth.tham)\
**Post date:** [August 12, 2025, 9:43am UTC](https://community.br-automation.com/t/using-modbus-program-on-another-machine/7934/1 "2025-08-12T09:43:13Z")

</div>

Hi,

I have a modbus program using drv\_mbus that works fine on a test setup. I then ported the program to run on another PLC with the same modbus module (CS1030) attached.

However, the program does not seem to behave in the same manner. I noticed a modbus command takes about 2s to complete. Is this normal?

Also, I find that a read command does not seem to complete and I am not able to retrieve the correct values.

Does anyone know what could be the issue and is there anything I need to check between the 2 PLCs?

I am using code based on the example in [B&R Online Help](https://help.br-automation.com/#/en/4/libraries/drv_mbus/samples/c/ex_c1.html) .

Thanks and Regards,

Kenneth

---

<div class="post-metadata">

**Author:** ![stephan.stricker](https://dub1.discourse-cdn.com/brcommunity/user_avatar/community.br-automation.com/stephan.stricker/32/105_2.png) [@stephan.stricker](https://community.br-automation.com/u/stephan.stricker)\
**Post date:** [August 12, 2025, 2:35pm UTC](https://community.br-automation.com/t/using-modbus-program-on-another-machine/7934/2 "2025-08-12T14:35:01Z")

</div>

You could try to set the module to cyclic stream. Keep in mind that the module has to pass all data through the X2X bus. That means there will be some delay and limitations in terms of throughput. Some additional information would help to narrow down the issue.

- What is your X2X cycle time
- What modbus function to you call and how many registers do you read

 ![image](https://europe1.discourse-cdn.com/brcommunity/original/2X/f/fdb7b82ad5fa66ead7680d40ac01cce686cbc8c5.png)

---

<div class="post-metadata">

**Author:** ![kenneth.tham](https://avatars.discourse-cdn.com/v4/letter/k/FF8800/32.png) [@kenneth.tham](https://community.br-automation.com/u/kenneth.tham)\
**Post date:** [August 13, 2025, 4:56am UTC](https://community.br-automation.com/t/using-modbus-program-on-another-machine/7934/3 "2025-08-13T04:56:26Z")

</div>

Hi,

I set the X2X cycle time to 2000 microseconds. I also tried cyclic stream setting and setting other cycles times, but I still get the same behavior. I also tried to omit the ArEventLog logging, but it does not help.

I am using the write and read commands for the modbus module. I only read one register each time.

Thanks and Regards,

Kenneth

---

<div class="post-metadata">

**Author:** ![stephan.stricker](https://dub1.discourse-cdn.com/brcommunity/user_avatar/community.br-automation.com/stephan.stricker/32/105_2.png) [@stephan.stricker](https://community.br-automation.com/u/stephan.stricker)\
**Post date:** [August 13, 2025, 7:42am UTC](https://community.br-automation.com/t/using-modbus-program-on-another-machine/7934/4 "2025-08-13T07:42:24Z")

</div>

Hi,

can you post your current data module? When you say 2s for a modbus command, that means one read request or everything? What is the cylce time of the task that runs the modbus?

Stephan

---

<div class="post-metadata">

**Author:** ![kenneth.tham](https://avatars.discourse-cdn.com/v4/letter/k/FF8800/32.png) [@kenneth.tham](https://community.br-automation.com/u/kenneth.tham)\
**Post date:** [August 13, 2025, 8:15am UTC](https://community.br-automation.com/t/using-modbus-program-on-another-machine/7934/5 "2025-08-13T08:15:39Z")

</div>

Hi Stephan,

I have found the cause of the issue. It was due to a loose wire connection on one of the RS485 cables. This resulted in being able to send data, but not receive I think.

I did further debugging and found I always received the command status 20240, which was a timeout error (2s was the timeout I set). I then found that the wire was not connected properly.

[B&R Online Help](https://help.br-automation.com/#/en/4/libraries/drv_mbus/gen/errdrv_mbus.html)

Thanks for your information and help. I learnt more about the cyclic times and modbus in the process.

Best Regards,

Kenneth
