CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum
Deutsche Version English version russian version 
It is currently Sun Apr 23, 2017 6:28 am

All times are UTC+01:00




Post new topic  This topic is locked, you cannot edit posts or make further replies.  [ 25 posts ]  Go to page 1 2 Next
Author Message
PostPosted: Fri Jun 19, 2015 5:13 am 
Offline

Joined: Wed Jan 16, 2013 8:35 am
Posts: 86
Raspberry Pi appliation examples and code snippets:

Applications which come with the Pi package:
'c:\Users\<youwindowsUsername>\CODESYS Control for Raspberry PI\2.1.1.0'

    Camera.project
    CameraStream.project
    EtherCAT.project GPIO.project
    I2CExamples.project
    MCP23S17.project
    MCP3008Temperature.project
    Onewire.project
    OPCUA.project
    PiFace.project
    PiFace_FB.project
    PiFaceControlAndDisplay.project
    PiFaceIoDrv.project
    SoftMotion Servo Example.project
    Webvisu.project


Important for using these examples:
1. Update device (rightclick on Pi in the device tree - this is needed for fieldbus stacks too)
2. set current compiler Version
3. set current visuprofile
then the projects are up to date.

Application shared by CODESYS Pi users:
Delta Robot wth rc servos
Show Ip and use calendar from OSACT for timer functions (starting once a day Events) , visu: rotate bitmap
Communication with Domoticz , bulding automation
How to use Serial Communication Syscom
How to use SoftMotionLightwith the Pi
How to use a table in the visualisation for Input values
How to implement a FTP Client by using the OSCAT Network lib
How to get the result of Shell comand to IEC code
Profinet with Raspberry Pi (using Pi2 recommended) acyclic read -Service / diagnosis
PiFace with ladder / read and Show own IP address in visu
Visu User Login see Client IP Address
CODESYS V3 RPi DATABASE .txt file on SD if RPI shut down Address
Elsner P03/3-RS485 RS485-Weatherstation with Raspberry Pi
TextEditor Example Application
Raspberry Pi 3 Modbus TCP Master and Arduino Mega Modbus TCP Slave
Raspberry Pi - GoogleMaps with Webvisu
Webbrowser Element
Imported CODESYS V2.3 Project Example
Check the Raspberry PI CODESYS License on Runtime Key and SoftLicense
Raspberry PI as Profinet Slave project example
Raspberry PI Onewire - improved Project two tasks
Communication - 2 Raspberry PI Modbus TCP
1-Wire Busmaster / USB Hostadapter DS9490R OWFS
2 Raspberry Pi communication with Ethernet IP


Top
   
 
PostPosted: Sat Jun 20, 2015 5:17 am 
Offline

Joined: Wed Jan 16, 2013 8:35 am
Posts: 86
https://www.youtube.com/watch?v=h9rLOWm7NiU


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


Top
   
 
PostPosted: Sat Jun 20, 2015 5:42 am 
Offline

Joined: Wed Jan 16, 2013 8:35 am
Posts: 86
-How to use Oscat calendar and timer2 for starting Outputs once a day or only on specific weekday
-How to Show the raspberry pi current ip address on / internal visu and webvius page
-Rotate bitmap in visu


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


Top
   
 
PostPosted: Sat Jun 20, 2015 6:01 am 
Offline

Joined: Wed Jan 16, 2013 8:35 am
Posts: 86
Building Automation example, comunication with Domoticsz


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


Top
   
 
 Post subject: Serial Com with Syscom
PostPosted: Sat Jun 20, 2015 6:04 am 
Offline

Joined: Wed Jan 16, 2013 8:35 am
Posts: 86
Beside CAASerialCom using Syscom.library is possible too.
Here is the example for it.
(See viewtopic.php?f=21&t=5699 for CAASerialCom example)

on Linux side you need to indentify your serial port and activate it in /etc/CODESYSControl.cfg

How to do this:
1. you need to check on linux side which tty port is available.

Example a USB to serial converter:
Check under Linux with 'dmesg' which device is used for it:

in my case it reports: ttyUSB0

so you need to add in /etc/CODESYSControl.cfg
(Attention you need to remove the 0 from USB0)

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

this was the pi side under Linux

2. then after reboot or restart plc, you could communicate via serial com


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


Top
   
 
 Post subject: Using SoftMotionLight
PostPosted: Sat Jun 20, 2015 6:19 am 
Offline

Joined: Wed Jan 16, 2013 8:35 am
Posts: 86
Example how to use SoftMotionLight with Raspberry Pi.
(no realtime is needed for SoftMotionLight - drive should support DS402)
Check your drive for SoftMotionLight capability with:
"c:\Program Files (x86)\3S CODESYS\CODESYS\Projects\SoftMotion\SoftMotionLight\SML_CompatibilityCheck_DS402.project"


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


