CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum
Deutsche Version English version russian version 
It is currently Wed Aug 23, 2017 10:07 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 81 posts ]  Go to page Previous 1 2 3 4 5 6 Next
Author Message
PostPosted: Sun Oct 26, 2014 11:17 am 
Offline

Joined: Tue Oct 14, 2014 8:40 pm
Posts: 3
Hello Edwin,

Thank you for your prompt answer.

I modified the file CODESYSControl.cfg (I have just understood that I had to do the modification on the Raspberry side, sorry...).
Now, it's done.

I added 0 to ttyUSB to have ttyUSB0 but it doesn't work anymore (I tested again with minicom & it was working on ttyUSB0 !)
on a window side (in Codesys) I tested
- udiPort:= 0, and
- udiPort:= 1,
without success, I have the same ERROR_UNKNOW !

Do you have another suggestion or idea where the issue comes from ?

thank you

Christian,


Top
   
PostPosted: Sun Oct 26, 2014 5:01 pm 
Offline
Site Admin

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

if your serial port is ttyUSB0

your config fileCODESYSControl.cfg should be without the '0'

[SysCom]
Linux.Devicefile=/dev/ttyUSB


that's it.

Regards
Edwin


Last edited by Edwin Schwellinger on Tue Apr 18, 2017 5:59 am, edited 1 time in total.

Top
   
PostPosted: Sun Oct 26, 2014 7:23 pm 
Offline

Joined: Tue Oct 14, 2014 8:40 pm
Posts: 3
Hi Edwin,

thank you for your patience, now it works very well.

thank you again,


Top
   
PostPosted: Fri Nov 21, 2014 1:41 pm 
Offline

Joined: Fri Apr 18, 2014 5:36 pm
Posts: 69
Hi,

I managed to fix COM port numbers COM1-COM4 to USB sockets on Raspberry Pi B+ :D .
This is the procedure:
-sudo nano /etc/CODESYSControl.cfg
Add this:
Code:
[SysCom]
Linux.Devicefile=/dev/tty-RPI
portnum := COM.SysCom.SYS_COMPORT1;

-sudo nano /etc/udev/rules.d/serial-symlinks.rules
Add this:
Code:
SUBSYSTEM=="tty", ENV{ID_PATH}=="platform-bcm2708_usb-usb-0:1.2:1.0", SYMLINK+="tty-RPI0"
SUBSYSTEM=="tty", ENV{ID_PATH}=="platform-bcm2708_usb-usb-0:1.3:1.0", SYMLINK+="tty-RPI1"
SUBSYSTEM=="tty", ENV{ID_PATH}=="platform-bcm2708_usb-usb-0:1.4:1.0", SYMLINK+="tty-RPI2"
SUBSYSTEM=="tty", ENV{ID_PATH}=="platform-bcm2708_usb-usb-0:1.5:1.0", SYMLINK+="tty-RPI3"

-Reboot

That's it! :lol:

Best regards,
Zdenko.


Top
   
PostPosted: Thu Mar 05, 2015 4:16 pm 
Offline

Joined: Fri Apr 18, 2014 5:36 pm
Posts: 69
Hi,

How can I get Error status bit for Modbus_COM_1?
Image

Best regards,
Zdenko


Top
   
PostPosted: Thu Apr 16, 2015 1:02 pm 
Offline
User avatar

Joined: Wed Apr 08, 2015 11:06 am
Posts: 36
Sorry, posted in other topic...
viewtopic.php?f=21&t=5986&p=12004#p12004




BR
Osman


Top
   
PostPosted: Fri May 22, 2015 9:05 am 
Offline

Joined: Wed May 20, 2015 11:42 am
Posts: 2
Hello,

i have problems to read from COM in Codesys.
I modified the Project from this thread. I´ve connected a PILZ PNOZmulti with USB to the Raspberry. The USB-Serial Converter works with an FTDI chip. The comWrite send the hex string i want to the PILZ. When i use the Terminal with:
stty -F /dev/ttyUSB0 192000
stty -F /dev/ttyUSB0 raw
cat /dev/ttyUSB0 | od -tx1
the right answer comes back in hex. But i can´t get codesys to recognise it. The ReadBuffer is always empty. Whether i use a timer after the comWrite or not.

