Host Engineering Forum
General Category => Do-more CPUs and Do-more Designer Software => Topic started by: Kristjan on May 27, 2022, 05:20:04 AM
-
When programming multiple instances of the same scenario (e.g. 50 fire dampers) I like to program one instance in ladder and then copy the mnemonics into an external editor (text editor or spreadsheet), do some copy-paste and replace operations and then copy back into ladder (Tools - Instert Instructions from File). This can save a lot of hours.
Is there any way to programmatically generate more advanced features, e.g. Modbus I/O scanner devices? It certainly is easier by creating new devices from profiles but there is still a handful of manual operations (mouse clicks and keyboard entries) that I would love to automate. Will I just need to resort to an external logic (Python et.al.) to simulate the manual operations in Do-More Designer?
-
There are automated tools for doing such things at a GUI level, but nothing built-in to Designer (no macros, no macro recording).
The following text file Designer document types can be shared across projects:
- Modbus Scanner Profiles
- Electronic Data Sheets (EDS)
- AXSCRIPT scripts
- Value Data Blocks
- UDTs
- Element Documentation
- Code-Blocks
-
Could you use a subroutine instead? I've done what you're talking about before, and even semi-automated it with VBA, but in a platform that allows code reuse, that seems like the optimum solution
-
Thank you for the replies.
I'll need to try out subroutines but since my fire dampers are a monitoring function with timers I'd at least need to change the implementation. Generally speaking, subroutines are a great way to reuse code but I guess they are not applicable in all situations.
-
True! You can also do timers by doing wall clock math. Look at tickus or tickms on enable, and calculate the expiration time. Or count transitions of a flasher bit, either one of the internal ones or one you build yourself.
-
Yet another approach would be to write the routine once using indirect addressing, then loop through it using JMPs or FOR-NEXT. Bear in mind that if you use timers, the TMR would have to be executed every scan (so don't allow a yield), but at least you wouldn't have to repeat the code.
If feasible for the rest of the program, putting everything to do with the fire dampers in instances of a UDT (FireDamper1.Tripped through FireDamper40.ElapsedTime or whatever) would simplify the indirect addressing. UDTs can now contain other structures like timers.