songyanghua
Hello, when I referenced the official document ADDING NEW BLOCKS TO OPENPLC EDITOR'S LIBRARY to create a custom block, I found an error during compilation and found that TEST was not found. After checking, I followed the requirements of each step to set it. On the Win11 system, I hope you can help me. I haven't found the reason for several days!
0e3299f2fb9758a349c83a334cb4c0dd.png17c9f4a5a9e78bda26026cd8e97fa14d.png49e31f5864b567d4db9f47ca35ae5488.png

Delete that module to pass

Reply 0 0
songyanghua
这样的事情是不存在的。您必须在编辑器上重构并添加大量代码。
 
松阳华 wrote:
有没有简单的方法,比如拖放带有注释框的控件,告诉用户我需要输入0-300000毫秒的范围
I only fall back to the 0-300000 millisecond range if the user makes an error, and I don't prompt the user for an error
Reply 0 0
songyanghua
松阳华 wrote:
我只在用户输入错误时返回到 0-300000 毫秒的范围,并且我没有提示用户输入错误
Any tips for an easy way?
Reply 0 0
thiagoralves
This is quite unusual for a PLC programming language, especially because the language allows the user to plug a variable at the block input. A variable can assume any value during runtime. The easy way is to write on the block documentation that the input must be in the 0-300000 ms range, and that any value outside that range would have unexpected results. You can also safeguard the input value defining that anything less than 0 will become 0 and anything greater than 300000 will be capped at 300000.
Reply 0 0
songyanghua
这对于PLC编程语言来说是非常不寻常的,特别是因为该语言允许用户在块输入处插入变量。变量可以在运行时采用任何值。简单的方法是在块文档中写下输入必须在 0-300000 ms 范围内,并且超出该范围的任何值都会产生意外结果。您还可以保护输入值,定义小于 0 的任何值将变为 0,大于 300000 的任何值将上限为 300000。
43.png

I understand what you mean, but how can I automatically populate the document edit block with the comments I want the user to see when I drag out the document? When I pulled a new TP block, the prompt words I wanted were not saved in the document. Thank you very much for your answer!
Reply 0 0
songyanghua
Is there any good way to package your OPENPLC project file into an EXE and run it?
Reply 0 0
thiagoralves
songyanghua wrote:
43.png

I understand what you mean, but how can I automatically populate the document edit block with the comments I want the user to see when I drag out the document? When I pulled a new TP block, the prompt words I wanted were not saved in the document. Thank you very much for your answer!
You will have to edit the XML file for the block
Reply 0 0
thiagoralves
songyanghua wrote:
Is there any good way to package your OPENPLC project file into an EXE and run it?
No
Reply 0 0
songyanghua
您必须编辑块的 XML 文件
Where is the XML added? Can you demonstrate it?
Reply 0 0
thiagoralves
Reply 0 0
songyanghua
微信截图_20231026225803.png
 
Add a comment here?
Reply 0 0
thiagoralves
Yes, but obviously on the XML file of your own block, not this one.
Reply 0 0
songyanghua
Yes, but obviously on the XML file of your own block, not this one.
Okay, I will try to make changes
Reply 0 0
songyanghua
No
Can I package this OpenPLC project as exe instead of running it with. bat? When I try to package exe, the Path module doesn't exist, but why could I have run it? Error reported when packaging exe
Reply 0 0
songyanghua
Why can't I package the Python 2.7 version when using the Python tool? The exe error displays No module named past.builtins No module named wx?
Reply 0 0
Reply