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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2016-07-28
Originally created by: ga-nozry
Good time, experts CDS.
I will try to describe more the problem.
Experiences spend on PI-2 mod.B
There is a controller that has only RS-232, with fixed settings ID 16, 115200,8,N,1.
But, as You know, CDS are not able to understand this format. Or serial, or TCP.
To solve this problem, I tried to use the socat program http://www.dest-unreach.org/socat/ team socat PTY,link=/dev/ttyCOM tcp:192.168.3.55:502, which creates the most symbolic file /dev/ttyCOM, (lrwxrwxrwx 1 root root 10 Jul 26 10:56 /dev/ttyCOM -> /dev/pts/0)
When experimenting with OpenHab, also had to add the permission to the specified "port" in start.sh -Dgnu.io.rxtx.SerialPorts=/dev/ttyCOM. Although, everything is perfectly functioning.
Now.
By analogy with these often change CODESYSControl.cfg to work with RS-485/USB Converter I tried to add /dev/ttyCOM in the file /etc/CODESYSControl.cfg
Thank You, Edwin.
I used to try, but nothing worked. (ttyCOM0)
After Your comment I started to study the problem deeper and found out gateway was created later than the start CoDeSys.
The problem was fixed - it works great!
Decided July 30.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Modbus RTU is bus-faillure(red) when i restart or turn on my rpi, i need to connect with Codesys development and download the app and run.
I made Create Boot App and Sourcecode download.
I tried,
IF Modbus_Slave_COM_Port.xError THEN
Modbus_Slave_COM_Port.xReset := TRUE;
END_IF
but this doesn't work only change to orange from red.
Thank you.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2017-04-17
Originally created by: dosnova
Hi, I've two usb-serial devices from the same manufacturer. I've created udev rules to assing different names for both devices. Names are motor_up and motor_down. Both devices are listed in the /dev folder and both are working fine with minicom. I've added both devices to CODESYSControl.cfg:
dosnova hat geschrieben:
Hi, I've two usb-serial devices from the same manufacturer. I've created udev rules to assing different names for both devices. Names are motor_up and motor_down. Both devices are listed in the /dev folder and both are working fine with minicom. I've added both devices to CODESYSControl.cfg: [SysCom]
Linux.Devicefile=/dev/motor_up
portnum := COM.SysCom.SYS_COMPORT1;
Linux.Devicefile=/dev/motor_down
portnum := COM.SysCom.SYS_COMPORT2;
No way to make it work
I appreciate your uggestions..
You can try one by one, with codesys check. Can you show us result about this?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
and then in /etc/CODESYSControl.cfg only this line will be needed:
[SysCom]
Linux.Devicefile=/dev/ttyMotor
In CODESYS you'll then access com1 for Motor0(Motor_up) and com2 is Motor1(Motor down)
BR
Edwin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2017-04-17
Originally created by: dosnova
Thanks Edwin, now it appears to be working. I've a new question... how to add a line feed + carriage return at the end of the string I am sendig to serial device??
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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)
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
Hi Peter,
attached an updated Version to current 3.5.8.10
BR
Edwin
SerialComWithVisu.project [76.22 KiB]
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.
Hi,
which CODESYS Version are you using?
Which Raspberry PI Package Version?
BR
Edwin
I use CODESYS V3.5 SP8 and CODESYS Control for Raspberry PI_3.5.8.0.package
Peter
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
And this to /etc/CODESYSControl.cfg
But it doesn't work(
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
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
sudo nano /etc/CODESYSControl.cfg
Thanks for the feedback,
helpful for others too.
BR
Edwin
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
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
Originally created by: ga-nozry
Good time, experts CDS.
I will try to describe more the problem.
Experiences spend on PI-2 mod.B
There is a controller that has only RS-232, with fixed settings ID 16, 115200,8,N,1.
There is such piece of iron - USR-TCP232-2 http://www.usriot.com/p/rs232-to-ethernet-modules/. Works perfectly in mode RTU over TCP.
But, as You know, CDS are not able to understand this format. Or serial, or TCP.
To solve this problem, I tried to use the socat program http://www.dest-unreach.org/socat/ team socat PTY,link=/dev/ttyCOM tcp:192.168.3.55:502, which creates the most symbolic file /dev/ttyCOM, (lrwxrwxrwx 1 root root 10 Jul 26 10:56 /dev/ttyCOM -> /dev/pts/0)
When experimenting with OpenHab, also had to add the permission to the specified "port" in start.sh -Dgnu.io.rxtx.SerialPorts=/dev/ttyCOM. Although, everything is perfectly functioning.
Now.
By analogy with these often change CODESYSControl.cfg to work with RS-485/USB Converter I tried to add /dev/ttyCOM in the file /etc/CODESYSControl.cfg
however, nothing happens, not picks up data CoDeSys...
What needs to be done in the /etc/CODESYSControl.cfg [SysCom]
It seems that clearly outlined the problem.
I hope for understanding and help.
HI,
your symlinc should be:
/dev/ttyCOM0 -> /dev/pts/0
then it will work.
BR
Edwin
Thank You, Edwin.
I used to try, but nothing worked. (ttyCOM0)
After Your comment I started to study the problem deeper and found out gateway was created later than the start CoDeSys.
The problem was fixed - it works great!
Decided July 30.
hi,
Modbus RTU is bus-faillure(red) when i restart or turn on my rpi, i need to connect with Codesys development and download the app and run.
I made Create Boot App and Sourcecode download.
I tried,
IF Modbus_Slave_COM_Port.xError THEN
Modbus_Slave_COM_Port.xReset := TRUE;
END_IF
but this doesn't work only change to orange from red.
Thank you.
Originally created by: dosnova
Hi, I've two usb-serial devices from the same manufacturer. I've created udev rules to assing different names for both devices. Names are motor_up and motor_down. Both devices are listed in the /dev folder and both are working fine with minicom. I've added both devices to CODESYSControl.cfg:
[SysCom]
Linux.Devicefile=/dev/motor_up
portnum := COM.SysCom.SYS_COMPORT1;
Linux.Devicefile=/dev/motor_down
portnum := COM.SysCom.SYS_COMPORT2;
No way to make it work
I appreciate your uggestions..
You can try one by one, with codesys check. Can you show us result about this?
Hi,
I would set symbolic links in Linux
and then in /etc/CODESYSControl.cfg only this line will be needed:
[SysCom]
Linux.Devicefile=/dev/ttyMotor
In CODESYS you'll then access com1 for Motor0(Motor_up) and com2 is Motor1(Motor down)
BR
Edwin
Originally created by: dosnova
Thanks Edwin, now it appears to be working. I've a new question... how to add a line feed + carriage return at the end of the string I am sendig to serial device??
Hi,
$L and $R
BR
Edwin
Originally created by: dosnova
I have a Modbus Com Error when i reboot my RPI. I share a video. Can you help me pls?
https://drive.google.com/open?id=0B92kE ... nZ2aFYxSms
BR
Hector
Hi,
guess you need to set the autorestart flag?
BR
Edwin
Thanks you Edwin,
I tried with autorestart flag too. (bad lucky )
I'm thinking in reset warm, but I don't know set autoplay after reset.
BR
Hector