CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum
Deutsche Version English version russian version 
It is currently Sun Apr 30, 2017 5:53 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 79 posts ]  Go to page Previous 1 2 3 4 5 6 Next
Author Message
PostPosted: Wed Sep 16, 2015 1:44 pm 
Offline

Joined: Thu Sep 03, 2015 11:04 pm
Posts: 20
Hi,

I have an USB-Serial-Adapter and followed Edwin's instructions but when I listen to the port (cat /dev/ttyUSB0) there is no response
(sending data via sencond terminal).

Any idea what I do wrong?

Best regards,

Oleg


Top
   
PostPosted: Wed Sep 16, 2015 6:54 pm 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 1904
Hi Oleg,
you need to show the /etc/CODESYSControl.cfg

BR
Edwin


Top
   
PostPosted: Thu Sep 17, 2015 1:02 pm 
Offline

Joined: Thu Sep 03, 2015 11:04 pm
Posts: 20
Hello Edwin,

thank you for your support!

Best regards,
Oleg



Last line of dmesg:
[ 1399.272505] usb 1-1.2: FTDI USB Serial Device converter now attached to ttyUSB0


Last few lines of CODESYSControl.cfg:

[CmpCodeMeter]
InitLicenseFile.0=3SLicense.wbb

[SysEthernet]
Linux.ProtocolFilter=3

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


Top
   
PostPosted: Sun Dec 27, 2015 2:53 pm 
Offline
User avatar

Joined: Fri Jul 05, 2013 9:54 am
Posts: 58
adding

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

in CODESYSControl.cfg

the runtime return STOP - program loaded exception...why?
version is 3.5.8.0

Removing the [SysCom] lines and rebooting it comes back running good (without serial communication of course)


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


Top
   
PostPosted: Mon Mar 21, 2016 3:31 pm 
Offline

Joined: Wed Jan 27, 2016 10:51 pm
Posts: 27
Hello Edwin,
I am trying to use the project from this forum "http://forum.codesys.com/download/file.php?id=604"(SerialComWithVisuRaspi.projectarchive). After updating all necessary components There is still an error in ComOpen function parameter "usiListLength:= SIZEOF(aParameter) / SIZEOF(COM.PARAMETER)". Can not convert type UINT to type USINT. Where is a problem?
Peter


Top
   
PostPosted: Mon Mar 21, 2016 8:25 pm 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 1904
Hi Peter,
attached an updated Version to current 3.5.8.10
BR
Edwin


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


Top
   
PostPosted: Tue Mar 22, 2016 7:02 pm 
Offline

Joined: Wed Jan 27, 2016 10:51 pm
Posts: 27
Hi Edwin,
I downloaded suggested version, but the error still persist. There is a mismatch between types UINT AND USINT. See ComOpen function parameter "usiListLength:= SIZEOF(aParameter) / SIZEOF(COM.PARAMETER)". Can not convert type UINT to type USINT.


Top
   
PostPosted: Tue Mar 22, 2016 7:05 pm 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 1904
Hi,

which CODESYS Version are you using?
Which Raspberry PI Package Version?
BR
Edwin


Top
   
PostPosted: Wed Mar 23, 2016 9:36 am 
Offline

Joined: Wed Jan 27, 2016 10:51 pm
Posts: 27
I use CODESYS V3.5 SP8 and CODESYS Control for Raspberry PI_3.5.8.0.package

Peter


Top
   
PostPosted: Sun Apr 03, 2016 4:44 pm 
Offline

Joined: Mon Feb 16, 2015 1:56 pm
Posts: 9
Hello. I want to use internal serial port AND extrnal usb-com adapter.
I tried to add this to /etc/udev/rules.d/serial-symlinks.rules
Code:
SUBSYSTEM=="tty", ENV{DEVPATH}=="/devices/platform/soc/20201000.uart/tty/ttyAMA0", SYMLINK+="tty-RPI0"
SUBSYSTEM=="tty", ENV{ID_PATH}=="platform-bcm2708_usb-usb-0:1.2:1.0", SYMLINK+="tty-RPI1"
SUBSYSTEM=="tty", ENV{ID_PATH}=="platform-bcm2708_usb-usb-0:1.3:1.0", SYMLINK+="tty-RPI2"
SUBSYSTEM=="tty", ENV{ID_PATH}=="platform-bcm2708_usb-usb-0:1.4:1.0", SYMLINK+="tty-RPI3"
SUBSYSTEM=="tty", ENV{ID_PATH}=="platform-bcm2708_usb-usb-0:1.5:1.0", SYMLINK+="tty-RPI4"


And this to /etc/CODESYSControl.cfg
Code:
[SysCom]
Linux.Devicefile=/dev/tty-RPI
portnum := COM.SysCom.SYS_COMPORT1


But it doesn't work(


Top
   
PostPosted: Sun Apr 03, 2016 6:41 pm 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 1904
Hi,

does a
cat /dev/tty-RPI0
and cat /dev/tty-RPI1
work under Linux?
(If you connect a terminal to port and send....)

BR
Edwin


Top
   
PostPosted: Mon Apr 04, 2016 2:31 pm 
Offline

Joined: Mon Feb 16, 2015 1:56 pm
Posts: 9
Hello. Now everything working.

I changed platform-bcm2708_usb-usb-0:1.2:1.0 to platform-20980000.usb-usb-0:1.2:1.0 for my RPI B+

sudo nano /etc/udev/rules.d/serial-symlinks.rules
Code:
SUBSYSTEM=="tty", ENV{DEVPATH}=="/devices/platform/soc/20201000.uart/tty/ttyAMA0", SYMLINK+="tty-RPI0"
SUBSYSTEM=="tty", ENV{ID_PATH}=="platform-20980000.usb-usb-0:1.2:1.0", SYMLINK+="tty-RPI1"
SUBSYSTEM=="tty", ENV{ID_PATH}=="platform-20980000.usb-usb-0:1.3:1.0", SYMLINK+="tty-RPI2"
SUBSYSTEM=="tty", ENV{ID_PATH}=="platform-20980000.usb-usb-0:1.4:1.0", SYMLINK+="tty-RPI3"
SUBSYSTEM=="tty", ENV{ID_PATH}=="platform-20980000.usb-usb-0:1.5:1.0", SYMLINK+="tty-RPI4"

sudo nano /etc/CODESYSControl.cfg
Code:
[SysCom]
Linux.Devicefile=/dev/tty-RPI
portnum := COM.SysCom.SYS_COMPORT1


Top
   
PostPosted: Mon Apr 04, 2016 8:35 pm 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 1904
Thanks for the feedback,
helpful for others too.
BR
Edwin


Top
   
PostPosted: Mon May 02, 2016 7:25 pm 
Offline

Joined: Thu Apr 28, 2016 11:06 pm
Posts: 31
Hello Edwin,

i open the project linked in your last post with attachement (SerialComWithVisu.project),
wehn i open it i become lot of errors: Library SM3 is not available.
I use the last version of Codesys 3.5 and Raspi Package 3.5.8.10 .
Can you Help me?

Serghei


Top
   
PostPosted: Mon May 02, 2016 8:02 pm 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 1904
Hi Serghei,
open older Projects should allways followed by the following procedure:
1. Update the plc device in the device tree (right click update device)
2. if there are fieldbus stacks used in the Project (update them too)
2. set current compiler version
3 set current visu profile

This usually give a error free - updated project ready for using it.
BR
Edwin


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 79 posts ]  Go to page Previous 1 2 3 4 5 6 Next

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 5 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:  
cron
Powered by phpBB® Forum Software © phpBB Limited