This is an old revision of the document!


Working with Autogen

One of the most important thing you need to know about MervisIDE is what is Autogen and how to work with it. In previous tutorial, we learned that Autogen is for accessing HW inputs and outputs from the program. We also discovered, how to Set Autogen on the whole device (PLC, Extension, Modbus device, 1-Wire sensor,…). Let's discuss it a bit more.

Setting Autogen on whole device is a nice feature for debugging. You tell the Mervis Runtime to poll all the inputs and outputs and you have them immediatelly accessible in your program and in the debugging mode. The downside of this is a hit on the performance of your program. The PLC contains a lot of informations, which are needed in special cases and you don't need them in normal operation. Also polling unnecessary information from the Extensions over slow RS485 bus can have an significant impact on the performance.

The other downside is that the Set Autogen will automatically generate the name of the variable. As you can check, the generated name consists of UniPi unit name and the name of the input/output. In our project we have attached the Neuron L503 and we want to use the digital input 3.7. The generated name is “Neuron L503_DI_3.07”.

You can quite happily use this variable in your program, even multiple times (the button can control many aspects of your project at once). One of the problems with this naming is that it is not descriptive. When you are working on the project, you will remember that DI 3.7 is connected to the “OK” button on the operator's panel, or to the wall switch in your bedroom. In half a year, you wouldn't have to. Or the project will be handed over to somebody else who will not have that knowledge. You can now probably understand, that using the default, generated names is not a good practice.