vlf2444
[203128%2F9202797%2Fmceclip0]
 
Why do I get that error when I use the library and run it again?
I'll wait for your reply, thank you.
vlf2444
app-title:
beremiz
app-version:
3.0
Release: 2024-10-16
cwd:
C:\Users\User\OpenPLC_Editor
date:
Tue Feb 18 16:12:06 2025
e-type:
<class 'KeyError'>
e-value:
''
locals:
self: <BeremizIDE.Beremiz object at 0x000001A5216B0820>
var_class: ''
platform:
Windows-10-10.0.26100-SP0
python-version:
3.9.10
self:
icon: <wx._core.Icon object at 0x000001A5216B08B0>
UNEDITABLE_NAMES_DICT: {'์‚ฌ์šฉ์ž ์ •์˜ POU': 'User-defined POUs', 'ํ•จ์ˆ˜ (Functions)': 'Functions', 'ํ•จ์ˆ˜ ๋ธ”๋Ÿญ(Function Blocks)': 'Function Blocks', 'ํ”„๋กœ๊ทธ๋žจ(Programs)': 'Programs', '๋ฐ์ดํ„ฐ ํƒ€์ž…(Data Types)': 'Data Types', 'ํŠธ๋žœ์ง€์…˜': 'Transitions', '์•ก์…˜(Actions)': 'Actions', '๊ตฌ์„ฑ(Configurations)': 'Configurations', '๋ฆฌ์†Œ์Šค': 'Resources', '์†์„ฑ': 'Properties'}
Controler: <ProjectController.ProjectController object at 0x000001A554120A30>
Config: <wx._core.ConfigBase object at 0x000001A54F7F2550>
EnableDebug: True
EditorToolBarItems: {'FBD': [(True, 3, WindowIDRef: -31946, 'OnMotionTool', 'move', 'ํ™”๋ฉด์„ ๋“œ๋ž˜๊ทธํ•˜์—ฌ ์ด๋™'), (True, 3, WindowIDRef: -31962, 'OnCommentTool', 'add_comment', '์ƒˆ๋กœ์šด ์ฝ”๋ฉ˜ํŠธ ์ƒ์„ฑ'), (True, 3, WindowIDRef: -31961, 'OnVariableTool', 'add_variable', '์ƒˆ๋กœ์šด ๋ณ€์ˆ˜ ์ƒ์„ฑ'), (True, 3, WindowIDRef: -31960, 'OnBlockTool', 'add_block', '์ƒˆ๋กœ์šด ๋ธ”๋Ÿญ ์ƒ์„ฑ'), (True, 3, WindowIDRef: -31959, 'OnConnectionTool', 'add_connection', '์ƒˆ๋กœ์šด ์—ฐ๊ฒฐ ์ƒ์„ฑ')], 'LD': [(True, 3, WindowIDRef: -31946, 'OnMotionTool', 'move', 'ํ™”๋ฉด์„ ๋“œ๋ž˜๊ทธํ•˜์—ฌ ์ด๋™'), (True, 1, WindowIDRef: -31962, 'OnCommentTool', 'add_comment', '์ƒˆ๋กœ์šด ์ฝ”๋ฉ˜ํŠธ ์ƒ์„ฑ'), (True, 1, WindowIDRef: -31957, 'OnPowerRailTool', 'add_powerrail', '์ƒˆ๋กœ์šด ์ „์› ๋ ˆ์ผ ์ƒ์„ฑ'), (False, 2, WindowIDRef: -31956, 'OnRungTool', 'add_rung', '์ƒˆ๋กœ์šด Rung ์ƒ์„ฑ'), (True, 1, WindowIDRef: -31955, 'OnCoilTool', 'add_coil', '์ƒˆ๋กœ์šด ์ฝ”์ผ ์ƒ์„ฑ'), (False, 3, WindowIDRef: -31954, 'OnContactTool', 'add_contact', '์ƒˆ๋กœ์šด ์ ‘์  ์ƒ์„ฑ'), (False, 2, WindowIDRef: -31953, 'OnBranchTool', 'add_branch', '์ƒˆ๋กœ์šด ๋ถ„๊ธฐ(Branch) ์ƒ์„ฑ'), (True, 1, WindowIDRef: -31961, 'OnVariableTool', 'add_variable', '์ƒˆ๋กœ์šด ๋ณ€์ˆ˜ ์ƒ์„ฑ'), (False, 3, WindowIDRef: -31960, 'OnBlockTool', 'add_block', '์ƒˆ๋กœ์šด ๋ธ”๋Ÿญ ์ƒ์„ฑ'), (True, 1, WindowIDRef: -31959, 'OnConnectionTool', 'add_connection', '์ƒˆ๋กœ์šด ์—ฐ๊ฒฐ ์ƒ์„ฑ')], 'SFC': [(True, 3, WindowIDRef: -31946, 'OnMotionTool', 'move', 'ํ™”๋ฉด์„ ๋“œ๋ž˜๊ทธํ•˜์—ฌ ์ด๋™'), (True, 3, WindowIDRef: -31962, 'OnCommentTool', 'add_comment', '์ƒˆ๋กœ์šด ์ฝ”๋ฉ˜ํŠธ ์ƒ์„ฑ'), (True, 3, WindowIDRef: -31952, 'OnInitialStepTool', 'add_initial_step', '์ƒˆ๋กœ์šด ์ด๋‹ˆ์…œ ์Šคํ… ์ƒ์„ฑ'), (False, 3, WindowIDRef: -31951, 'OnStepTool', 'add_step', '์ƒˆ๋กœ์šด ์Šคํ… ์ƒ์„ฑ'), (True, 1, WindowIDRef: -31950, 'OnTransitionTool', 'add_transition', '์ƒˆ๋กœ์šด ํŠธ๋žœ์ง€์…˜ ์ƒ์„ฑ'), (False, 3, WindowIDRef: -31949, 'OnActionBlockTool', 'add_action', '์ƒˆ๋กœ์šด ์•ก์…˜ ๋ธ”๋Ÿญ ์ƒ์„ฑ'), (False, 3, WindowIDRef: -31948, 'OnDivergenceTool', 'add_divergence', '์ƒˆ๋กœ์šด ๋ถ„๊ธฐ(divergence) ์ƒ์„ฑ'), (False, 3, WindowIDRef: -31947, 'OnJumpTool', 'add_jump', '์ƒˆ๋กœ์šด ์ ํ”„ ์ƒ์„ฑ'), (True, 1, WindowIDRef: -31961, 'OnVariableTool', 'add_variable', '์ƒˆ๋กœ์šด ๋ณ€์ˆ˜ ์ƒ์„ฑ'), (True, 1, WindowIDRef: -31960, 'OnBlockTool', 'add_block', '์ƒˆ๋กœ์šด ๋ธ”๋Ÿญ ์ƒ์„ฑ'), (True, 1, WindowIDRef: -31959, 'OnConnectionTool', 'add_connection', '์ƒˆ๋กœ์šด ์—ฐ๊ฒฐ ์ƒ์„ฑ'), (True, 1, WindowIDRef: -31957, 'OnPowerRailTool', 'add_powerrail', '์ƒˆ๋กœ์šด ์ „์› ๋ ˆ์ผ ์ƒ์„ฑ'), (True, 1, WindowIDRef: -31954, 'OnContactTool', 'add_contact', '์ƒˆ๋กœ์šด ์ ‘์  ์ƒ์„ฑ')], 'ST': [], 'IL': [], 'debug': [(True, 3, WindowIDRef: -31946, 'OnMotionTool', 'move', 'ํ™”๋ฉด์„ ๋“œ๋ž˜๊ทธํ•˜์—ฌ ์ด๋™')]}
TabsImageList: <wx._core.ImageList object at 0x000001A54F7F4700>
TabsImageListIndexes: {}
AUIManager: <wx._aui.AuiManager object at 0x000001A54F7F48B0>
Panes: {'MenuToolBar': <wx._core.ToolBar object at 0x000001A54FC2BC10>, 'EditorToolBar': <wx._core.ToolBar object at 0x000001A54FC2BCA0>, 'StatusToolBar': <wx._core.ToolBar object at 0x000001A5540FDB80>}
LeftNoteBook: <wx._aui.AuiNotebook object at 0x000001A54F7F4940>
BottomNoteBook: <wx._aui.AuiNotebook object at 0x000001A54F7F49D0>
RightNoteBook: <wx._aui.AuiNotebook object at 0x000001A54F7F4A60>
TabsOpened: <wx._aui.AuiNotebook object at 0x000001A54F7F4AF0>
MainTabs: {'ProjectPanel': (<wx._core.SplitterWindow object at 0x000001A54F7F4D30>, 'ํ”„๋กœ์ ํŠธ'), 'SearchResultPanel': (<controls.SearchResultPanel.SearchResultPanel object at 0x000001A54FC2BEE0>, '๊ฒ€์ƒ‰'), 'LibraryPanel': (<controls.LibraryPanel.LibraryPanel object at 0x000001A54FC35E50>, '๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ'), 'DebugVariablePanel': (<controls.DebugVariablePanel.DebugVariablePanel.DebugVariablePanel object at 0x000001A54FC40820>, '๋””๋ฒ„๊ฑฐ'), 'LogConsole': (<controls.CustomStyledTextCtrl.CustomStyledTextCtrl object at 0x000001A5540F5670>, '์ฝ˜์†”'), 'LogViewer': (<controls.LogViewer.LogViewer object at 0x000001A54FC463A0>, 'PLC ๋กœ๊ทธ')}
ProjectPanel: <wx._core.SplitterWindow object at 0x000001A54F7F4D30>
ProjectTree: <controls.CustomTree.CustomTree object at 0x000001A54F7F4E50>
PouInstanceVariablesPanel: <controls.PouInstanceVariablesPanel.PouInstanceVariablesPanel object at 0x000001A54FC280D0>
SearchResultPanel: <controls.SearchResultPanel.SearchResultPanel object at 0x000001A54FC2BEE0>
LibraryPanel: <controls.LibraryPanel.LibraryPanel object at 0x000001A54FC35E50>
ConfNodeMenu: < wx._core.Menu object at 0x000001A54FC3B040>
RecentProjectsMenu: < wx._core.Menu object at 0x000001A54FC3B0D0>
TutorialsProjectsMenu: < wx._core.Menu object at 0x000001A54FC3B280>
FileMenu: < wx._core.Menu object at 0x000001A54FC3B3A0>
EditMenu: < wx._core.Menu object at 0x000001A54FC3B430>
DisplayMenu: < wx._core.Menu object at 0x000001A54FC3B4C0>
HelpMenu: < wx._core.Menu object at 0x000001A54FC3B550>
RecentProjectsMenuItem: <wx._core.MenuItem object at 0x000001A54FC3B700>
AddMenuItem: <wx._core.MenuItem object at 0x000001A54FC3C0D0>
ZoomMenuItem: <wx._core.MenuItem object at 0x000001A54FC3C9D0>
DebugVariablePanel: <controls.DebugVariablePanel.DebugVariablePanel.DebugVariablePanel object at 0x000001A54FC40820>
EditMenuSize: 16
methodLock: <unlocked _thread.lock object at 0x000001A54FC44510>
LogConsole: <controls.CustomStyledTextCtrl.CustomStyledTextCtrl object at 0x000001A5540F5670>
LogViewer: <controls.LogViewer.LogViewer object at 0x000001A54FC463A0>
ConnectionStatusBar: <controls.EnhancedStatusBar.EnhancedStatusBar object at 0x000001A5541001F0>
ProgressStatusBar: <wx._core.Gauge object at 0x000001A554100280>
TreeImageList: <wx._core.ImageList object at 0x000001A54FC46160>
TreeImageDict: {'IL': 0, 'ST': 1, 'FBD': 2, 'LD': 3, 'SFC': 4, 0: 5, 3: 6, 4: 7, 5: 8, 6: 9, 7: 10, 8: 11, 9: 12, 10: 13, 11: 14, 17: 15, 18: 16, 19: 17, 20: 18, 21: 19, 22: 20, 23: 21, 12: 22, 13: 23, 14: 24, 15: 25, 16: 26, 25: 27}
CurrentEditorToolBar: []
CurrentMenu: None
SelectedItem: <wx.lib.agw.customtreectrl.GenericTreeItem object at 0x000001A5502CAFD0>
LastToolTipItem: <wx.lib.agw.customtreectrl.GenericTreeItem object at 0x000001A5502CAFD0>
SearchParams: None
Highlights: {}
DrawingMode: 1
AuiTabCtrl: []
DefaultPerspective: {'perspective': 'layout2|name=ProjectPane;caption=;state=2044;dir=4;layer=1;row=0;pos=0;prop=100000;bestw=300;besth=500;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=ResultPane;caption=;state=2044;dir=3;layer=0;row=0;pos=0;prop=100000;bestw=800;besth=300;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=LibraryPane;caption=;state=2044;dir=2;layer=0;row=0;pos=0;prop=100000;bestw=250;besth=400;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=TabsPane;caption=;state=768;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=20;besth=20;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=MenuToolBar;caption=ํˆด๋ฐ”;state=2108144;dir=1;layer=10;row=0;pos=0;prop=100000;bestw=408;besth=35;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=EditorToolBar;caption=ํˆด๋ฐ” ์—๋””ํ„ฐ;state=2108144;dir=1;layer=10;row=0;pos=430;prop=100000;bestw=32;besth=35;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=StatusToolBar;caption=ํˆด๋ฐ”;state=2108144;dir=1;layer=10;row=0;pos=419;prop=100000;bestw=0;besth=26;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|dock_size(4,1,0)=302|dock_size(3,0,0)=290|dock_size(2,0,0)=252|dock_size(5,0,0)=22|dock_size(1,10,0)=37|', 'notebooks': {'leftnotebook': {'pos': (1, 1), 'pages': [(('main', 'ProjectPanel'), True)], 'size': (298, 495)}, 'bottomnotebook': {'pos': (1, 1), 'pages': [(('main', 'SearchResultPanel'), True), (('main', 'LogConsole'), False), (('main', 'LogViewer'), False)], 'size': (690, 265)}, 'rightnotebook': {'pos': (1, 1), 'pages': [(('main', 'LibraryPanel'), True), (('main', 'DebugVariablePanel'), False)], 'size': (248, 201)}}}
PrintData: <wx._core.PrintData object at 0x000001A554100550>
PageSetupData: <wx._core.PageSetupDialogData object at 0x000001A554100820>
RefreshFunctions: {0: <bound method Beremiz.RefreshTitle of <BeremizIDE.Beremiz object at 0x000001A5216B0820>>, 1: <bound method Beremiz.RefreshEditorToolBar of <BeremizIDE.Beremiz object at 0x000001A5216B0820>>, 2: <bound method Beremiz.RefreshFileMenu of <BeremizIDE.Beremiz object at 0x000001A5216B0820>>, 3: <bound method Beremiz.RefreshEditMenu of <BeremizIDE.Beremiz object at 0x000001A5216B0820>>, 4: <bound method IDEFrame.RefreshDisplayMenu of <BeremizIDE.Beremiz object at 0x000001A5216B0820>>, 5: <bound method IDEFrame.RefreshProjectTree of <BeremizIDE.Beremiz object at 0x000001A5216B0820>>, 6: <bound method IDEFrame.RefreshPouInstanceVariablesPanel of <BeremizIDE.Beremiz object at 0x000001A5216B0820>>, 7: <bound method IDEFrame.RefreshLibraryPanel of <BeremizIDE.Beremiz object at 0x000001A5216B0820>>, 8: <bound method IDEFrame.RefreshScaling of <BeremizIDE.Beremiz object at 0x000001A5216B0820>>, 9: <bound method IDEFrame.RefreshPageTitles of <BeremizIDE.Beremiz object at 0x000001A5216B0820>>}
DeleteFunctions: {7: <function GetDeleteElementFunction.<locals>.DeleteElementFunction at 0x000001A5541008B0>, 1: <function GetDeleteElementFunction.<locals>.DeleteElementFunction at 0x000001A554100940>, 3: <function GetDeleteElementFunction.<locals>.DeleteElementFunction at 0x000001A5541009D0>, 4: <function GetDeleteElementFunction.<locals>.DeleteElementFunction at 0x000001A554100A60>, 5: <function GetDeleteElementFunction.<locals>.DeleteElementFunction at 0x000001A554100AF0>, 6: <function GetDeleteElementFunction.<locals>.DeleteElementFunction at 0x000001A554100B80>}
Log: <BeremizIDE.LogPseudoFile object at 0x000001A554108940>
local_runtime_log: <BeremizIDE.LogPseudoFile object at 0x000001A554108940>
local_runtime: None
runtime_port: None
local_runtime_tmpdir: None
use_gui: True
LastPanelSelected: None
LocationImageList: <wx._core.ImageList object at 0x000001A554100C10>
LocationImageDict: {0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5}
CTR: <ProjectController.ProjectController object at 0x000001A554120A30>
FindDialog: <dialogs.FindInPouDialog.FindInPouDialog object at 0x000001A54FC22D30>
traceback:
File "C:\Users\User\OpenPLC_Editor\.\editor\IDEFrame.py", line 1790, in OnProjectTreeLeftUp
self.ProjectTreeItemSelect(self.SelectedItem)
File "C:\Users\User\OpenPLC_Editor\.\editor\BeremizIDE.py", line 1064, in ProjectTreeItemSelect
IDEFrame.ProjectTreeItemSelect(self, select_item)
File "C:\Users\User\OpenPLC_Editor\.\editor\IDEFrame.py", line 1785, in ProjectTreeItemSelect
self.PouInstanceVariablesPanel.SetPouType(item_infos["tagname"])
File "C:\Users\User\OpenPLC_Editor\.\editor\controls\PouInstanceVariablesPanel.py", line 239, in SetPouType
self.RefreshView()
File "C:\Users\User\OpenPLC_Editor\.\editor\controls\PouInstanceVariablesPanel.py", line 308, in RefreshView
self.VariablesList.SetItemImage(item, self.ParentWindow.GetTreeImage(var_infos.var_class))
File "C:\Users\User\OpenPLC_Editor\.\editor\IDEFrame.py", line 2028, in GetTreeImage
return self.TreeImageDict[var_class]
<class 'KeyError'>: ''
wx-platform:
__WXMSW__
wx-version:
4.2.0


