Search talk: Communication State

 
<< < 1 .. 18 19 20 21 > >> (Page 20 of 21)

Post by timvh on Communication between applications on same device/controller/runtime (Win RTE 3.5.20.20) CODESYS Forge talk (Post)
If you have a Windows system (RTE), then why not run the CODESYS HMI as separate controller. This could easily be moved to another PC if required. In the HMI you could also still use the Symbolic Var access as part of the Data Source Manager, although maybe OPC is the preferred way to make it more future proof. Or what about the Remote Target Visu. Then you can reduce the load of the main controller, while still only having to create one application including Visualization. This is now also supported for Linux systems. See: https://content.helpme-codesys.com/en/CODESYS%20Control/_rtsl_target_visu_for_linux.html https://content.helpme-codesys.com/en/CODESYS%20Visualization/_visu_execute_remote_target_visu.html
Last updated: 2024-09-28

Post by open on How to create a stopwatch? CODESYS Forge talk (Post)
Hi @ph0010421, I tried the program the TimeTaken is calculated when stop is triggered. I want the TimeTaken to be continuously calculated and counting when a BOOL variable is true. I tried to program this way: Declaration: PROGRAM PLC_PRG VAR bStartStop: BOOL := FALSE; // Start/Stop button bReset: BOOL := FALSE; // Reset button bRunning: BOOL := FALSE; // Flag indicating whether the stopwatch is running tStartTime: TIME; // Variable to store the start time tElapsedTime: TIME; // Variable to store the elapsed time END_VAR Implementation: // Main program logic IF bReset THEN // Reset button pressed, reset the stopwatch bRunning := FALSE; tElapsedTime := T#0s; ELSIF bStartStop THEN // Start/Stop button pressed, toggle the running state IF bRunning THEN // Stop the stopwatch bRunning := FALSE; ELSE // Start the stopwatch bRunning := TRUE; tStartTime := tElapsedTime; END_IF; END_IF // Update the elapsed time when the stopwatch is running IF bRunning THEN tElapsedTime := tElapsedTime + T#1s; // Adjust the time increment as needed END_IF However counting of the seconds is not accurate. I tried changing the main task cycle time interval to 1000ms. The counting of seconds become slower. (see attached) Please help
Last updated: 2023-12-08

Post by mavitia on Application based license problem - Modbus TCP CODESYS Forge talk (Post)
I am running ubuntu on a raspberry pi, and installed an application based license Control Basic M on it, it runs a demo program fine, does not timeout etc. however, when I add a modbus TCP device, I start getting errors: <Entry severity="error" component="CmpApp" user="nobody" timestamp="12/18/2023 3:49:42 PM" infoId="24">Online change denied. Application Application is in exception state!</Entry> <Entry severity="error" component="CmpApp" user="nobody" timestamp="12/18/2023 3:49:42 PM" infoId="68">Download failed: Application=Application</Entry> <Entry severity="exception" component="CmpApp" user="nobody" timestamp="12/18/2023 3:49:41 PM" infoId="0">Application app=Application has invalid license metrics!</Entry> the modbus tcp slave runs, and the counter ticks up, however, when I call the variables on the %IX0.0 in my program, and try to upload the changes, I am getting the error messages which stop the program as far as I understand, the application based, M includes 2 fieldbus instances, but on the other side is fairly new, anything obvious I am missing out here?
Last updated: 2023-12-18

Post by vipul on Multicast udp CODESYS Forge talk (Post)
Hi, Good afternoon can anybody help me with UDP Multicast code. I am not able to send or recieve data when code is dumped on linux device. Below is my code. Declaration: PROGRAM udp_multicast VAR oneTimeFlag :UINT :=0; state: INT:=0; driver: UDP.UDPDriver; //port : UDP.Port;//moved to GVL src_ipAddr_ud: UDINT; src_ipAddr_st:STRING := '192.168.127.155';//'192.168.1.155';//ipms ip address dst_ipAddr_ud:UDINT; group_ipAddr_st:STRING := '239.1.5.10'; //group_ipAddr_ud:UDINT; result: SysTypes.RTS_IEC_RESULT; //result of recieve function. bind: UDINT; //result of binding. resultCreate:SysTypes.RTS_IEC_RESULT;//result of port creation. timer:BLINK; temFlag :INT:= 0; post:INT :=0; checksumFunc:checksumXor; localStringBuf:STRING[500]; chksum:BYTE; dataBuffer:POINTER TO BYTE; checksumString:ARRAY[0..5] OF BYTE; recvSize:__XINT; errorCode:UDINT; joinGroupErrorCode:UDINT; END_VAR ************8 Implementation: IF oneTimeFlag <> 1 THEN oneTimeFlag:=1; resultCreate := driver.CreatePort(ADR(GVL.port)); src_ipAddr_ud := UDP.IPSTRING_TO_UDINT(sIPAddress:= src_ipAddr_st); GVL.group_ipAddr_ud := UDP.IPSTRING_TO_UDINT(sIpAddress:= group_ipAddr_st); GVL.port.IPAddress := src_ipAddr_ud; GVl.port.ReceivePort:= GVL.src_port;//port on which messages are expected. GVl.port.SendPort := GVL.dest_port; GVl.port.OperatingSystem := 0; //0- any system GVL.port.Socket :=3; //3- socket type is multicast bind := GVL.port.Bind(udiIPAddress:=src_ipAddr_ud,); GVl.port.JoinGroup(udiGroupAddress:= GVL.group_ipAddr_ud,udiInterfaceAddress:= src_ipAddr_ud,eLogCode=>joinGroupErrorCode); END_IF timer(ENABLE:=TRUE,TIMELOW:=T#100MS,TIMEHIGH:=T#100MS); IF timer.OUT = TRUE THEN GVL.port.Send(udiIPTo:=GVL.group_ipAddr_ud,GVL.dest_port,pbyData:=ADR(GVL.writeData),diDataSize:=SIZEOF(GVL.writeData)); ELSE SysMemSet(ADR(GVL.readData[0]),0,SIZEOF(GVL.readData)); result := GVl.port.Receive(ADR(GVL.readData),diDataSize:=SIZEOF(GVL.readData),udiIPFrom=>dst_ipAddr_ud,diRecvSize=>recvSize,eLogCode=>errorCode); SysMemMove(ADR(GVL.readDataBuf[0]),ADR(GVL.readData[0]),SIZEOF(GVL.readData)); END_IF post:=LEN(GVL.readDataBuf);
Last updated: 2024-01-14