Any suggestions?

Best regards,
Daniel


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


Top
   
PostPosted: Sat May 23, 2015 6:02 am 
Offline
Site Admin

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

could you attach /etc/CODESYSControl.cfg to this post or at least check if your entry for your SerialCom
device is in. (This is what you need to add manually)

in your case it is:

[SysCom]
Linux.Devicefile=/dev/ttyUSB


BR
Edwin


Last edited by Edwin Schwellinger on Tue Apr 18, 2017 6:00 am, edited 1 time in total.

Top
   
PostPosted: Thu May 28, 2015 8:28 am 
Offline

Joined: Wed May 20, 2015 11:42 am
Posts: 2
Hello Edwin,

thank you for answering. I checked the .cfg . But i added the lines manually before.
I found the problem. Somehow another programm cut the connection.

Best Regards,
Daniel


Top
   
PostPosted: Fri Jun 12, 2015 12:30 pm 
Offline
User avatar

Joined: Wed Apr 08, 2015 11:06 am
Posts: 36
Hi everyone! How to configure the RAspberry UART port in Linux?
I did only this:
sudo nano /etc/CODESYSControl.cfg

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

But have an error;


Top
   
PostPosted: Sat Jun 13, 2015 11:46 am 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 2061
Hi,
more details... which error an where do you see the error ?
Could you use AMA0 in the console in Linux?
BR
Edwin


Last edited by Edwin Schwellinger on Sun Jun 14, 2015 7:45 pm, edited 1 time in total.

Top
   
PostPosted: Sun Jun 14, 2015 11:26 am 
Offline
User avatar

Joined: Wed Apr 08, 2015 11:06 am
Posts: 36
Edwin Schwellinger wrote:
Hi,
more Details... which error an where do you see the error ?
Could you use AMA0 in the console in Linux?
BR
Edwin


Good afternoon. I can't attach a screenshot at this topic, have some error;
I use handmade converter on ST485 and npn transistors wich switch direction of USART transmission data. In Raspbian I'm configuring only this - sudo nano /etc/CODESYSControl.cfg
Linux.Devicefile=/dev/ttyAMA
portnum := COM.SysCom.SYS_COMPORT1;
I have configured after
Master device modbus config in Codesys: 9600, 8E1;
Settings in slave device: adress#1, 9600, 8E1

When I login via Codesys, mastes device is run ok (green circle near Master device in Codesys), but slave not response and i have an erron "Bus is not run";

Auto reconection on bus enabled;

How can I check UART in Linux console? And what I must configure in Raspbian for working USART?

BR. Osman


Top
   
PostPosted: Mon Jun 15, 2015 4:14 am 
Offline
Site Admin

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

use a terminal and the following: (sure in your case you need a USB-RS485 converter on Windows to test )

viewtopic.php?f=21&t=5699#p10300
next step could be - use the serial example and a terminal.
Last step is use modbus with your device
BR
Edwin


Top
   
PostPosted: Tue Jun 16, 2015 4:03 pm 
Offline
User avatar

Joined: Wed Apr 08, 2015 11:06 am
Posts: 36
Edwin Schwellinger wrote:
Hi Osman,

use a terminal and the following: (sure in your case you need a USB-RS485 converter on Windows to test )

BR
Edwin

I conect USB-RS485 converter on Win PC and raspberry...
ttyAMA0 does not transfere the data;


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


Top
   
PostPosted: Wed Jun 17, 2015 1:56 pm 
Offline
User avatar

Joined: Wed Apr 08, 2015 11:06 am
Posts: 36
Hi everyone I've solved problem. Problem was in electronic circuit on ST485. I've deleted one transistor and connected PIN4 to the GND. On Raspberry I did this:
cp /boot/cmdline.txt /boot/cmdline.bak
cp /etc/inittab /etc/inittab.bak
Next: sudo nano /boot/cmdline.txt
delete this string "console=ttyAMA0,115200" и "kgdboc=ttyAMA0,115200"
Next: sudo nano /etc/inittab
and change string: T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100 to #T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
Thank you very much for help!
BR
Osman.


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


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 81 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 7 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