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 Wed Apr 24, 2019 11:23 am

All times are UTC+01:00




Post new topic  This topic is locked, you cannot edit posts or make further replies.  [ 40 posts ]  Go to page Previous 1 2 3
Author Message
PostPosted: Thu Dec 21, 2017 10:45 am 
Offline
Frequent User
Frequent User

Joined: Wed Jan 16, 2013 8:35 am
Posts: 111
This example shows how to use a port-expander PCF8574 I2C without library/device description
from the application code.

Control Christmas lights:

https://www.youtube.com/watch?v=6vsxV-Bj6-4


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


Top
   
 
PostPosted: Wed Mar 07, 2018 6:54 am 
Offline
Frequent User
Frequent User

Joined: Wed Jan 16, 2013 8:35 am
Posts: 111
Demo Project for VisuUaserManagement, show statistic who is logged in,
Change logged in user by iec code.


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


Top
   
 
PostPosted: Tue Mar 13, 2018 11:48 am 
Offline
Frequent User
Frequent User

Joined: Wed Jan 16, 2013 8:35 am
Posts: 111
Using enocean with the Raspberry Pi
See:
https://youtu.be/mYaqMY8ddAk


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


Top
   
 
PostPosted: Wed Apr 25, 2018 10:41 am 
Offline
Frequent User
Frequent User

Joined: Wed Jan 16, 2013 8:35 am
Posts: 111
How to use IO-Link devices with Ethercat and Gateway EL6224

https://www.youtube.com/watch?v=GadTtFrnUEc


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


Top
   
 
PostPosted: Fri Sep 07, 2018 12:47 pm 
Offline
Frequent User
Frequent User

Joined: Wed Jan 16, 2013 8:35 am
Posts: 111
Play Sound on Raspberry PI. PiFace Interface is used.
RaspiSound_nonblocking Play several sound on the same time.
It uses the Omxplayer, should be installed.

Original post:
https://forum-de.codesys.com/viewtopic. ... 723#p18206


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


Top
   
 
PostPosted: Fri Oct 19, 2018 7:44 am 
Offline
Frequent User
Frequent User

Joined: Wed Jan 16, 2013 8:35 am
Posts: 111
Login by ssh to the PI:

dmesg | grep -i tty
to check which serial interface is available / connected

1. remove ';' /etc/CODESYSControl_User.cfg in the section [SysCom] and adapt ttyS to your used device
for example if you use USB which is connected to USB0 then it should /dev/ttyUSB in this config file

[SysCom]
;Linux.Devicefile=/dev/ttyS

2. If you use the serial port which is on the GPIO's (3.3V!) then you need to enable it in
sudo raspi-config ( Interface options - login shell disabled and serial hardware enabled)

3. User https://store.codesys.com/serial-com.html as example on how to use the serial port in CODESYS


Top
   
 
PostPosted: Sat Nov 10, 2018 8:05 am 
Offline
Frequent User
Frequent User

Joined: Wed Jan 16, 2013 8:35 am
Posts: 111
even on Pi this is not really needed,
you could use on Raspian Stretch and use Chromium in full screen mode - this feels then similar to
targetvisu.
how to do this?

Add a CODESYS Project with webvisualisation and then:
Target VIsu is not possible but a good solution is on Rasbian(not Rasbian lite):

sudo nano /home/pi/.config/lxsession/LXDE-pi/autostart
or
sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
(depends on the installed RASBIAN Version)



lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@xscreensaver -no-splash
@point-rpi
@xset s off
@xset s noblank
@xset -dpms

@chromium-browser --noerrdialogs --kiosk --incognito http://localhost:8080/webvisu.htm


Top
   
 
PostPosted: Thu Dec 13, 2018 8:38 am 
Offline
Frequent User
Frequent User

Joined: Wed Jan 16, 2013 8:35 am
Posts: 111
CmpCharDevice snippet


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


Top
   
 
PostPosted: Mon Feb 25, 2019 11:18 am 
Offline
Frequent User
Frequent User

Joined: Wed Jan 16, 2013 8:35 am
Posts: 111
Raspberry Pi: Play sound on Webvisu connected device:


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


Top
   
 
PostPosted: Mon Apr 08, 2019 6:30 pm 
Offline
Frequent User
Frequent User

Joined: Wed Jan 16, 2013 8:35 am
Posts: 111
I just spent the day installing two identical serial devices. One was a RS-485 dongle and the other an RS-485 to TTL adapter for a power supply. Both come up as an "QinHeng Electronics HL-340 USB-Serial adapter" with identical ID's according to "lsusb". The root problem was that occasionally, they would end up swapped. Since they are both identical, there was no distiguishing characteristics for my "udev" rules for the devices. Between this thread and some Linux sites I found a work around. I wanted to share it here in case it may help others, and also so that I can refer back to it after I forget how I made it work :-)

In essence, instead of giving the device a permanent linux device, I gave a permanent linux device to the USB port. It seems each port on the Pi board has a unigue ID. This is shown below as port 1.2-1.5 at the following link:
https://askubuntu.com/questions/49910/h ... ters#50412


Armed with this knowledge I then created and edited /etc/udev/rules.d/99-usb-serial.rules. This file contains the following:

SUBSYSTEM=="tty", ATTRS{devpath}=="1.5", SYMLINK+="ttyUSC0"
SUBSYSTEM=="tty", ATTRS{devpath}=="1.3", SYMLINK+="ttyUSC1"
SUBSYSTEM=="tty", ATTRS{devpath}=="1.4", SYMLINK+="ttyUSC2"
SUBSYSTEM=="tty", ATTRS{devpath}=="1.2", SYMLINK+="ttyUSC3"

The 1.5 device is my RS-485 dongle and the 1.3 device goes to the USB-TTL board.

Next I edited /etc/CODESYS_User.cfg. The following lines were added:

[SysCom]
Linux.Devicefile=/dev/ttyUSC


With this configuration the USB port number (as shown in the link), USB 1.5 will always be Codesys port 1. Likewise USB port 1.3 will always be Codesys port 2, etc. With the tests Ive performed, the comm adapter addresses are now tied to a USB "port" (or slot) rather than being first come first served. With all said and done the Modbus server connected to my dongle is now at (and as long as I dont change slots will be) com device 1. Likewise the Modbus at the other adaptor is and should remain comm 2. Long story short, I know what com port it is based on which slot the device is plugged into.

A word of caution, I dont know how this will act with a USB hub or device besides a com device. My thought is if it causes problems, delete the lines from usb-serial-rules that are not needed. Also, the devices seem to no longer be "hot swappable". From what I have seen a reboot is required if a device is removed and reinserted. Hope this helps someone else also.


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  This topic is locked, you cannot edit posts or make further replies.  [ 40 posts ]  Go to page Previous 1 2 3

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 1 guest


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