Post by umdee on Error when monitoring LAD programs CODESYS Forge talk (Post)
System Information from the computer being used: OS Name Microsoft Windows 11 Pro Version 10.0.22631 Build 22631 Other OS Description Not Available OS Manufacturer Microsoft Corporation System Manufacturer Dell Inc. System Model Latitude 5500 System Type x64-based PC System SKU 08B9 Processor Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz, 2112 Mhz, 4 Core(s), 8 Logical Processor(s) BIOS Version/Date Dell Inc. 1.3.11, 6/11/2019 SMBIOS Version 3.2 Embedded Controller Version 255.255 BIOS Mode UEFI BaseBoard Manufacturer Dell Inc. BaseBoard Product 0M14W7 BaseBoard Version A00 Platform Role Mobile Secure Boot State On PCR7 Configuration Elevation Required to View Windows Directory C:\WINDOWS System Directory C:\WINDOWS\system32 Boot Device \Device\HarddiskVolume1 Locale United States Hardware Abstraction Layer Version = "10.0.22621.2506" User Name CARDASSIA-IX\Engineer Time Zone Eastern Daylight Time Installed Physical Memory (RAM) 16.0 GB Total Physical Memory 15.8 GB Available Physical Memory 4.67 GB Total Virtual Memory 18.5 GB Available Virtual Memory 2.52 GB Page File Space 2.63 GB Page File C:\pagefile.sys Kernel DMA Protection Off Virtualization-based security Not enabled Windows Defender Application Control policy Enforced Windows Defender Application Control user mode policy Off Device Encryption Support Elevation Required to View Hyper-V - VM Monitor Mode Extensions Yes Hyper-V - Second Level Address Translation Extensions Yes Hyper-V - Virtualization Enabled in Firmware Yes Hyper-V - Data Execution Protection Yes
Last updated: 2024-03-19

Post by salvadegianluca on How to use TON inside an FB that is instanced within a Visu page CODESYS Forge talk (Post)
Hi everyone; I'm building a project in which the drag of the mouse over some controls (or the click event) changes the background color of the control items; this change of color is made with an FB that assignes a color code to the background with MUX command based on the value of an enumerator, this part is perfectly working but, when I'm using a touchpanel instead of a web visu (controlled by a mouse) I get into some issues as it seems that the touch operations are not triggering the MouseEnter and MouseLeave properties as it's done with the mouse.... For this reason I'm trying to add a TON to my FB and, if the enum that changes color remains at the same state for more then 3s I'm automatically resetting it to it's "0" so the item gets back the not selected color. Anyhow it looks like the TON function from library is not working in these FB that are instanced in the various visualizations, as instead they do if I create some instances within the POUS. Anyone has ideas of how to make them work?
Last updated: 2024-04-15

Post by salvadegianluca on How to use TON inside an FB that is instanced within a Visu page CODESYS Forge talk (Post)
Hi everyone; I'm building a project in which the drag of the mouse over some controls (or the click event) changes the background color of the control items; this change of color is made with an FB that assignes a color code to the background with MUX command based on the value of an enumerator, this part is perfectly working but, when I'm using a touchpanel instead of a web visu (controlled by a mouse) I get into some issues as it seems that the touch operations are not triggering the MouseEnter and MouseLeave properties as it's done with the mouse.... For this reason I'm trying to add a TON to my FB and, if the enum that changes color remains at the same state for more then 3s I'm automatically resetting it to it's "0" so the item gets back the not selected color. Anyhow it looks like the TON function from library is not working in these FB that are instanced in the various visualizations, as instead they do if I create some instances within the POUS. Anyone has ideas of how to make them work?
Last updated: 2024-04-15

Post by ricola on ERROR: CodeMAccess2: Used CmRuntime 2.61.2705.500 is too old CODESYS Forge talk (Post)
hi there , can someone tell me how to deal with this error , please? I use the Linux ARM64SL (4.11) on a bullseye distro and when I want to update or install some package, I have the following reply : pi@NanoPi-R5C:~$ sudo apt upgrade Reading package lists... Done Building dependency tree... Done Reading state information... Done You might want to run 'apt --fix-broken install' to correct these. The following packages have unmet dependencies: ** codesyscontrol : Depends: codemeter but it is not installable or codemeter-lite but it is not installable** E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution). and if I try apt --fix-broken install as suggested, I have a proposal to uninstall codesyscontrol ... :-D so I tried to search if there is some Codesys repo: nothing, then I tried to see if ther was something inside Codesys dev (V3.5.20) and I only found that by reading/requesting my device, i spoted that codemeter was too old . I don't see how to deal with this issue. is there a codemeter.deb somewhere ? thanks in advance for any help.
Last updated: 2024-09-17

