FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
Dear Community User! We have started the migration process.
This community is now in READ ONLY mode.
Read more: Important
information on the platform change.
04-01-2022 10:34 AM - edited 04-01-2022 10:35 AM
Dear ctrlX Community!
We would like to connect several Keyence scanner to ctrlX Core via USB RS232 adapter.
I successfully sent and received data in node-RED (with /dev/ttyUSB0 path), but we need to use this solution in PLC runtime.
I tried to open the serial port with SysCom library without any success.
Is there any possibility to handle the USB RS232 adapter in the PLC environment?
Thanks in advance!
Solved! Go to Solution.
04-01-2022 12:11 PM
Hi,
I don't know if it is possible or not but i would like to know the answer too. 🤗
Mauro
04-01-2022 12:43 PM
Hi,
we will have a look into the topic and come back to you.
Have a nice weekend.
04-13-2022 08:05 AM
After the V1.14 update, we tried to set the following parameters to plc_system.cfg:
[syscom]
linux.devicefile=/dev/ttyUSB0
portnum := COM.SysCom.SYS_COMPORT1;
This solution works with Codesys PLC runtime on Raspberry Pi, but no success on ctrlX.
Is there any chance to step forward in this question?
04-25-2022 08:50 AM
Hi 8run0tti,
update, it is not yet possible to use it.
We are working on it, most likely it will be available in the next version 1.16 from august on.
Regards
11-22-2022 11:24 AM
Any news here?
11-24-2022 03:17 PM
Hi 8run0tti,
we implemented the support from version 1.16 on.
Find here some example code.
PROGRAM PLC_PRG
VAR
result : Syscom.RTS_IEC_RESULT;
handle : Syscom.RTS_IEC_HANDLE;
settings : Syscom.SysComSettings;
bDone : BOOL;
arByte : ARRAY[0..99] OF BYTE;
udiReturn : UDINT;
iState : INT := 0;
END_VAR
settings.sPort := SYS_COMPORT1;
settings.ulBaudrate := SYS_BR_4800;
settings.byParity := SYS_NOPARITY;
settings.byStopBits := SYS_ONESTOPBIT;
CASE iState OF
0:
IF NOT bDone THEN
handle := Syscom.SysComOpen2(
pSettings:= ADR(settings),
pSettingsEx:= 0,
pResult:= ADR(result));
bDone := TRUE;
iState:= 10;
END_IF
10:
udiReturn := Syscom.SysComRead(
hCom:= handle,
pbyBuffer:= ADR(arByte),
ulSize:= SIZEOF(arByte),
ulTimeout:= 0,
pResult:= ADR(result));
END_CASE
11-24-2022 07:28 PM
Thanks kai ❤️