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 .
Thanks and Regards,
Kenneth
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
1 Like
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
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
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
Thanks for your information and help. I learnt more about the cyclic times and modbus in the process.
Best Regards,
Kenneth
1 Like