Top
   
 
PostPosted: Thu Jun 25, 2015 9:18 am 
Offline

Joined: Wed Jan 16, 2013 8:35 am
Posts: 86
1. Numpad
2. keyboard
3. toggle a value
4. Keypad


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


Top
   
 
PostPosted: Wed Aug 05, 2015 8:08 pm 
Offline

Joined: Wed Jan 16, 2013 8:35 am
Posts: 86
FTP Client example.
(OSCAT Network and OSCAT Basic is used)


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


Top
   
 
PostPosted: Thu Aug 06, 2015 2:03 pm 
Offline

Joined: Wed Jan 16, 2013 8:35 am
Posts: 86
Read ProcessorTemperature of the Pi and Show cpuinfo in IEC -
add in /etc/CODESYSControl.cfg the [SysProcess] section
Output of the executed command will be filled into pszStdOut


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


Top
   
 
PostPosted: Sun Aug 09, 2015 6:01 am 
Offline

Joined: Wed Jan 16, 2013 8:35 am
Posts: 86
Profinet Example with Raspberry Pi (Pi2 recommended)


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


Top
   
 
PostPosted: Mon Oct 26, 2015 4:41 pm 
Offline

Joined: Wed Jan 16, 2013 8:35 am
Posts: 86
PiFace with ladder example


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


Top
   
 
PostPosted: Sat Nov 28, 2015 9:22 pm 
Offline

Joined: Wed Jan 16, 2013 8:35 am
Posts: 86
Visu Userlogin


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


Top
   
 
PostPosted: Thu Dec 31, 2015 7:24 am 
Offline

Joined: Wed Jan 16, 2013 8:35 am
Posts: 86
here I can show example of saving INT values int txt file on Raspberry Pi SD

I have used pymodbus TCP to create modbusMaster(client) on port 503, with 10 holdt_register and 10 input_registers
in Cosesys v3 create ModBusSlave TCP also with 10 holdt_register and 10 input_registers,

if raspberry pi shut down , at start you can get 10 int values from file vars.txt on SD

How to make start at boot pymodbus master(client)

using PuTTY:
#sudo nano /etc/init.d/autorun

and paste text from autorun.txt
Ctrl + x
y
Enter

#sudo chmod 777 /etc/init.d/autorun
#sudo update-rc.d /etc/init.d/autorun defaults

#cd /home/pi/Documents/pymodbus/examples/common

root@raspberrypi:/home/pi/Documents/pymodbus/examples/common# sudo nano test.py

and paste text from test.py.txt
Ctrl + x
y
Enter

before ShutDown RaspberryPi Download CodesysProject and try:

#sudo /etc/init.d/autorun start

output:

Starting autorun
done
wait to start ethernet , wait for Codesys Slave to start 20sec
cycle: 1
Input0: 57648
Input1: 57649
Input2: 57650
Input3: 57651
Input4: 57652
Input5: 57653
Input6: 57654
Input7: 57655
Input8: 57656
Input9: 57657
line0: 57648
line1: 57649
line2: 57650
line3: 57651
line4: 57652
line5: 57653
line6: 57654
line7: 57655
line8: 57656
line9: 57657
cycle: 2


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


Top
   
 
PostPosted: Fri Feb 19, 2016 7:51 pm 
Offline

Joined: Wed Jan 16, 2013 8:35 am
Posts: 86
Example Application with RS485 connected Elsner P03/3-RS485

Prefered Interface (USB to RS482 Serial adapter)
https://www.amazon.de/gp/product/B00GWE ... UTF8&psc=1
(Advantage does not use any specific kernel module - you could use latest Debian)

For Raspi Comm the following is needed:
/etc/CODESYSControl.cfg

[SysCom]
Linux.Devicefile=/dev/ttyUSB


maybe another options is:
Link: http://www.elsner-elektronik.de/shop/de ... rs485.html
RS485 Extension: RasPi Comm

For Raspi Comm the following is needed:
/etc/CODESYSControl.cfg

[SysCom]
Linux.Devicefile=/dev/ttyRPC


wget http://downloads.amescon.com/rpc_setup.sh && chmod +x ./rpc_setup.sh && sudo ./rpc_setup.sh

sudo raspi-config
enable:
1. Devicetree
2. I2C
3. SPI

RS485 Port is

/dev/ttyRPC0


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


Top
   
 
PostPosted: Mon Mar 14, 2016 8:00 pm 
Offline

Joined: Wed Jan 16, 2013 8:35 am
Posts: 86
TextEditor Application, edit and save/read your textfiles


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.  [ 25 posts ]  Go to page 1 2 Next

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:  
cron
Powered by phpBB® Forum Software © phpBB Limited