CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum
Deutsche Version English version russian version 
It is currently Wed Jun 20, 2018 12:01 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Mon Mar 12, 2018 5:11 pm 
Offline

Joined: Wed Oct 25, 2017 10:03 am
Posts: 5
Hi everyone,

I'm using the following setup:
- Raspberrry Pi 3 as Modbus RTU Master (MODBUS_COM_Port_1)
- Arduino UNO as Modbus RTU Slave
both are connected via USB
I use ModbusSerial library for Arduino from here:

https://github.com/andresarmento/modbus ... /libraries

I tested the Arduino with qModMaster on my Windows-PC via USB port. This worked well as you can see in the screenshots. Therefore I assume that the Arduino setup and code are correct.
Further, I also assigned the RaspberryPi USB Com Port described here:

viewtopic.php?f=21&t=6755&p=14284&hilit=modbus+rtu#p14284

But as you can see in the screenshot, the Modbus slave is not running (red triangle) and status of Modbus Slave is 'Bus error'.
Thank you for your help!


rKtiC


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Mon Mar 12, 2018 7:35 pm 
Offline

Joined: Thu Nov 23, 2017 4:32 pm
Posts: 22
Hi

I used this code


sudo nano /etc/CODESYSControl.cfg

[SysCom]
Linux.Devicefile=/dev/ttyUSB
portnum := COM.SysCom.SYS_COMPORT1;


sudo /etc/init.d/codesyscontrol restart

try it

also make sure that in the point of updating the variables you have a mode (always in the task of the bus cycle) number 2.

But this will not be the only problem with the modbus rtu

After the reboot, you will have a loss of communication between Arduino and Raspberry

I have not been able to solve this problem yet.

If you find solutions please let me know

Good luck


Top
   
PostPosted: Mon Mar 12, 2018 9:03 pm 
Offline

Joined: Mon Dec 11, 2017 3:36 pm
Posts: 1
I added this.

[SysCom]
Linux.Devicefile=/dev/ttyACM

There is some command to see the name of the com port but I can't remember. In my case it wasn't ttyUSB.
I also didn't need to add "portnum := COM.SysCom.SYS_COMPORT1;"

/Martin


Top
   
PostPosted: Mon Mar 12, 2018 9:41 pm 
Offline

Joined: Thu Nov 23, 2017 4:32 pm
Posts: 22
Bifogad wrote:
I added this.

[SysCom]
Linux.Devicefile=/dev/ttyACM

There is some command to see the name of the com port but I can't remember. In my case it wasn't ttyUSB.
I also didn't need to add "portnum := COM.SysCom.SYS_COMPORT1;"

/Martin



Did you have a problem with the loss of communication between Raspberry and Arduino after the reboot?


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 4 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited