Post by mgabryel on Problems with CAN 2.0 comunication on Wago PLC (Codesys 3.5)
CODESYS Forge
talk
(Post)
Hello, I am trying to program CAN Bus comunication on WAGO PLC (more precisely on WAGO Touch Monitor model TP600). I am using for this purpose library "WagoAppCanLayer2" from Wago company. My IDE for programming this device is CODESYS V3.5 SP19 Patch 2 + (64-bit). My program is written in Structured text using function blocks from previously mentioned library. Here is code of this program: 1) Variables declarations: PROGRAM PLC_PRG VAR oOpenInterface : WagoAppCanLayer2.FbCanL2Open :=( udiBaudrate := 125000 ); xInterfaceIsOpen : BOOL; sInterfaceInfo : STRING; oReceive : WagoAppCanLayer2.FbCanRx29BitFrame :=( xBufferMode := FALSE, wCanId := 16#181 ); xRecv : BOOL; sReceiveInfo : STRING; oSend : WagoAppCanLayer2.FbCanTx29BitFrame :=( dwCanId := 16#100, //was 16#201 xRtrFrame := FALSE ); xSend : BOOL; sSendInfo : STRING; oCanDiag : WagoAppCanLayer2.FbCanErrorInfo; xRst : BOOL; aSendData : ARRAY [1..8] OF BYTE; bSendLen : BYTE; TON_0 : TON; TON_1 : TON; END_VAR 2) Program body: oOpenInterface( xEnable := NOT xInterfaceIsOpen, I_Port := IoConfig_Globals.WAGO_CAN_LAYER2_DEVICE ); sInterfaceInfo := oOpenInterface.oStatus.GetDescription(); xInterfaceIsOpen S= oOpenInterface.xValid AND NOT oOpenInterface.xError; oReceive( xEnable := xInterfaceIsOpen, I_Port := IoConfig_Globals.WAGO_CAN_LAYER2_DEVICE, xRxTrigger := xRecv ); sReceiveInfo := oReceive.oStatus.GetDescription(); IF NOT xRecv THEN IF oReceive.bRxNBytes > 0 THEN oReceive.aRxBuffer[1]; oReceive.aRxBuffer[2]; oReceive.aRxBuffer[3]; oReceive.aRxBuffer[4]; oReceive.aRxBuffer[5]; oReceive.aRxBuffer[6]; oReceive.aRxBuffer[7]; oReceive.aRxBuffer[8]; END_IF xRecv := TRUE; END_IF aSendData[1] := 224; aSendData[2] := 13; aSendData[3] := 14; aSendData[4] := 15; aSendData[5] := 222; aSendData[6] := 13; aSendData[7] := 14; aSendData[8] := 15; bSendLen := 8; TON_0(IN:= NOT TON_1.Q, PT:= T#2S , Q=>xSend, ET=> ); TON_1(IN:= TON_0.Q, PT:= T#2S , Q=>, ET=> ); oSend( xEnable := xInterfaceIsOpen, I_Port := IoConfig_Globals.WAGO_CAN_LAYER2_DEVICE, aTxBuffer := aSendData, bTxNBytes := bSendLen, xTxTrigger := xSend ); sSendInfo := oSend.oStatus.GetDescription(); oCanDiag( xEnable := TRUE, I_Port := IoConfig_Globals.WAGO_CAN_LAYER2_DEVICE, xTriggerResetCounter := xRst, xValid=> , xError=> , oStatus=> , wBusState=> , wBusDiag=> , uiRxOverflowsL2=> , uiTxOverflowsL2=> , uiRxOverflows=> , uiMsgTimeouts=> , uiBusOffs=> , uiBusWarnings=> ); Program first opens comunication on CAN 2 device and then periodically try send one CAN data frame. After starting program CAN 2 interface is properly open. The xSend variable is toggling with period 2s. When program sends data an "Tx overflow" error appears. When I am watching CAN_H line on DSub 9 socket i am not able to see proper CAN frames - see screenshot attached to this message. Could somebody help me determine what is wrong with this program. Best regards
Last updated: 2024-08-02
After un upgrade of "CODESYS Control for Raspberry Pi MC SL" from v4.7 to v4.9 SysFileOpen function stopped working
CODESYS Forge
talk
(Thread)
After un upgrade of "CODESYS Control for Raspberry Pi MC SL" from v4.7 to v4.9 SysFileOpen function stopped working
Last updated: 2023-08-22
Post by eschwellinger on Stop raspberry from executing a plc program
CODESYS Forge
talk
(Post)
/var/opt/codesys/PLCLogic as soon you have dowloaded the project to the Pi it will run the bootapplication no connection to the pc is needed anymore
Last updated: 2023-08-24
Post by eschwellinger on Same program to more than one PLC
CODESYS Forge
talk
(Post)
just open http://localhost:8080 in Chromium then it will show the webvisu ( sure you need to this in your CODESYS Application)
Last updated: 2023-08-24
Post by roundex on CSVReaderInit returns error : INVALID_HANDLE
CODESYS Forge
talk
(Post)
I got same issue but managed to get it to work again by downgrading the Runtime. Here's my specs: CODESYS V3.5.19.0 Runtime Linux SL 4.7.0.0. CSV Utility SL 1.1.0.0 (Licensed IIoT libraries SL) I tried Runtime 4.8.0.0. and 4.9.0.0 but both result in INVALID_HANDLE error.
Last updated: 2023-08-30
Post by eschwellinger on CSVReaderInit returns error : INVALID_HANDLE
CODESYS Forge
talk
(Post)
this is a security issue not to read/write in the plc allowed path I would recommend to update and change the path in the application were the files areπ
Last updated: 2023-08-30
Post by dexterdva on Creating a custom kinematics starting from Scara2 model.
CODESYS Forge
talk
(Post)
Hello, I'm trying to develop a custom kinematics derived to Kin_Scara2_Z. there is someone that have the source code of this library? Thanks Dexter
Last updated: 2023-09-11
Post by transmin01 on CANbus issue
CODESYS Forge
talk
(Post)
Hi, I have been trying to get a CANbus device working with Codesys 3.5SP19 patch1 via a Beckhoff EL6751 gateway without success. I have the CANOpen_Manager and CANopen device configured but this will not run. Is there any code required to kickstart the CANbus comms into action? Regards Trevor
Last updated: 2023-09-13
Post by timvh on Troubles with using CAN API
CODESYS Forge
talk
(Post)
In the example project, you can see that a CAN.CANAreaReceiver is used which has an VAR_IN_OUT reference to a RECEIVER_AREA structure. This structure has a dwIdStart and dwIdEnd to filter a range of ID's and process them through the referenced msgProcessor.
Last updated: 2023-09-19
Post by aott33 on Webvisu NO load
CODESYS Forge
talk
(Post)
I am experiencing something like this as well. After reboot, the WebVisu can take up to 3 min to load. Device: CODESYS for Linux V4.9.0.0 CODESYS IDE: V3.5 SP19 Patch 1
Last updated: 2023-09-21
When using the Element Collections library, is there a proper way to remove a dynamically created collection from memory?
CODESYS Forge
talk
(Thread)
When using the Element Collections library, is there a proper way to remove a dynamically created collection from memory?
Last updated: 2022-09-08
Post by sedoerr on Check For Open Dialogs On Client
CODESYS Forge
talk
(Post)
You need to create a function around this function to check the dialogs you use in your program. That's the way i have done it.
Last updated: 2023-09-26
Post by derpaul on Official MQTT-Client: MAX_RECEIVE_BUFFER_SIZE_EXCEEDED
CODESYS Forge
talk
(Post)
I've got it running again! For testing I've extendet the g_udiMaxPacketSize from 6000 to 100000 and g_udiMaxPayloadSize from 4096 to 80000 After it does run again! Thank you very much for your help!
Last updated: 2023-09-28
Post by damian177 on MQTT_client disconnect when call MQTT_sunscribe
CODESYS Forge
talk
(Post)
Probably I have the same problem, When I connect to broker and try subscribe to much topics then the client return error, did you solve your problem ?
Last updated: 2023-10-10
When using the Element Collections library, is there a proper way to remove a dynamically created collection from memory?
CODESYS Forge
talk
(Thread)
When using the Element Collections library, is there a proper way to remove a dynamically created collection from memory?
Last updated: 2023-10-31
Post by oazrad on Async Manager
CODESYS Forge
talk
(Post)
anyone found any sample code for this library? I'm trying to work with AsyncManager but the documentation is not helping? Surly, codesys when they coded this library they had a sample project to test and simulate the functionality for this library. can you share it please ?
Last updated: 2023-11-15
Post by simotion on Axis variable indicating modulo of finite setting
CODESYS Forge
talk
(Post)
What variable of the axis indicates it is a modulo of finite axis? I want to check that in the code, to adopt my motion code between the two types.
Last updated: 2023-11-24
Post by shabroz-gill on Unable to load boot application on ARMv7 device restart
CODESYS Forge
talk
(Post)
The boot application already exists on the device, i can see the MPC.app file in the proper place. It is not able to load it on startup though
Last updated: 2023-12-01
Why I need empty the FB to reset them? Even it's I created and there not a empty logic
CODESYS Forge
talk
(Thread)
Why I need empty the FB to reset them? Even it's I created and there not a empty logic
Last updated: 2023-02-14
Can a table be used as an input to date and time variables on a function block diagram?
CODESYS Forge
talk
(Thread)
Can a table be used as an input to date and time variables on a function block diagram?
Last updated: 2022-09-15
Why I need empty the FB to reset them? Even it's I created and there not a empty logic
CODESYS Forge
talk
(Thread)
Why I need empty the FB to reset them? Even it's I created and there not a empty logic
Last updated: 2023-02-14
Using CoDeSys on Raspberry Pi to poll ModbusTCP slave data, and uplink by using LoRaWAN ATIM ACW-XB
CODESYS Forge
talk
(Thread)
Using CoDeSys on Raspberry Pi to poll ModbusTCP slave data, and uplink by using LoRaWAN ATIM ACW-XB
Last updated: 2019-01-08
Can a table be used as an input to date and time variables on a function block diagram?
CODESYS Forge
talk
(Thread)
Can a table be used as an input to date and time variables on a function block diagram?
Last updated: 2022-09-15
Not able to create an OPC UA certificate in my Beaglebone Black (linux Debian) on CODESYS 3.5 SP19
CODESYS Forge
talk
(Thread)
Not able to create an OPC UA certificate in my Beaglebone Black (linux Debian) on CODESYS 3.5 SP19
Last updated: 2023-05-28
transfer Files from one controller to other controller on Canbus ( both controller are developed on codesys v3.5
CODESYS Forge
talk
(Thread)
transfer Files from one controller to other controller on Canbus ( both controller are developed on codesys v3.5
Last updated: 2017-07-17
To search for an exact phrase, put it in quotes. Example: "getting started docs"
To exclude a word or phrase, put a dash in front of it. Example: docs -help
To search on specific fields, use these field names instead of a general text search. You can group with AND
or OR
.