add bug report
Reply 0 0
fg71
For any developer to be able to reproduce the same error he/she need to know exactly what the user (you) did to make the error.
This is important because a error in Windows platform doesn't mean its a error in other platform.
And a maintainer do tests on all platforms when a change are made.
 
By sending a error log itself without a description to produce it, isn't useful in that regard.
 
  1. So what did you do to make the error ?
  2. What version of OpenPLC did you use ?
Reply 0 0
vlf2444
I wrote it too roughly, sorry. We implemented simple logic in ST (Structured Text) in OpenPLC Editor and verified through simulation that there were no problems.
 
After that, in order to use the OpenPLC importer, I clicked the down arrow next to the simulation to download the ST code, converted it to XML, and ran it again, and that error came up.
 
OpenPLC Editor version is 3.0(release 2024-10-16)

Thank you!
Reply 0 0
fg71
Update to the latest version and try again to reproduce your error.
 
You couldn't import a Python library in OpenPLC, that is a Beremiz feature that @thiagoralves have removed. What he have added instead is Arduino extension
that is similar to c extension you find in Beremiz. I'm not sure what you mean by convert it to XML. When you save a project the format is XML.
Reply 0 0
thiagoralves
Maybe the XML that the importer generated was wrong. If you can share your original Function Block project here, I might be able to take a look and check what went wrong.
Reply 0 0
Reply