Post by smeitink on Timeout Error in Modbus Communication with WAGO PFC200 and iEM2050 Meter using 750-652 Module CODESYS Forge talk (Post)
Hi all, I'm looking for help with an issue I've come across while trying to facilitate Modbus communication between a WAGO PFC200 PLC using a 750-652 communication module and an iEM2050 Series Single Phase Energy Meter. I believe to have everything wired and setup correcty, but I keep running into a "Error time out" message, and by now I don't really know what else to try. My setup is as follows: A PFC200 Wago PLC, which has 2 750-652 Serial Interfaces extension modules connected to its field bus. I'm using one of these to talk to a Schneider iEM2050 - kWh-meter over modbus. I have connected terminal 23 (A) of the iEM2050 to connector 6 (A) on the 750-652. I have connected terminal 24 (B) of the iEM2050 to connector 2 (B) of the 750-652. I'm using 200mm of twisted together wires to connected them both, and I have placed a 120 ohm resistor between A and B at both ends. I've attached relevant pinout images to this post. I then wrote a simple program that configures the Mobus port, as per the datasheet of the iEM2050. You can find an image of the relavent page attached to this post too. This is my program: PROGRAM PLC_PRG VAR Master: FbMbMasterSerial; xIsConnected: BOOL; xError: BOOL; iIndex: INT := 1; xTrigger: BOOL; utQuery : typMbQuery := ( bUnitId := 1, // The Modbus unit or slave address bFunctionCode := 4, // Function code for reading input registers uiReadAddress := 1829, // adress for the Power on off counter uiReadQuantity := 1 // Quantity of registers to read ); iStep: INT; oStatusModbus: WagoSysErrorBase.FbResult; utResponseModbus: typMbResponse; xConnect: BOOL := FALSE; delayTimer: TON; END_VAR Master( xConnect:= xConnect, I_Port:= _750_652_24_1, udiBaudrate:= 9600, usiDataBits:= 8, eParity:= WagoTypesCom.eTTYParity.Even, eStopBits:= WagoTypesCom.eTTYStopBits.One, eHandshake:= WagoTypesCom.eTTYHandshake.None, ePhysical:= WagoTypesCom.eTTYPhysicalLayer.RS485_HalfDuplex, xIsConnected=> xIsConnected, xError=> xError, oStatus=> oStatusModbus, eFrameType:= WagoAppPlcModbus.eMbFrameType.RTU, tTimeOut:= T#5S, utQuery:= utQuery, xTrigger:= xTrigger, utResponse:= utResponseModbus); delayTimer(IN := TRUE, PT := T#3S); // Use the Q output of the timer to set xConnect after the delay IF delayTimer.Q THEN xConnect := TRUE; END_IF CASE iStep OF 0: //Wacht totdat de master de poort geopend heeft IF xIsConnected THEN iStep := 1; END_IF 1: //Stuur request naar de slave xTrigger := TRUE; iStep := 2; 2: //Wacht totdat de master klaar is met het afhandelen van de request IF NOT xTrigger THEN iStep := 3; END_IF END_CASE The TON delay before opening the port is due to a an error I encountered when opening it straight away. This seems to be a bug, as described here. However, the TON solved that particular issue. I tried reading multiple registers, but like I said, I still always end up with the "Error time out". What else can I test or try at this point?
Last updated: 2024-02-24

Post by paulg on RasPi CAA Serial example - unexpected behavior during debug CODESYS Forge talk (Post)
I've trimmed down the CAA Serial Codesys example to only listen on one port but, when stepping through the Case structure in debug mode, it jumps out of the structure during a specific point in every scan (I'll point it out below after describing the setup and listing the code). I'm using a Pi 4 Model B, and I have an Arduino Nano Every plugged in via USB which is streaming the following serial message at 1 Hz: Time since opening connection: 1 s Time since opening connection: 2 s ...and so on. The Pi shows the Nano at /dev/ttyACM0 so I edited CODESYSControl_User.cfg to read: Linux.Devicefile=/dev/ttyACM The code in my PLC_PRG is (ignore some of the comments, I hadn't deleted them out from the original example): PROGRAM PLC_PRG VAR xStartTest : BOOL:= TRUE; iState : INT; xTestDone : BOOL;(* True, when the test was done succesfully *) (* Settings to communicate with the COM Port *) aCom1Params : ARRAY [1..7] OF COM.PARAMETER; como1 : COM.Open; comc1 : COM.Close; comw1 : COM.Write; comr1 : COM.Read; //sWrite : STRING := 'Test String!'; sRead : STRING(25); szRead : CAA.SIZE; xCom1OpenError : BOOL; xCom1CloseError : BOOL; xCom1WriteError : BOOL; xCom1ReadError : BOOL; END_VAR //This example shows the communication of two COM Ports with each other. //The first one writes a string of characters, which is read by the second one. //After successful execution, the two COM Ports are closed and the test is done. IF xStartTest THEN CASE iState OF 0: //The parameters are set for the COM Port aCom1Params[1].udiParameterId := COM.CAA_Parameter_Constants.udiPort; aCom1Params[1].udiValue := 1; // the correct Port should be adapted aCom1Params[2].udiParameterId := COM.CAA_Parameter_Constants.udiBaudrate; aCom1Params[2].udiValue := 115200; aCom1Params[3].udiParameterId := COM.CAA_Parameter_Constants.udiParity; aCom1Params[3].udiValue := INT_TO_UDINT(COM.PARITY.NONE); aCom1Params[4].udiParameterId := COM.CAA_Parameter_Constants.udiStopBits; aCom1Params[4].udiValue := INT_TO_UDINT(COM.STOPBIT.ONESTOPBIT); aCom1Params[5].udiParameterId := COM.CAA_Parameter_Constants.udiTimeout; aCom1Params[5].udiValue := 0; aCom1Params[6].udiParameterId := COM.CAA_Parameter_Constants.udiByteSize; aCom1Params[6].udiValue := 8; aCom1Params[7].udiParameterId := COM.CAA_Parameter_Constants.udiBinary; aCom1Params[7].udiValue := 0; //The first Port is opened with the given parameters como1(xExecute := TRUE, usiListLength:=SIZEOF(aCom1Params)/SIZEOF(COM.PARAMETER),pParameterList:= ADR(aCom1Params)); IF como1.xError THEN xCom1OpenError := TRUE; iState := 1000; END_IF //After a successful opening, the next state is reached IF como1.xDone THEN iState := 15; END_IF 15: // the reading process is started comr1(xExecute := TRUE,hCom:= como1.hCom, pBuffer:= ADR(sRead), szBuffer:= SIZEOF(sRead)); IF comr1.xError THEN xCom1ReadError := TRUE; END_IF //After completion the size of the written bytes are saved IF comr1.xDone OR comr1.xError THEN szRead := comr1.szSize; iState := 20; END_IF 20: // If everything was successful the ports are closed and the handles are released comc1(xExecute := TRUE,hCom:= como1.hCom); IF comc1.xError THEN xCom1CloseError := TRUE; END_IF IF comc1.xDone OR comc1.xError THEN iState := 25; END_IF 25: // The first port is closed and the used handle released xTestDone := TRUE; xStartTest := FALSE; iState := 0; como1(xExecute := FALSE); comw1(xExecute := FALSE); comc1(xExecute := FALSE); ELSE iState := 0; END_CASE END_IF I realize as I write this that the .udiPort should be 0 and not 1, but that shouldn't be causing the issue I'm seeing. I'm forcing xStartTest:=TRUE every scan so that I can step into each line and observe what's happening. What I see is that the port parameters are set and the port is opened with no errors, but the code jumps out of the case structure to the last line every time it reaches (and I step into) the iState:=15 line (at the end of the iState:=0 block). So every scan cycle it goes through the block for iState=0 and jumps out at the same spot. I'm a little new to PLC programming so I may be misunderstanding the flow, but shouldn't this case structure keep moving down in the same scan? If it only handles one case per scan, why doesn't the value of iState persist? Thanks! Update: I restarted the Codesys control today and I was then able to see an error for como1.eError of "WRONG_PARAMETER". I tried doing some digging and another post made me think I should add another line to CODESYSControl_User.cfg, so I now have: [SysCom] Linux.Devicefile=/dev/ttyACM portnum := COM.SysCom.SYS_COMPORT1 So now when I set .udiPort to 1, I get "NO_ERROR" but I also don't read anything from the port (i.e. szRead = 0 always). If I try setting the port to 0 (which I'm confused about, because I added a COMPORT1 line but the device shows on the Pi as ACM0), I get the "WRONG_PARAMETER" error again. Is there an easier way to troubleshoot the Pi and view what ports the Codesys runtime is actually able to see while the Pi is running?
Last updated: 2024-06-06

