Post by k2saki on Open dialog from ST previous to version 3.5.6
CODESYS Forge
talk
(Post)
Thanks, that helps me a lot, but I have a question about this. https://forge.codesys.com/forge/talk/Engineering/thread/d8839077a0/
Last updated: 2024-06-05
Post by pmolke on Einheiten umrechnen, Numpad und Eingabegrenzen
CODESYS Forge
talk
(Post)
Ich habe das für die Visu anders gelöst. Ich nehme ein Dialog welches Stunden, Minuten und Sekunden einzeln hoch/herunter wählen lässt. Das Ergebnis wird nachdem bestätigen automatisch übergeben. Ich hab mir es aus dem Wagomacros abgeschaut.
Last updated: 2024-06-21
Post by sturmghost on Codesys Visu Update Frame Parameters No Dialog Appears to update
CODESYS Forge
talk
(Post)
This is still a huge problem. Does someone know how to update the frame references (not manually for every frame-element...)?
Last updated: 2024-08-12
Post by malie on Visuutils FbOpenDialog(Extended) not open Dialog from POUs
CODESYS Forge
talk
(Post)
Hello, thanks for the answer, that helped a little. How to achieve this behavior automatically when importing from a library, there can be a lot of dialogs from different librarys?
Last updated: 2024-10-08
Post by davidf on Error trying to activate the demo Git licence
CODESYS Forge
talk
(Post)
Just comes up with the attached error dialog. The Git menu in the codesys UI is visible but greyed out.
Last updated: 2024-10-11
Post by dekr on Visu User Management Dialog - Add user does not work
CODESYS Forge
talk
(Post)
After the user data has been entered, the page symbol at the top left must be pressed before OK is pressed.
Last updated: 2024-10-18
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 eguerra on Error in ScriptingEngine Docs - create_pou()
CODESYS Forge
talk
(Post)
In the ScriptingEngine documentation there seems to be an error (or missing information) in the ScriptIecLanguageObjectContainer part ( https://content.helpme-codesys.com/en/ScriptingEngine/ScriptIecLanguageObjectContainer.html#ScriptIecLanguageObjectContainer.ScriptIecLanguageObjectContainer ). The description of the function create_pou() doesn't specify the correct arguments requested, it only says create_pou(type: SpecialPouType) and a script using the documentation definition of the function will raise an error. I tried passing the function arguments similar to the ones specified for the create_dut() function and it seems to work fine: create_pou(name, PouType) , name : str UPDATE: The offline help has the correct definition IExtendedObject<IScriptObject> create_pou( string name, PouType type = PouType.FunctionBlock, Nullable<Guid> language = null, string return_type = null, string base_type = null, string interfaces = null )
Last updated: 2024-08-05
Post by manuknecht on Detect "Cancel" Press in FileOpenSave Dialog
CODESYS Forge
talk
(Post)
Thanks for your response! It seems like the VisuElems library has updated functions to the ones you used but apparently these older ones still work, even if I couldn't find them in the library documentation and they are also not suggested automatically by Codesys (when using Ctrl + Space). However, its precisely what I was looking for and it works. Thanks!
Last updated: 2023-09-20
Post by chiali on Recipe issue.
CODESYS Forge
talk
(Post)
Hi Everyone, I'm trying to make a simple Recipe project using 'Save Recipe In File' and 'Load and Write Recipe' Execute Command buttons in Visualization but No dialog box 'Save As' appears when I click on buttons (Nothing happens). What is wrong. Please see the attached files. Best Regards, Chiali.
Last updated: 2023-10-23
Post by liepgp on Script for batch printing
CODESYS Forge
talk
(Post)
I'm searching a way to print several projects to PDF, in order to correct student exercises. I'm able to open the printing dialog box using system.commands["print", "print"].execute(). But I can't find the prompt names in order to complete the printing with the dialogs Do you have any way to do that?
Last updated: 2024-02-13
Post by liepgp on Batch printing
CODESYS Forge
talk
(Post)
I'm searching a way to print several projects to PDF, in order to correct student exercises. I'm able to open the printing dialog box using system.commands["print", "print"].execute(). But I can't find the prompt names in order to complete the printing with the dialogs Do you have any way to do that?
Last updated: 2024-02-13
Post by paho on Linux runtime mit init-functions
CODESYS Forge
talk
(Post)
Hallo, ich habe eine Frage zu den init-functions: kann man irgendwie verhindern, dass bei einer Installation der Runtime (normal Update per CODESYS Linux Dialog) die init-functions unter /opt/codesys/scripts/init-functions immer überschrieben werden? Dort habe ich einige CPU/IRQ Anweisungen die ausgeführt werden müssen, aber nach jedem Runtime Update ist die Datei wieder auf Werkseinstellung. Danke!
Last updated: 2024-04-30
Post by phoward131 on Numpad decimal value requires leading zero
CODESYS Forge
talk
(Post)
I have noticed on the standard numpad dialog, if a user enters a purely decimal number (ie '.6'), the numpad will not accept the value but gives no indication. One must type a leading zero (ie '0.6') in order for it to work. Is there a way to correct this so that a user can just type the decimal value?
Last updated: 2024-04-30
Post by timvh on Change the Opening Position of the Dialog using VU.FbOpenDialog
CODESYS Forge
talk
(Post)
Probably best to call the FB continuously. So something like this could solve it: IF xOpenLatchSettingDialog THEN xOpenLatchSettingDialog := FALSE; fbOpenLatchSettingsDialog.xExecute := TRUE; END_IF IF fbOpenLatchSettingsDialog.xDone OR fbOpenLatchSettingsDialog.xError THEN fbOpenLatchSettingsDialog.xExecute := FALSE; END_IF TopLeftDialog.iX := 100; TopLeftDialog.iY := 23; fbOpenLatchSettingsDialog( itfClientFilter:= VU.Globals.OnlyTargetVisu, sDialogName:= 'visu_AlarmLatchSettings', xModal:= TRUE, pTopLeftPosition:= ADR(TopLeftDialog) );
Last updated: 2024-05-09
Post by vstrom on Recipe definition, how to have the Name string in current language?
CODESYS Forge
talk
(Post)
I'd like to know if it is possible to have the "Name" field, in the recipe definition, language dependent. Something like to have the possibility to put there a string ID that will be add to the GlobalTextList. In this way it can be translated and when showed in a Visualization screen its value depend on the current language. Thanks.
Last updated: 2024-10-04
Post by reinier-geers on Ping By Name
CODESYS Forge
talk
(Post)
To bad. Controller uses Version 9.2 But i dont see a lower version of net bas Service. Maybe i can try a linux command.
Last updated: 2023-08-29
Post by transmin01 on Correct CAN Driver for EL6751
CODESYS Forge
talk
(Post)
Hi, does anyone know what is the correct driver name that needs to go into the CodesysControl.cfg file for a Beckhoff EL6751? TIA Trevor.
Last updated: 2023-09-19
Post by gerdkoch on Version 3.5.19.40 probleme bei FUN mit _to_ im Name
CODESYS Forge
talk
(Post)
hi, den einen workaround kennst du ja. Ein anderer wäre es ST zu nutzen. Ich glaube der Fehler ist bereits bei CODESYS adressiert.
Last updated: 2023-11-11
Post by andrax on Version 3.5.19.40 probleme bei FUN mit _to_ im Name
CODESYS Forge
talk
(Post)
Ein workaround wäre, auf eine ältere Version zurück zu gehen Und auf den fix warten. Die oscat Funktionen umbenennen, halte ich nicht für die Lösung
Last updated: 2024-01-02
Post by andrax on Version 3.5.19.40 probleme bei FUN mit _to_ im Name
CODESYS Forge
talk
(Post)
Ein workaround wäre, auf eine ältere Version zurück zu gehen Und auf den fix warten. Die oscat Funktionen umbenennen, halte ich nicht für die Lösung
Last updated: 2024-01-02
Post by giackanto on Eoe issues with Windows and Linux
CODESYS Forge
talk
(Post)
I tried to change the name of the tap device to 'tap0,' but nothing changed. I don't think this is the problem.
Last updated: 2024-01-10
Post by pavel-doreng on GetCurrentUser
CODESYS Forge
talk
(Post)
Hi im only have 3 groups \ users - the deafault ones admin \ servie \ operator i JUST NEED TO KNOW WHO IS CURRENTLY LOGGED IN TO Display the user name , thats all this code above do not work for me please help im sure its very simple
Last updated: 2024-01-23
Post by fless on See only variable
CODESYS Forge
talk
(Post)
either you have "Insert with namespace" enabled in the SmartCoding options or your GVL_GLOBAL starts with {attribute 'qualified_only'} btw it's considered good practice to put the namespace in front of the variable. you could have variable with the same name in your PRG or FB.
Last updated: 2024-03-14
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
.