Search talk: Communication task

 
<< < 1 .. 19 20 21 22 23 24 > >> (Page 21 of 24)

Post by tim-roelant on Profinet fault with codesys control V3 - Receive packet error CODESYS Forge talk (Post)
I have set up a brandnew Beckhoff panel pc with a codesys control runtime V3. I configured it together with 2 profinet field devices: a 16in/16out IO module from Turck and an MTS linear encoder. The machine works fine untill all of a sudden the communication breaks and the profinet participants become unreachable. At that point I can still ping the device, but the profinet master does not find them anymore: When i do a scan they are not found. When i do a cold restart, the profinet master becomes active again and the devices are found again. In the log i get Ethercat packet receive error: sysethernet. I am a little confused, there is no ethercat device in the device tree. I already set the send clock and the reduction ratio to higher values, but without result. Can codesys be configured, so that the communication re-establishes without doing the cold reset? This is very annoying and is causing a lot of prodution losses. regards Tim
Last updated: 2024-02-27

Post by brell on Automatic xExecute NBS.TCP_write CODESYS Forge talk (Post)
I've recently started experimenting with CODESYS for a project and am fairly new to it. I'm currently working with Function Block Diagrams (FBD) to set up TCP communication between a server and a client, where the client is implemented as a Python script. Once the communication is established, my connection status changes to True, which is the expected behavior. My challenge arises with the TCP write module, which requires the xEnable_write flag to toggle between True and False. If xEnable_write remains True, the module only performs a single write operation. To address this, I introduced a falling edge trigger (F_TRIG), expecting it to help in toggling xEnable_write and it does, However, I've encountered an issue where in the beginning after connxion established I need to manually set xEnable_write to True for the system to work as intended. I'm looking for a way to automate this process so that xEnable_write becomes True automatically upon establishing a connection . Initially, I tried setting xEnable_write to True from the start, but this approach didn't work well since it left the flag permanently True, preventing further toggling. I also experimented with using a TON timer, but I faced similar issues. I am seeking a solution that automatically toggles xEnable_write between True and False after a connection is established, ensuring continuous write operations without manual intervention. Any advice or guidance on how to achieve this would be greatly appreciated."
Last updated: 2024-03-05

Post by tariq on Using Hilscher CIFX Cards as EtherCAT Masters in CODESYS CODESYS Forge talk (Post)
Dear Codesys Support Team, I hope this message finds you well. I am currently working on a project that involves using a Hilscher CIFX card to act as an EtherCAT master within the CODESYS environment. Despite following the available documentation and setup guides, I have encountered some challenges and require assistance to ensure proper configuration and operation. Questions: 1- Could you please confirm if the Hilscher CIFX card is supported as an EtherCAT master in CODESYS? If so, are there specific drivers or configuration files that need to be installed? 2- Are there detailed setup guides or example projects available that demonstrate the integration of Hilscher CIFX cards with CODESYS for EtherCAT communication? 3- Is there any additional software or plugins required for ensuring seamless communication between the CIFX card and the EtherCAT slaves within CODESYS? Your support and guidance on these matters would be greatly appreciated, as it is crucial for the success of our project. Thank you for your time and assistance. I look forward to your prompt response. Best regards, TB
Last updated: 2024-07-02

Post by dekelec on Codesys 2.3 & Peak PCAN CODESYS Forge talk (Post)
I use Peak USB adapter daily to download from CoDeSys 2.3 and 3.5 to IFM, EPEC and other controllers. The process: - First you need to install the appropriate driver. Link: https://www.peak-system.com/Drivers.523.0.html?&L=1 - Restart the computer - Start the CoDeSys application - Change the name of the adapter in Communication parameters, as mentioned in previous comment. Write the name exactly as written "Peak_USB", as it could also be case sensitive (defines which .dll file to use). If this doesn't work I would contact the vendor of the controller to find out the procedure. In the attachment I've added a FAQ document from IFM regarding using PCAN USB. P.S. I've noticed in your picture of communication parameters a channel via TCP/IP is mentioned. In this case a USB to CAN connection is not being used. First you should change the channel/gateway to connect via CANbus or connect using an Ethernet cable.
Last updated: 2024-07-09