Post by ofey on Codesys Soft PLC OPC UA server CODESYS Forge talk (Post)
Hi! I'm sorry if this has been asked before. I have tried looking up previous topics regaring this, but even though I'm following tutorials and other posts I cant seem to get this to work consistently. I actually got the connection established on a test project after some trial and error. I only got it to work with the "Anonymous login". But after i deleted the test project and tried to get the same thing to work on another project I cant get it to work anymore. What I'm trying to do: Set up and OPC UA Server using CODESYS with the free soft PLC. I then try to connect to the OPC UA Server with the program "UaExpert". What happens: I get the error Error "'BadUserAccessDenied' was returned during ActivateSession". What I have done in CODESYS: - Added the object "Symbol configuration" and checked some test variables - Checked "Support OPC UA features - In "Communication settings -> device -> Change runtime security policy" I have checked "Allow anonymous login" What I have done in UAExpert: - Found the OPC UA server under "local". (It is showing two servers though, I do not know why. It showed the same when it worked yesterday). Se attachment - Checked "Anonymous" under "Authentication settings in the OPC UA server. I'm new to CODESYS, so it could be something elementary wrong in my settings. Maybe something in the user settings in CODESYS regarding user rights or something?
Last updated: 2023-09-14

Post by giackanto on Eoe issues with Windows and Linux CODESYS Forge talk (Post)
Hello, I've been trying to use EoE for communication between a Windows PC and an M753 drive from Control Technique. Despite following some online guides (https://content.helpme-codesys.com/en/libs/EtherCATStack/4.3.0.0/Ethernet_over_EtherCAT/fld-Ethernet_over_EtherCAT.html) I haven’t had any success. Both are connected to a Debian device where RTE is running: The PC is connected via the Ethernet port. The drive is connected via the EtherCAT port. I'm unable to ping the drive from my Windows PC. Here is my configuration: On Debian: (See attachments 1, 2, 3) enp1s0 = Ethernet port enp2s0 = EtherCAT port tap2 = TAP device IP forwarding and routes are both configured. On Windows: (See attachments 4, 5) On Codesys: (See attachments 6, 7) Version: Windows 11 Debian GNU/Linux 11 Codesys 3.5.17 Control for Linux SL 4.7.0 EtherCAT 4.4.0 With this configuration, I can ping the TAP device, but not the drive (See attachment 8). Could someone explain how to properly configure all these settings? Thank you, GA
Last updated: 2023-12-19

Post by forest on SM Drive license error CODESYS Forge talk (Post)
Hi, when it comes about license, I used INVTmatic Studio, which uses Codesys, for programming INVT plc. I bought Codesys Modbus license, it was not expensive, and then realised that INVT didn't have License Manager option (greyed out in program) which is needed for using of Codesys License. I contacted support from INVT, but developers told me that option is still not available. So depending on environment for programming Codesys, you can or not use Modbus license. Good thing about this version of Modbus TCP it works both direction. I could send commands and receive feedbacks from drive. But communication stops after 30 mins. So I used simple version of ethernet modbus which is somewhere in INVT or Condesys library (I can check tomorrow) which works only one way. I could send cmd to drive, and control it, but didn't have any feedback, like some readings back in PLC. which is bad, but at least I could start it and it didn't fail after 30 mins.
Last updated: 2024-01-10

