please try my attached project.
I've connected a usb to serial adapter, send via a windows terminal programm 'READ_USB' then
you execute the bREAD which get the data from char device.
Hi Edwin,
Could you help me, please? I'm newbie in RaspBerry and in Codesys too, so trying to reading RS232 by RS232 to USB adapter when I open your example in CoDeSys V3.5 SP6 Patch3 I get the following errors:
Identifier 'CMPCHARDEVICE.RTS_IEC_HANDLE' not defined
identifer 'CmpCharDevice' not defined
My RaspBerry is PI 2 Model B
Max
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
whenever you open an older project the procedure is the following:
1. Rightclick on the plc device in the device tree -> update device
In the projectsettings:
2.- use current Compiler Version
3.- use current visuprofile
this should solve these Problems (usually an older library is missing because in the old plc device the placeholder points to a not installed library version)
This should solve it.
BR
Edwin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
is it possible to read the data from an external USB Sensor on CODESYS?
Like: sudo socat /dev/ttyUSB1,b9600 STDOUT
The command line will prdouce the following.
$1;1;;;- 0,9;;;17,6;;;;;75;;;59;;;;;;;;;0
I want to read these Data directly in CODESYS from a weather station (USB from ELV) to control further devices an show the Data in a webViusu.
Thanks for your help
Matthias
Hi Matthias,
please try my attached project.
I've connected a usb to serial adapter, send via a windows terminal programm 'READ_USB' then
you execute the bREAD which get the data from char device.
This should work for your device too.
BR
Edwin
RaspberryPI_CharDeviceSnippet.project [149.71 KiB]
Hi,
i used your solution in this topic:
l viewtopic.php?f=21&t=5699&hilit=serial l
This works well for me
Thanks for your support!
Hi,
yes sure for serial communication this works,
in case you have any other char device under Linux - the example might be the choice.
BR
Edwin
Hi Edwin,
Could you help me, please? I'm newbie in RaspBerry and in Codesys too, so trying to reading RS232 by RS232 to USB adapter when I open your example in CoDeSys V3.5 SP6 Patch3 I get the following errors:
Identifier 'CMPCHARDEVICE.RTS_IEC_HANDLE' not defined
identifer 'CmpCharDevice' not defined
My RaspBerry is PI 2 Model B
Max
Hi,
whenever you open an older project the procedure is the following:
1. Rightclick on the plc device in the device tree -> update device
In the projectsettings:
2.- use current Compiler Version
3.- use current visuprofile
this should solve these Problems (usually an older library is missing because in the old plc device the placeholder points to a not installed library version)
This should solve it.
BR
Edwin
Hi,
many many thanks, works perfectly?
BS
Max