Post by programmierer on Implementing UDP Communication CODESYS Forge talk (Post)
Hello everyone, I hope you can help me with my problem. I am new to programming and am currently working with a WAGO controller in our lab, which controls a heat pump. My goal is to send the electrical power of the heat pump (Pel_WP) via a UDP connection to a specific IP address. I am using Codesys version 2.3 and following the guide I found here: https://forge.codesys.com/forum/de/396/genmed-Konfiguration%20der%20UDP%20Kommunikation%20Cosesys%20S7.pdf. I have adapted the guide to suit my needs. The data sending works since I can force the reception value Pel_WP and the data is sent accordingly. However, I am having trouble with the receiving part. The reception value is not being correctly received, and the diSocket variable shows -1. The connection between the heat pump and the WAGO controller seems to be set up correctly, as the heat pump is listed under the communication parameters with the correct IP address. I have also attached images to provide a better view of the setup. I would greatly appreciate any support or suggestions for a solution. Thank you in advance!
Last updated: 2024-08-02

Post by dogulas on OPC UA C# client connecting to OPC UA CODESYS server CODESYS Forge talk (Post)
Noob alert! I’m just getting my feet wet with CODESYS. I have a “Hello World” project in the CODESYS IDE. I’m using the Win SoftPLC on the same computer. I’ve added a Communication Manager under the Application node. Under that is “OPC UA Server -> IEC Symbol Publishing 01”. I also added “OPC_UA_Symbols -> Information Model”. I’m not sure I need the second thing. I was grasping at straws. I also set up several dummy symbols in the IEC Symbol Publishing 01 node. In my C# application, I am trying to get an instance of EndpointDescription from CoreClientUtils.SelectEndpoint(“opc.tcp://localhost:1217/Gateway-1”, useSecurity: false, 15000). I wasn’t sure about the “Gateway-1”. I found that in the CODESYS IDE under the project -> Communication Settings. When I execute the previous method call in C#, I get: “BadSecureChannelClosed”. I have no idea what that means. Any pointers to documentation are welcome.
Last updated: 2024-08-16

Post by bjarne-pagaard on Communication between applications on same device/controller/runtime (Win RTE 3.5.20.20) CODESYS Forge talk (Post)
Hi, I would like to divide a project into multiple applications - as a minimum: one handling visualization and Alarm Manager, one handling I/O and plant control logic. But how to exchange variables between the applications? What have you done to get such a solution? In versions 3.5.19 and earlier, you can have Child applications, where the children can access a GVL in the Parent application. Children apps is no longer possible in 3.5.20 - but you can have 'sibling' apps - Several apps directly under PLC Logic, that is. But how do they best communicate? The Communication Manager / Data Sources Manager is sort of possible via OPC UA, but it seems like overkill and with some limitations - for example no ARRAY OF STRUCT possible this way. If you have separate devices in your project, you can exchange data via 'CODESYS ApplicationV3', but not other applications in the same device (see attachment Datasources.png). You can do it via 'Select the project type'->'Other Project' and select the same project file, but this leads to crashing the Development system when working with the variables afterwards. It would be great to hear your thoughts / experiences on this topic - Bjarne
Last updated: 2024-09-27

Post by mainak on Opaque NodeId in the OPC UA server CODESYS Forge talk (Post)
Hello all, I am using the OPC UA server with my custom information model. I have used the communication manager to add my information model under my application and created instances from OPC UA types. I see that the created instances in the OPC UA server has some opaque nodeid (attached screenshot) and I want to change that. Therefore I have the following questions: 1. Is there a way to configure the NodeIds of instances in the OPC UA server? I tried to edit it using the UaExpert client but got error "BadNotWriteable". is it possible to configure it somewhere so that the nodeids can be changed using an external client? 2. Is there a way to define the rule for creating instance nodeids within the codesys IDE? 3. Is it possible to create the instances before e.g. using a modelling tool like UaModeler and import them as part of the information model and use them later? Using the communication manager, I can only create instances from types. I couldn't find a way to map my existing instances to plc tags from my application. It would be nice if someone could help me with these issues. Thanks in advance. :)
Last updated: 2024-10-19