Post by toby on Ethernet/IP communication with Omron NX1P2 CODESYS Forge talk (Post)
Hey guys, I'm very much a noob with networking, it's my achillies heel, and this is my first networking project using Ethernet/IP. Any help offered is GREATLY appreciated. I'm trying to network a Codesys Project with an Omron NX1P2 PLC. I'm using EIP due to hardware restrains. I've added the fieldbus, EIP scanner (as the master), and made a Network Variable List. On the Sysmac Studio end, I've made the variables and set them to network inputs/outputs, registered them in EIP settings, but when I try to set the target device (the Codesys project), I suspect I need to import an EDS file for the EIP mapping. Back in the Codesys project, I'm not sure how to: - Make an EDS file to share with Sysmac Studio - How to link the target device (Omron PLC) to the EIP fieldbus - How to map the inputs from the Omron PLC. Im sorry for my very open request for help, i'm kind of lost looking through the various forums/video/tutorials as many of them dont match what im trying to do. Any help, or sample programs would be so so greatly appreciated. If you need any further clarifications, please feel free to ask. Thanks in advance, Toby
Last updated: 2024-01-24

Post by chalk on No source code available CODESYS Forge talk (Post)
Hello, This is my first time using Codesys, I am trying to add EtherNetIP communication to a Raspberry PI. I’ve added the EtherNetIP Adapter configured the network setting and added some modules to the pi but when I download the project it generates the following error: “There is no source code available for the object because it is in the compiled library ‘cip object, 4.5.1.0 (3s – smart software solution gmbh)’. Do you want to browse for the original library in order to display the source code? There are 2 errors in the log which are: SOURCEPOSITION App=[Application] area=3, offset=332760 EXCEPTION [Application] occurred: App=[Application], Task=[ENIPAdapterServiceTask] I can’t for the life of me work out how to get around this. I can’t find the source code anywhere or any information regarding this error. I’m using Codesys V3.5 SP19 Patch 3, the version of the Ethernet adapter is 4.5.1.0 and the version of the modules is 4.1.0.0. Any help on this will be greatly appreciated. Thanks
Last updated: 2024-02-02

Post by yannickasselin on Connect to remote PLC via local pc and teamviewer CODESYS Forge talk (Post)
Yes it is possible. I did it a lot of times using TeamViewer VPN. Unfortunately, TeamViewer VPN only works on Windows. If the remote PLC is a Codesys runtime running on Windows, you should be able to login directly using TeamViewer VPN if it is installed on the PC/PLC. If it is not Windows based, you can still do it but you need to have a Windows based PC acting as a gateway in the middle. In this case you need to enable IP Forwarding on the Windows remote PC (the gateway) and you need to setup the gateway IP address on the PLC to be the address of the Windows PC. Then you need to add a route on your local PC to point to the gateway PC for Codesys communication. I know it may not be detailed enough but I did not want to make a whole tutorial on how to do it. Bottom line, it is possible. I do it all the time.
Last updated: 2024-02-02

Post by timl on BacNet "Unaufgelöste Referenz" CODESYS Forge talk (Post)
Hallo, ich habe Probleme beim nachbauen des BacNet2 Tutorials "Erste Schritte" aus der CODESYS Online Help. https://content.helpme-codesys.com/de/CODESYS%20BACnet/_bacnet_first_steps.html Das Anlegen des BacNet2 Servers und der danach folgenden BacNet Datenpunkte erfolgt ohne Probleme. Der Code lässt sich mit F11 auch Fehlerfrei generieren. Beim Download auf die SPS tritt dann der Fehler auf dem Bild auf. Anbei auch ein Bild des Logs nach dem Download. CODESYS BACnet 2.0.0.0 ist über den Installer runtergeladen. Device: CODESYS Control Win V3 x64 Version 3.5.19.40 CODESYS 3.5.19.40 Im Bibliotheksverwalter ist BACnet2 2.0.0.0 aufgeführt Die Konfigurationsdatei habe ich mit folgenden anpassungen abgespeichert: [ComponentManager] Component.1=CmpTargetVisuStub Component.2=CmpWebServer Component.3=CmpWebServerHandlerV3 Component.4=SysCpuMultiCore Component.5=SysReadWriteLock Component.6=SysCpuBreakpoints Component.7=SysPipeWindows ;Component.8=CmpHilscherCIFX ;Component.9=CmpPCANBasicDrv ;Component.10=CmpCANFoxDrv ;Component.11=CmpIxxatCANDrv ;Component.12=CmpBlkDrvCanServer ;Component.13=CmpBACnet Component.14=CmpBACnet2 [CmpBACnet2] ;configuration file of the BACnet stack IniFile=$PlcLogic$/bacstac2.ini ;task priority of the BACstack process task, default: TASKPRIO_NORMAL_END (159) TaskPrio=128 ;name of the named pipe for the communication with the BACstack AppName=/tmp/BACnetServer Habe ich etwas vergessen?
Last updated: 2024-02-16

Post by rabaggett on Reading Named Pipes in Linux Is there a better way? CODESYS Forge talk (Post)
I have a Python program that will handle things in my application such as VISA over IP and Telnet control of instruments. I want the main control and HMI in Codesys. My problem is communication between the two. I have looked at several ways to accomplish this, and settled on having the Python program create two named pipes, one to send information to Codesys, and one for Codesys to send information to Python. The information would be packetized with \n for end of packet.. Seems simple. I think the named pipes method should work, but file reading in Codesys using the CAA file library starts to get difficult when the file is never ending, as in this case. Before I spend too much time making something that may be fundamentally flawed I want to ask. Is there a better way? Is there a way to read the file 'one line at a time' which might solve my never ending file problem? Thanks!
Last updated: 2024-05-09

