Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:sw:01-mervis:changing-prototypes-hidden [2018/10/09 07:51]
mkudlacek
en:sw:01-mervis:changing-prototypes-hidden [2021/08/10 08:09] (current)
avsetula
Line 1: Line 1:
 ====== Changing prototypes ====== ====== Changing prototypes ======
-A "​prototype"​ is a definition of a device (PLC, extension, sensor,​...). It contains information about device'​s available inputs and outputs, which you can use in your project. The prototypes are (not often) changing in time, mainly with new HW revisions, or with introduction of a new functionality.+A "​prototype"​ is a definition of a device (unit, extension, sensor,​...). It contains information about device'​s available inputs and outputs, which you can use in your project. The prototypes are (not often) changing in time, mainly with new HW revisions, or with introduction of a new functionality.
  
 The prototype definitions are shipped with MervisIDE. When you create a new project, you will be offered the most recent version of prototype. But when you open project created in older MervisIDE, the current MervisIDE will use old prototype. This behaviour ensures backward compatibility. The MervisIDE will only give you warning upon building a project with old (obsolete) prototypes: The prototype definitions are shipped with MervisIDE. When you create a new project, you will be offered the most recent version of prototype. But when you open project created in older MervisIDE, the current MervisIDE will use old prototype. This behaviour ensures backward compatibility. The MervisIDE will only give you warning upon building a project with old (obsolete) prototypes:
Line 23: Line 23:
  
 As we added the new prototype, the project still doesn'​t know about the IOs. We need to set the autogen. For now, you can set autogen on whole device but the better way is to set autogen only on the IOs you want to use. You can learn why and how to do it in [[en:​sw:​01-mervis:​autogen-hidden|this tutorial]]. As we added the new prototype, the project still doesn'​t know about the IOs. We need to set the autogen. For now, you can set autogen on whole device but the better way is to set autogen only on the IOs you want to use. You can learn why and how to do it in [[en:​sw:​01-mervis:​autogen-hidden|this tutorial]].
 +
 +After setting the autogen, you can start replacing the wrong IOs in your program with the correct one. We will start with replacing the "​Neuron_L50x_DI_1.01"​. We have a free space under this block, so we will right-click on it and in the context menu select the "​Global Variables -> Insert Existing Variable"​.
 +
 +{{ :​en:​sw:​01-mervis:​changing-prototypes-06-insert-existing-variable.png?​direct |}}
 +
 +In the **Insert Existing Variable** dialog, search for the DI_1.01, which we want to replace. Select the found variable and confirm by clicking on **OK**.
 +
 +{{ :​en:​sw:​01-mervis:​changing-prototypes-07-insert-existing-variable-dialog.png?​direct |}}
 +
 +As a result, a new datapoint will appear under the old one. Now select the wire leading from the old one by single clicking on it. Then click and grab the end of the wire and move it to the new datapoint. ​
 +
 +{{ :​en:​sw:​01-mervis:​changing-prototypes-08-moving-the-wire.png?​direct |}}
 +
 +The result should look like this:
 +
 +{{ :​en:​sw:​01-mervis:​changing-prototypes-09-after-moving-the-wire.png?​direct |}}
 +
 +Now you can get rid of the old datapoint. Right-click on it and in the context menu select the **Delete** option.
 +
 +{{ :​en:​sw:​01-mervis:​changing-prototypes-10-delete-old-variable.png?​direct |}}
 +
 +And repeat the process for the remaining IOs until the build of the project succeeds. We only had to replace the "​Neuron_L50x_RO_2.01":​
 +
 +{{ :​en:​sw:​01-mervis:​changing-prototypes-11-after-fixing.png?​direct |}}