Post by andrax on CodeSys Raspberry pi I2C driver not found CODESYS Forge talk (Post)
Hi, Communication with the ADS1115 is actually simple. 1. write config 2. write address pointer 3. read conversation register The ADS1115 works like a multiplexer. This means that you do this individually for each channel that you want to read. e.g: Channel 1: write config > write address pointer > read conversation register Channel 2: write config > write address pointer > read conversation register Channel 3: write config > write address pointer > read conversation register Channel 4: write config > write address pointer > read conversation register then you start again from the beginning You can also omit individual channels or read only one. It doesn't matter. I have written the driver so that I can also use it on the TCA9548. The driver is from Stefan Dreyer. In your case, the driver works and communication with the ADS1115 is running. As you can see, the cfgWrong:=FALSE If you could not write or read data, cfgWrong:=TRUE; This means that either something is wrong with your ADS1115 or you have connected something incorrectly. Question: what voltage do you want to measure?
Last updated: 2024-11-08

Post by thn-power on Updating OPC UA Core Nodeset on PLS CODESYS Forge talk (Post)
Hi After much trail and error I think I found the root cause to my OPC UA problem. The problem is that I cannot manage to build and download a program with a a custom OPC UA Information model. We use a Weidmueller WL2000 PLS, but the problem also exsist on the Win V3 PLC. Our custom information model is based on the latest versions of the OPC UA Core Nodeset v 1.05.03 (2023-09-20) and UA/DI nodeset 1.04.0 (2022-11-03) Those nodesets are installed in the Codesys Information Model Repository (3.5.19.6) However, when trying to build I get the following error. [ERROR] Untitled1: Communication Manager [Device: PLC Logic: Application]: The information model http://opcfoundation.org/UA/ is required by http://bos.org/ with a minimal publication date from 15.12.2023 but the device has only a model from 15.09.2021 installed. Probably the information model from 15.09.2021 is missing in the information model repository. [ERROR] Untitled1: Communication Manager [Device: PLC Logic: Application]: The information model http://opcfoundation.org/UA/DI/ is required by http://bos.org/ with a minimal publication date from 03.11.2022 but the device has only a model from 09.03.2021 installed. Probably the information model from 09.03.2021 is missing in the information model repository. Build complete -- 2 errors, 1 warnings : No download possible I think the problem is that the UA Core nodeset is implemented in the PLC firmware (at least that in Siemens S7), and that only includes the "old" nodeset from 2021-09-21 etc. So the question is, how (or if?) can I transfer the new nodeset to the PLS? I have created separate Information models under Communication manager with the newer code nodesets (UA and DI). But it seems that the compiler does not recognize them being excising, neither in the Codesys IDE or on the PLC. Would have guessed that this is a common issue, sine many manufacturers use the latest versions of the OPC UA standard, and that it would be a solution to the problem.
Last updated: 2024-09-20

Post by tvm on Web Client (HMI) Disconnects from Webvisu (Weidmuller u-OS) CODESYS Forge talk (Post)
ok, that's different than our issue then. We're using Schneider Electric M262 PLCs, and we've had it where certain web browsers cause the web server to only allow https connections, but it's not recoverable with a refresh. It usually requires a power cycle or even a full firmware flash. Your issue might have more to do with the timing. I don't know if it helps you, but we normally run our visu task at 200mS, with an update rate of 200mS. Seems to work. I went through this: https://faq.codesys.com/pages/viewpage.action?pageId=112525371 but it really seems like trial and error.
Last updated: 2023-09-06