Post by bjarne-pagaard on Communication between applications on same device/controller/runtime (Win RTE 3.5.20.20) CODESYS Forge talk (Post)
Thanks for this - I have now been looking in to just having an extra (non-RTE) runtime on the same machine, as you suggest. I will probably proceed this way. Even though it still seems very odd to me, that variable exchange to a different runtime is easier than between applications on the same controller. There will be some fun with the licensing, it seems. Does anyone know if it is possible to specify which license container/specific license the runtime is going to use at runtime. Let's say I have two available licenses with different resources available, for example one license allows multicore and multiple EtherCAT channels, but not many visu tags (for the RTE). Another with less resources but a lot of visu tags (for the Visu controller). Let's say the program in one of the controllers could be fully licensed by either of the two available licenses, but picks the 'largest' first. A bit later, the larger application starts, but is left with the smaller license.. How can I make sure that the 2 runtimes select the right license at startup?
Last updated: 2024-10-01

Post by egau on Hard shutdown: no code on device after power on CODESYS Forge talk (Post)
This explanation aligns with the issues we’re experiencing with our machines. The scenario I described is happening with one of them (let’s call it Machine A). This machine is identical to another one (Machine B), except for some custom code that facilitates communication with an external Beckhoff PLC for MES integration in the production line. Machine B has been powered on and off daily for at least three months and has never had this problem. Given that, I highly doubt the MES custom code is the cause of the code corruption. This being said, your explanation does seem plausible. However, if faulty EtherCAT cables were the issue, why wouldn't the error occur during normal operation? Why would bad cables only cause problems during a hard shutdown? One last question: When you encountered this behavior, did you see a similar error in your logs? i.e, an "AccessViolation" exception in the EtherCAT Task?
Last updated: 2024-10-03

Post by anonymous on Hi, I try to send and receive data using a UDP connection via SysSocket 3.5.17.0. While sending data works fine, I have problems with the receiving part. I am able to capture the received data of client side in wireshark But unable to capture it on the codesys CODESYS Forge talk (Post)
Hi, I try to send and receive data using a UDP connection via SysSocket 3.5.17.0. While sending data works fine, I have problems with the receiving part.I am able to capture the data of client side in wireshark but i am unable to capture it in the codesys. Heres the below part of code of client side. PROGRAM POU_udpclient_program VAR istep : INT := 1;//step variable for state machine xStart: BOOL;// Flag to start the UDP protocol iecSocketId: syssocket_interfaces.RTS_IEC_HANDLE;//socket handle for receiving iecCreateResult: syssocket_interfaces.RTS_IEC_RESULT; ipAddr: syssocket.SOCKADDRESS;//Socket address structure for receiving sIpAddress : STRING := '192.168.0.2'; wPort: WORD:= 12346; iecConnectResult : syssocket_interfaces.RTS_IEC_RESULT;//connect paramters sDataRec : STRING[255];//Buffer for received data xiRecBytes : __XINT;//number of bytes received iecRecResult : syssocket_interfaces.RTS_IEC_RESULT;//receive data parameters iecCloseResult : syssocket_interfaces.RTS_IEC_RESULT; END_VAR syssocket.SysSockInetAddr(sIpAddress,ADR(ipAddr.sin_addr)); ipAddr.sin_family := syssocket.SOCKET_AF_INET; ipAddr.sin_port := syssocket.SysSockHtons(wPort); CASE istep OF 1: //create socket IF xStart THEN iecSocketId:= syssocket.SysSockCreate(syssocket.SOCKET_AF_INET,syssocket.SOCKET_DGRAM,syssocket.SOCKET_IPPROTO_IP,ADR(iecCreateResult)); IF iecSocketId = syssocket_interfaces.RTS_INVALID_HANDLE THEN xStart := FALSE; istep := 1; ELSE istep := 2; END_IF END_IF 2: //connect to socket server using setoption iecConnectResult := syssocket.SysSockSetOption(iecSocketId,syssocket.SOCKET_SOL,syssocket.SOCKET_SO_REUSEADDR,ADR(ipAddr),SIZEOF(ipAddr)); istep := 3; 3: //receive data xiRecBytes := syssocket.SysSockRecvFrom(iecSocketId,ADR(sDataRec),SIZEOF(sDataRec),0,ADR(ipAddr),SIZEOF(ipAddr),ADR(iecRecResult)); istep := 4; 4: //close socket iecCloseResult:= syssocket.SysSockClose(iecSocketId); xStart := FALSE; istep := 1; END_CASE
Last updated: 2024-06-03

Post by mubeta on Some 'pathetic' errors in SoftMotion program CODESYS Forge talk (Post)
Thank you for your interest. Your answers are in line with what I knew, so at least it comforts me that I did not misinterpret the situation. However, I don't have an exact match as, for this project over the past few days I have: 1) I have gone back to leaving the various FBs of the motion always called, all of them, and in the state machine I use a boolean to activate the various useful Execute. (But in the future I want to go back and try the programming technique with which I wanted to develop this project); 2) For the occasional error: SMC_FB_WASNT_CALLED_DURING_MOTION perhaps it was due to the fact that I had set the Ethercat bus synchronism only at the CAN master level, but not at the level of individual drives. I have now also activated it for the individual drives and it does indeed seem to have been resolved, but having also adopted the programming technique mentioned in point 1), I cannot say whether this was the solution to the problem, or instead the previous point. Is there an error ‘regulator or start not set’ in the device log before the error ‘motion generating FB wasn't called for at least one cycle’? I can't answer that right now. By now the machine is running and I am no longer there, at this one. Also, I seem to remember that the 'fbeFBerror' drive structure (5-element array), does not cycle, BUT ONCE THE 5 EVENTS AFTER SWITCHING ON, IT DOES NOT UPDATE ANYMORE (but that's another issue), so diagnostics were not easy.
Last updated: 2024-07-24

