CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Tue Oct 22, 2019 11:54 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Wed Oct 09, 2019 9:32 am 
Offline

Joined: Thu Aug 03, 2017 8:56 am
Posts: 21
Hi,
what I want to do in a project is to communicate with modbus devices through more than one channel, to be connected to the raspberry's USB ports. Some devices will connect them to the first channel, others to the second, others to the third, etc.
I know the procedure to enable only one channel, writing the following code in the file "/ect/CODESYSControl.cfg":

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


in this way, I enable the COM 1 port, via USB, to communicate with my modbus devices (and everything works correctly).

If, on the other hand, you want to enable more than one COM port (for example the COM 1 and COM 2 ports simultaneously), what should I write in the CODESYSControl.cfg file?

Thanks in advance


Top
   
PostPosted: Wed Oct 09, 2019 6:54 pm 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3499
Hi,
since 3.5SP15 it is possible that way:

set this in /etc/CODESYSControl_User.cfg
Example
[SysCom]
Linux.Devicefile.1=/dev/ttyS0
Linux.Devicefile.4=/dev/ttyUSB0

so Com1 is ttyS0 Com4 is ttyUSB0

in versions <SP15 it was needed to set symlinks / or use UDEV to sort them into the same the device under Linux.

BR
Edwin


Top
   
PostPosted: Thu Oct 10, 2019 12:00 pm 
Offline

Joined: Thu Aug 03, 2017 8:56 am
Posts: 21
Hi Edwin,
thanks for the reply. Only the COM1 port works if in the file /etc/CODESYSControl.cfg (and not in the file /etc/CODESYSControl_User.cfg) I write:

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

What I wrote (which does not work) is, in the file /etc/CODESYSControl_User.cfg the following code:

[SysCom]
Linux.Devicefile.1=/dev/ttyUSB0
Linux.Devicefile.2=/dev/ttyUSB1

with the aim of enabling the COM1 port in the USB1 port of the raspberry, and the COM2 port in the USB2 port of the raspberry (I suppose USB0 is the first USB port, USB1 the second, USB2 the third and USB3 the fourth of the raspberry).
I tried to write the same code as above also in the file /etc/CODESYSControl.cfg and nothing.
What can be the cause of the malfunction?
Thanks,
Francesco


Top
   
PostPosted: Thu Oct 10, 2019 12:01 pm 
Offline

Joined: Thu Aug 03, 2017 8:56 am
Posts: 21
NOTE: I use CODESYS v3.5 SP15


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