Post by andrej on Threads and TID created by CODESYSControl Win V3 CODESYS Forge talk (Post)
Hi all, for a deeper understanding of the Codesys RTE - I created a simple application with 3 IEC tasks (Ta,Tb,Tc) each with different priorities, and different cycle times. The application runs on Windows 10 in the Soft PLC CODESYS Control Win V3. If my understanding is correct, the RTE i.e. the Process CodesysControlService should spawn 3 threads (Th_a,Th_b,Th_c) which are executed with the defined cycle times, the priority of the threads should reflect the priority of the task set in the Codesys IDE. Does somebody have an idea, how I could identify the respective threads in Windows? Kind regards Andrej
Last updated: 2023-10-02

Post by davidbo on Does the new license policy means I have to upgrade everything? CODESYS Forge talk (Post)
We have several old project written with 3.5.17 and 3.5.18 and also some older Until now when a customer ordered a product from us. We just installed (we have a tested image) and added a license Now the license policy has changed and we have to buy a License Control Basic S or M However it only works with CODESYS Development System Version 3.5.19.10 or higher Does that mean we have to upgrade all our old products? That is not a simple task as a previous post has explained with weird error messages from CODESYS V3.5. Next we have to do rigorous testing of our applications afterwards. It is very expensive
Last updated: 2024-01-11

Post by timvh on CODESYS V3.5 SP15 Patch 2 won't open CODESYS Forge talk (Post)
This is almost always related to previously working with an additonal monitor. If you have placed CODESYS on that monitor, later start your laptop again and open CODESYS without that monitor, then Windows still places it in the previous position, but then it is not visible. So the solution by cehermanstad can be used to move it to the main screen to make it visible again. PS, another way to move it, is by pressing SHIFT and then right-click on the icon in the task bar, then select move. You can then move it with the arrow keys or your mouse.
Last updated: 2024-02-27

Post by david24 on Map in Codesys CODESYS Forge talk (Post)
Hello everyone, I have the task of programming a map. With the help of the visualization element "Table", I have managed to accomplish this. In the Input Configuration, I activated the option: "Write Variables", so that the user can change the values in the map. To test the program, I select the Online Mode (Simulation).There I change the values in the map. When restarting the program in CODESYS, the changes in the map are no longer there. Does anyone know an approach how to save the changes in the map? Thank you for your support Best regards David
Last updated: 2024-04-02