Post by imdatatas on MC_CamIn did not work properly with SMC_FreeEncoder on SoftMotion 4.17.0.0 CODESYS Forge talk (Post)
Hello, I am facing a problem with the new Softmotion 4.17.0.0 version. Has anyone encountered a similar problem, what is the solution? I would be happy if you could share it. Problem description: -- "SMC_FreeEncoder" encoder axis is the master, -- The motor of the servo driver on the EtherCAT bus is the slave axis. -- When the MC_CamIn block executed, the InSync output is activated. However, although the master encoder axis position value changes, there is no movement in the slave servo axis! Test steps: 1-) EtherCAT servo axis installed, configured and motion test was performed with MC_Jog. No problem. 2-) Softmotion general axis pool > SMC_FreeEncoder was added and pulse amount configuration was performed. No problem. 3-) Incremental encoder actual count value was transferred to the "SMC_FreeEncoder.diEncoderPosition" variable as DINT under the ethercat task in every cycle and the encoder axis position value was observed. No problem. 4-) A simple CAM table with a 1:1 ratio was created under the project tree. (For example: Simply, when the encoder rotates 1 turn, the motor will rotate 1 turn.) 5-) The SMC_FreeEncoder axis enabled with MC_Power and brought to the StandStill state. 6-) The MC_CamTableSelect block was run with default input values ​​(all absolute) and only the Cam table name was specified. The Done output was seen successfully. No problem. 7-) The MC_CamIn block was activated with default input values ​​(absolute) and only the master encoder axis name, slave servo axis name, CamTableID input pins was specified and then "Execute" input set to TRUE. 8-) The InSync output information of the MC_CamIn block observed as TRUE. However, although the encoder axis value changed, the position value of the slave axis did not change at all, it did not move. It always remained at 0.0mm. 9-) When I repeated the same steps above, only changing the master axis to SM_Drive_Virtual instead of FreeEncoder and gave movement to the virtual axis, this time the slave axis moved successfully. However, when the same steps and operations are performed with the same IDE just downgrade SoftMotion version from 4.17.0.0 to 4.10.0.0, everything works normally and without problems as expected in MC_CamIn block with FreeEncoder master. (By the way, The used IDE version is Codesys V3.5 SP20patch3.) Best Regards Imdat
Last updated: 3 days ago

Post by ppix on Establishing TLS Connection with MQTT Broker using MQTT Client SL Package CODESYS Forge talk (Post)
I’m currently working on establishing a TLS connection with an MQTT broker using the MQTT Client SL package in CODESYS. While I’ve successfully established communication with the broker without TLS, I'm encountering issues when trying to enable TLS. In the 'MQTT Explorer' application, I can easily upload the server certificate (.crt), client certificate (.crt), and client key (.key). However, in CODESYS, I can’t find a way to upload my client key (.key file). Here's a summary of my current setup: Certificates: I have uploaded both the client and server certificates to the certificate store under the 'Trusted Certificates' folder in the security screen. TLS Context Initialization: Despite setting the _sCommonName as the name of my client certificate, a new self-signed certificate is created and placed within the device’s certificates. I then need to manually move this certificate to the trusted certificates folder. This results in three certificates in my trusted certs folder: client cert, server cert, and the newly created cert. _ciDefaultCertInfo : MQTT.NBS.CERT_INFO := (psInfo := ADR(_sCommonName), udiSize := TO_UDINT(LEN(_sCommonName))); // CN of the certificate (common name) _sCipherList : MQTT.NBS.CIPHER_LIST := STRUCT(psList := ADR('HIGH'), udiSize := 4); // Cipher string see https://www.openssl.org/docs/man1.1.1/man1/ciphers.html _tlsContext : MQTT.NBS.TLSContext := ( sUseCaseName := _sCommonName, // A certificate is stored in the certificate store with the use case name. You can choose any name. Here we use the common name. ePurpose := MQTT.NBS.PURPOSE.CLIENT_SIDE, // For client certificates set this to NBS.PURPOSE.CLIENT_SIDE sTLSVersion := '1.3', // The TLS version sCipherList := _sCipherList, // Set the cipher list sHostname := sHostname, // The hostname of the broker udiVerificationMode := 2, // 2 => Active Peer verification ciCertInfo := _ciDefaultCertInfo, // Set the cert info itfCertVerifer := 0); // 0 => No Verifier mqttClient : MQTT.MQTTClient := (xUseTLS:=TRUE, itfTLSContext := _tlsContext, itfAsyncProperty := _asyncProperty); Additional Details: In the client FB, I’ve set uiPort:= 8883, xUseTLS:= TRUE, and configured itfTLSContext as mentioned above. The certificates are encrypted with SHA256RSA. sHostname is the IP address of my broker. I’ve attached a copy of the client FB, which shows straight lines where variables are assigned and boxes where they are not. I am currently trying this on the only 2 compatible versions of COSDESYS with my controller (V3.5.15.20 and V3.5.18.40) My Question: How do I correctly set up this mTLS connection? What might I be missing? Any guidance or suggestions would be greatly appreciated, especially considering I’ve already successfully established a non-TLS connection with the same broker. Thank you in advance for your help!
Last updated: 2024-06-19