Post by francesco86 on Script python for write in a file Project information CODESYS Forge talk (Post)
Dear all, My python script can read a Codesys project and save in file the different POU, but the problem is that I don't able to read the project info from the obj list. Following of this message there is my python script. Can you help my? Best regards Francesco # encoding:utf-8 # We enable the new python 3 print syntax from __future__ import print_function import os import shutil import time import sys from datetime import datetime print("--- Saving files in the project: ---") print("sys.argv: ", len(sys.argv), " elements:") for arg in sys.argv: print(" - ", arg) if (len(sys.argv)>1): folderExportName = sys.argv[1] print(" folderExportName: ", folderExportName) exportPath = sys.argv[2]+ sys.argv[3]+ "\\"+ sys.argv[1] print(" File path: ", exportPath) # git has_repo=False #save_folder=r'E:\Tmp\ControlPlugins\ControlPlugins\Export' save_folder = exportPath if not os.path.exists(save_folder): os.makedirs(save_folder) else: a=os.listdir(save_folder) for f in a: if not f.startswith("."): sub_path= os.path.join(save_folder,f) if os.path.isdir(sub_path): shutil.rmtree(sub_path) else: os.remove(sub_path) elif f==".git": has_repo=True info={} type_dist={ '792f2eb6-721e-4e64-ba20-bc98351056db':'pm', #property method '2db5746d-d284-4425-9f7f-2663a34b0ebc':'dut', #dut 'adb5cb65-8e1d-4a00-b70a-375ea27582f3':'lib', #lib manager 'f89f7675-27f1-46b3-8abb-b7da8e774ffd':'m', #method no ret '8ac092e5-3128-4e26-9e7e-11016c6684f2':'act', #action '6f9dac99-8de1-4efc-8465-68ac443b7d08':'pou', #pou '6654496c-404d-479a-aad2-8551054e5f1e':'itf', #interface '738bea1e-99bb-4f04-90bb-a7a567e74e3a':'', #folder 'ffbfa93a-b94d-45fc-a329-229860183b1d':'gvl', #global var '5a3b8626-d3e9-4f37-98b5-66420063d91e':'prop', #property '2bef0454-1bd3-412a-ac2c-af0f31dbc40f':'tl', #textlist '63784cbb-9ba0-45e6-9d69-babf3f040511':'gtl', #global textlist '225bfe47-7336-4dbc-9419-4105a7c831fa':'dev', #device 'ae1de277-a207-4a28-9efb-456c06bd52f3':'tc', #task configuration 'f8a58466-d7f6-439f-bbb8-d4600e41d099':'m', #method with ret '261bd6e6-249c-4232-bb6f-84c2fbeef430':'gvl', #gvl_Persistent '98a2708a-9b18-4f31-82ed-a1465b24fa2d':'task', #task '085afe48-c5d8-4ea5-ab0d-b35701fa6009':'progInfo'#project information }; def save(text,path,name,tp): if not tp: tp='' else: tp='.'+tp+'.txt' with open(os.path.join(path,name+tp),'w') as f: f.write(text.encode('utf-8')) def print_tree(treeobj, depth, path): global info #record current Path curpath=path isfolder=False t='' #text tp='' #type # get object name name = treeobj.get_name(False) id = treeobj.type.ToString() if id in type_dist: tp = type_dist[treeobj.type.ToString()] #Print all type of objects #print("--Name: ", tp) else: info[id]=name if treeobj.is_device: deviceid = treeobj.get_device_identification() t = 'type='+str(deviceid.type) +'\nid=' +str(deviceid.id) + '\nver='+ str(deviceid.version) if tp == "progInfo": print("-- There is prog info, ", tp) print("-- It has textual declaration: , ", treeobj.has_textual_declaration) print("-- It has textual implementation: , ", treeobj.has_textual_implementation) print("-- It is folder: , ", treeobj.is_folder) print("-- It is children: , ", treeobj.get_children(False)) print("-- It is children len: , ", len(treeobj.get_children(False))) print("-- It is progInfo type: , ", type(treeobj.ScriptProject)) #for child in treeobj.get_children(False): # print_tree(child, depth+1,curpath) try: if treeobj.is_folder : #system.ui.prompt('folder:'+u, PromptChoice.YesNo, PromptResult.Yes) isfolder=true pass except: pass if treeobj.has_textual_declaration : t=t+'(*#-#-#-#-#-#-#-#-#-#---Declaration---#-#-#-#-#-#-#-#-#-#-#-#-#*)\r\n' a=treeobj.textual_declaration t=t+a.text if treeobj.has_textual_implementation: t=t+'(*#-#-#-#-#-#-#-#-#-#---Implementation---#-#-#-#-#-#-#-#-#-#-#-#-#*)\r\n' a=treeobj.textual_implementation t=t+a.text if treeobj.has_textual_declaration and not treeobj.has_textual_implementation: t=t+'(*#-#-#-#-#-#-#-#-#-#---NOT Implementation visible---#-#-#-#-#-#-#-#-#-#-#-#-#*)\r\n' if treeobj.is_task : exports=[treeobj] projects.primary.export_native(exports,os.path.join(curpath,name+'.task')) if treeobj.is_libman: exports=[treeobj] projects.primary.export_native(exports,os.path.join(curpath,name+'.lib')) if treeobj.is_textlist: treeobj.export(os.path.join(curpath,name+'.tl')) children = treeobj.get_children(False) if children or isfolder: if tp: curpath=os.path.join(curpath,name+'.'+tp) else: curpath=os.path.join(curpath,name) if not os.path.exists(curpath): os.makedirs(curpath) if t: save(t,curpath,name,tp) for child in treeobj.get_children(False): print_tree(child, depth+1,curpath) for obj in projects.primary.get_children(): print_tree(obj,0,save_folder) with open(os.path.join(save_folder,'ExportInfo.txt'),'w') as f: now = datetime.now() infTimeExecution = now.strftime("%Y-%m-%d %H:%M:%S") f.write("Export date and time: "+infTimeExecution + "\r\n" + str(info)) print("--- Script finished. ---") #system.ui.info('save ok') projects.primary.close()
Last updated: 2024-04-30

Post by francesco86 on Script python for write in a file Project information CODESYS Forge talk (Post)
Dear all, My python script can read a Codesys project and save in file the different POU, but the problem is that I don't able to read the project info from the obj list. Following of this message there is my python script. Can you help my? Best regards Francesco # encoding:utf-8 # We enable the new python 3 print syntax from __future__ import print_function import os import shutil import time import sys from datetime import datetime print("--- Saving files in the project: ---") print("sys.argv: ", len(sys.argv), " elements:") for arg in sys.argv: print(" - ", arg) if (len(sys.argv)>1): folderExportName = sys.argv[1] print(" folderExportName: ", folderExportName) exportPath = sys.argv[2]+ sys.argv[3]+ "\\"+ sys.argv[1] print(" File path: ", exportPath) # git has_repo=False #save_folder=r'E:\Tmp\ControlPlugins\ControlPlugins\Export' save_folder = exportPath if not os.path.exists(save_folder): os.makedirs(save_folder) else: a=os.listdir(save_folder) for f in a: if not f.startswith("."): sub_path= os.path.join(save_folder,f) if os.path.isdir(sub_path): shutil.rmtree(sub_path) else: os.remove(sub_path) elif f==".git": has_repo=True info={} type_dist={ '792f2eb6-721e-4e64-ba20-bc98351056db':'pm', #property method '2db5746d-d284-4425-9f7f-2663a34b0ebc':'dut', #dut 'adb5cb65-8e1d-4a00-b70a-375ea27582f3':'lib', #lib manager 'f89f7675-27f1-46b3-8abb-b7da8e774ffd':'m', #method no ret '8ac092e5-3128-4e26-9e7e-11016c6684f2':'act', #action '6f9dac99-8de1-4efc-8465-68ac443b7d08':'pou', #pou '6654496c-404d-479a-aad2-8551054e5f1e':'itf', #interface '738bea1e-99bb-4f04-90bb-a7a567e74e3a':'', #folder 'ffbfa93a-b94d-45fc-a329-229860183b1d':'gvl', #global var '5a3b8626-d3e9-4f37-98b5-66420063d91e':'prop', #property '2bef0454-1bd3-412a-ac2c-af0f31dbc40f':'tl', #textlist '63784cbb-9ba0-45e6-9d69-babf3f040511':'gtl', #global textlist '225bfe47-7336-4dbc-9419-4105a7c831fa':'dev', #device 'ae1de277-a207-4a28-9efb-456c06bd52f3':'tc', #task configuration 'f8a58466-d7f6-439f-bbb8-d4600e41d099':'m', #method with ret '261bd6e6-249c-4232-bb6f-84c2fbeef430':'gvl', #gvl_Persistent '98a2708a-9b18-4f31-82ed-a1465b24fa2d':'task', #task '085afe48-c5d8-4ea5-ab0d-b35701fa6009':'progInfo'#project information }; def save(text,path,name,tp): if not tp: tp='' else: tp='.'+tp+'.txt' with open(os.path.join(path,name+tp),'w') as f: f.write(text.encode('utf-8')) def print_tree(treeobj, depth, path): global info #record current Path curpath=path isfolder=False t='' #text tp='' #type # get object name name = treeobj.get_name(False) id = treeobj.type.ToString() if id in type_dist: tp = type_dist[treeobj.type.ToString()] #Print all type of objects #print("--Name: ", tp) else: info[id]=name if treeobj.is_device: deviceid = treeobj.get_device_identification() t = 'type='+str(deviceid.type) +'\nid=' +str(deviceid.id) + '\nver='+ str(deviceid.version) if tp == "progInfo": print("-- There is prog info, ", tp) print("-- It has textual declaration: , ", treeobj.has_textual_declaration) print("-- It has textual implementation: , ", treeobj.has_textual_implementation) print("-- It is folder: , ", treeobj.is_folder) print("-- It is children: , ", treeobj.get_children(False)) print("-- It is children len: , ", len(treeobj.get_children(False))) print("-- It is progInfo type: , ", type(treeobj.ScriptProject)) #for child in treeobj.get_children(False): # print_tree(child, depth+1,curpath) try: if treeobj.is_folder : #system.ui.prompt('folder:'+u, PromptChoice.YesNo, PromptResult.Yes) isfolder=true pass except: pass if treeobj.has_textual_declaration : t=t+'(*#-#-#-#-#-#-#-#-#-#---Declaration---#-#-#-#-#-#-#-#-#-#-#-#-#*)\r\n' a=treeobj.textual_declaration t=t+a.text if treeobj.has_textual_implementation: t=t+'(*#-#-#-#-#-#-#-#-#-#---Implementation---#-#-#-#-#-#-#-#-#-#-#-#-#*)\r\n' a=treeobj.textual_implementation t=t+a.text if treeobj.has_textual_declaration and not treeobj.has_textual_implementation: t=t+'(*#-#-#-#-#-#-#-#-#-#---NOT Implementation visible---#-#-#-#-#-#-#-#-#-#-#-#-#*)\r\n' if treeobj.is_task : exports=[treeobj] projects.primary.export_native(exports,os.path.join(curpath,name+'.task')) if treeobj.is_libman: exports=[treeobj] projects.primary.export_native(exports,os.path.join(curpath,name+'.lib')) if treeobj.is_textlist: treeobj.export(os.path.join(curpath,name+'.tl')) children = treeobj.get_children(False) if children or isfolder: if tp: curpath=os.path.join(curpath,name+'.'+tp) else: curpath=os.path.join(curpath,name) if not os.path.exists(curpath): os.makedirs(curpath) if t: save(t,curpath,name,tp) for child in treeobj.get_children(False): print_tree(child, depth+1,curpath) for obj in projects.primary.get_children(): print_tree(obj,0,save_folder) with open(os.path.join(save_folder,'ExportInfo.txt'),'w') as f: now = datetime.now() infTimeExecution = now.strftime("%Y-%m-%d %H:%M:%S") f.write("Export date and time: "+infTimeExecution + "\r\n" + str(info)) print("--- Script finished. ---") #system.ui.info('save ok') projects.primary.close()
Last updated: 2024-04-30

Post by dkugler on Webvisu client connection monitoring CODESYS Forge talk (Post)
you can give this code snippet a try. It's extracted and simplyfied from my code: Install VisuElemBase lib if not installed yet. Execute in visu task: VAR pClientData : ARRAY [-1..100] OF POINTER TO VisuElemBase.VisuStructClientData; END_VAR VisuElemBase.g_ClientManager.BeginIteration(); pClientData := VisuElemBase.g_ClientManager.GetNextClient(); WHILE pClientData <> 0 DO pClientData[pClientData^.GlobalData.GlobalClientID] := pClientData; END_WHILE You have to make shure every no longer updated pointers in the array have to be deleted and no longer used by your code! Usage of this pointer access at your own risk :-) Works with SP16. From SP17 and newer there will be warnigs etc. using this solution as I remember. It will be great, if Codesys publishes a example or give a hint how to accesse this client values with the VisuUtil lib or other future-proof way!
Last updated: 2024-09-09

Post by opineiro on Stack overflow with really simple function CODESYS Forge talk (Post)
Hi, I have an issue with a function which sends a message through API Rest. I'm using a function from httpCLient library. I have tested this function inside a program and it works fine. But when I want to use it inside a function (so I can call it simultaneously from 2 different points on the main program) it gives a stack overflow error. In detail it says: "C0297 Stack Overflow on Main Task. Stack sizes... Call hierarchy:" I have simplified as much as I can the function, but I'm hitting a wall with this. Anybody has an idea of what's wrong? Thanks!
Last updated: 2024-09-16

Post by ofey on Modbus TCP communication CODESYS Forge talk (Post)
Hi! I tried setting up the PLC I'm working with (Beijer GN-9373) to connect to a modbus master running on a laptop. I have an ethernet connection (via USB-C to ethernet) between the laptop and the controller. I have tried following tutorial on how to set this up. I have added an ethernet device with the IP-address of the PLC. Further I added a ModbusTCP_Slave_Device with default settings. I get the error "Failed to open TCP Port: 1" when I try to go online with the PLC. Earlier I tested the exact same set up with the soft PLC from codesys. I can then read/write values correctly with the Modbus master i have running on the laptop. Hope anybody can help me with this, thanks in advance!
Last updated: 2023-10-06

Post by sumit on Remote Ethernet/ip Adapter communication with scanner running on codesys CODESYS Forge talk (Post)
Hello there, I have my ethernet/ip adapter (from Texas Instrument) running on Texas Instrument Board and I have configured the scanner on codesys. I have mapped the I/Os and I can see (on wireshark) the frames coming from adapter but I don't see my input variables in scanner get updated, they just stay at 0. I wanted to see the real data that has been sent from adapter to scanner on codesys. I am not sure if the problem is in I/O mapping or there is a step/s that I have missed. I have attached the screenshot of my project for your ref. Thank you, Sumit
Last updated: 2023-12-15

Post by sumit on Remote Ethernet/ip Adapter communication with scanner running on codesys CODESYS Forge talk (Post)
Hello there, I have my ethernet/ip adapter (from Texas Instrument) running on Texas Instrument Board and I have configured the scanner on codesys. I have mapped the I/Os and I can see (on wireshark) the frames coming from adapter but I don't see my input variables in scanner get updated, they just stay at 0. I wanted to see the real data that has been sent from adapter to scanner on codesys. I am not sure if the problem is in I/O mapping or there is a step/s that I have missed. I have attached the screenshot of my project for your ref. Thank you, Sumit
Last updated: 2023-12-15

Post by yang123 on EtherCAT Can't reconnect to servo drive CODESYS Forge talk (Post)
I am using Ethercat Master 4.6.0.0 and have use the automatic restart slaves feature. But we found of after the Ethercat communication normal and slave drive power-off and power-on the slave can't reconnect sucess. The PLC Log show the drive was al status "6#34 : Invalid DC Timeout Error" and its was reconnection sucess first but seconced later the drive will show the "16#2C : Fatal Sync error" and then drive will can't reconnection. Other slave are reconnect sucess which was link after the can't reconnect's drive the drive was OMRON R88D-1SN
Last updated: 2024-01-23

Post by dhumphries on No source code available CODESYS Forge talk (Post)
Try using an Ethernet/IP scanner instead of an adapter, I'm guessing the 2 devices you're trying to communicate with are adapters, you have to have a scanner somewhere and Codesys should be a scanner. I don't know why you're getting the error, you should be able to use your Ethernet port as an EthernetIP adapter (although I've never had a reason to try,) but it's probably not what you wanted to do, unless you're connecting to another PLC that is a scanner. Good luck configuring the devices you're trying to connect to, it will be a lot easier if you have an .EDS file instead of starting with a generic module, even with an .EDS it can be tricky getting the communication working.
Last updated: 2024-02-03

Post by alexgooi on Codesys licensing explanation CODESYS Forge talk (Post)
Dear Forum, We are currently switching to a native Codesys controller, and I'm currently trying to determine the correct license. I have a question regarding the Modbus instances. With the Standard S license this is set to 4 (See picture). In our projects we are using a lot of communications to Modbus servers using a Codesys Controller, for this communication I'm using the ModbusFB library (supplied by 3S) (see picture). In my project I would like to use more than 4 instances of the ClientTCP FB. My question is, is this now capped at 4 possible connections with the standard S license. Or do these function blocks have a different relation with the license? Some clarity on this topic would be very welcome. Thank you in advance
Last updated: 2024-02-15

<< < 1 .. 19 20 21 22 23 24 > >> (Page 21 of 24)

Showing results of 582

Sort by relevance or date