Post by gustavocsw on MQTT memory leak problem CODESYS Forge talk (Post)
Hello everyone, I'm using the IoT Library to implement the MQTT communication with my local broker server in order to publish and subscribe at specifics topics to share and consume information about my application. But, it seems that are occurring some memory leak problem in a "high" frequency (more than 10 Hz) subscribe process. I follow the same method as in IoT Lib exemples, and at first looks perfect but my PLC was rebooting frequently and when I check its memory usage that was increasing as fast as the subscribe massage was sent. I'm using a WEG PLC410 and a WEG PLC500, and this error occurred in both of them (including in CODESYS Control Win x64). The application sends to the system a message JSON with the float payload Ex. {"data" : 0.8500}, but this happens with a INT, or BOL as well. I use the follow code in my application to find the value: //FindFirstValueByKey VARs PROGRAM JSON_VELO VAR //------Setting the JSON Subscriber to Set the Relay Value jsonDataVelo : JSON.JSONData; jsonByteArrayReaderVelo : JSON.JSONByteArrayReader; xST1okVelo : BOOL; FindFirstValueByKeyVelo : JSON.FindFirstValueByKey; jsonElementVelo : JSON.JSONElement; xDoneReaderVelo : BOOL; xDoneFindVelo : BOOL; //STRING and WSTRING for Subscribe the massage sPayloadJsonVelo : STRING := 'opa'; psPayloadJsonVelo : POINTER TO BYTE := ADR(sPayloadJsonVelo); //wsPayloadJsonRelaySet : WSTRING := "opa"; wsPayloadJsonVelo : WSTRING := STRING_TO_WSTRING('opa'); pwsPayloadJsonVelo : POINTER TO WORD := ADR(wsPayloadJsonVelo); lrVelo : LREAL; xKeepAliveVelo : BOOL; xSetVelo : BOOL; RSSet : RS; LIMPAR : STRING; //Find the msg end sFindVelo : STRING := '}'; psFindVelo : POINTER TO STRING := ADR(sFindVelo); iLenVelo : INT; iSizeVelo : INT := 12; udiContMsg : UDINT; END_VAR // FindFirstValueByKey CODE // Relay Set configuration xSetVelo := MQTT_SUBSCRIBER.RSVelo.Q1; IF xSetVelo THEN xKeepAliveVelo := TRUE; END_IF IF xKeepAliveVelo THEN udiContMsg := udiContMsg + 1; iLenVelo := TO_INT(StrLenA(psPayloadJsonVelo)); iSizeVelo := iLenVelo - TO_INT(MQTT_SUBSCRIBER.udiPayloadSizeVelo); StrDeleteA(psPayloadJsonVelo,iSizeVelo,iLenVelo); wsPayloadJsonVelo := STRING_TO_WSTRING(sPayloadJsonVelo); pwsPayloadJsonVelo := ADR(wsPayloadJsonVelo); //MQTT.ConvertUTF8toUTF16(sourceStart:= ADR(sPayloadJsonVelo), targetStart:= ADR(wsPayloadJsonVelo), dwTargetBufferSize:= TAM, bStrictConversion:= 1); //Reset jsonByteArrayReader jsonByteArrayReaderVelo ( xExecute := TRUE, pwData := pwsPayloadJsonVelo, jsonData := jsonDataVelo, xDone => xDoneReaderVelo ); FindFirstValueByKeyVelo( xExecute := xDoneReaderVelo, wsKey := "data", diStartIndex:= 0, jsonData := jsonDataVelo, jsonElement => jsonElementVelo, xDone => xDoneFindVelo ); IF xDoneFindVelo THEN lrVelo := jsonElementVelo.value.lrValue; //Reset jsonByteArrayReader jsonByteArrayReaderVelo ( xExecute := FALSE, pwData := pwsPayloadJsonVelo, jsonData := jsonDataVelo, xDone => xDoneReaderVelo ); FindFirstValueByKeyVelo( xExecute := FALSE, wsKey := "data", diStartIndex:= 1, jsonData := jsonDataVelo, jsonElement => jsonElementVelo, xDone => xDoneFindVelo ); xKeepAliveVelo := FALSE; GVL.xSetVeloRead := TRUE; END_IF END_IF And this to subscribe at the topic: //SUBSCRIBE VAR: //----------------- Subscribe Velocity ----------------------- MQTTSubscribeVelo : MQTT.MQTTSubscribe;//Variable MQTTSubscriber block -X - function-X wsTopicSubscribeVelo : WSTRING(1024) := "CORE/odometry/GET/data/simp"; // Topic to publish a message sSubscribeMassageVelo : STRING; udiPayloadSizeVelo : UDINT; xSDoneVelo : BOOL; xSErrorVelo : BOOL; xReceiveVelo : BOOL; eSTypeVelo : MQTT.MQTT_ERROR; eSMQTTErrorVelo : MQTT.MQTT_ERROR; RSVelo : RS; udiCont : UDINT; //SUBSCRIBE CODE: MQTTSubscribeVelo( xEnable:= MQTT_CLIENT.xConnection_Broker AND NOT xSErrorVelo AND NOT JSON_VELO.xKeepAliveVelo, pbPayload:= JSON_VELO.psPayloadJsonVelo, udiMaxPayloadSize:= SIZEOF(JSON_VELO.sPayloadJsonVelo), udiPayloadSize => udiPayloadSizeVelo, mqttClient:= MQTT_CLIENT.ClientMQTT, wsTopicFilter:=wsTopicSubscribeVelo, xDone => xSDoneVelo, xError=> xSErrorVelo, xReceived => xReceiveVelo, eMQTTError=> eSMQTTErrorVelo ); RSVelo(SET := xReceiveVelo, RESET1 := JSON_VELO.xKeepAliveVelo);
Last updated: 2024-09-09

<< < 1 .. 18 19 20 21 > >> (Page 20 of 21)

Showing results of 503

Sort by relevance or date