For the first time since I'm working for different customers on PLC related projects since the beginning of 2008, I want to plan a software project in advance. During the last project I was working on, I had to modify an existing Software and had to plan the modification in advance with EA, which till that day I’ve never used. Even after reading most parts of the compendium I’m still a newbie.
For the current project I should create a software with which real hardware (e.g., valves, door switch, and so on) should be simulated against the machine PLC, good cases and failure cases.
I thought I’ll create a function block for each device. I’m not sure at the moment, if I will use methods or not. But my question is how to start and how to do it right? I’ve created a sample project in TC3 and created a UML model from it with TC3, but the result doesn’t appeal to me.
I’ve created an EA project with two Packages under the root package. One for the function blocks and another for the program.
For the FBs I have added a class diagram and another one for used EMUMs. The first FB I’ve created is one for a valve. At the moment it consists of four inputs and two outputs which I realized by adding them as attributes with the stereotype Input and Output.
The FB contains also a Method (FB_Init) which needs three inputs at the moment one of these inputs is used to specify the type of the valve and is based on an enum. And that’s where my first question starts. In the one class diagram I design the ENUM and in the class diagram I place an instance of it, but with which link I connect the instance with the FB and in which direction must the arrow go? I think with a usage link drawn from the FB to ENUM instance. And there will be a second instance of it in the declaration part of the FB, because the memory of a method is temporary and while executing the method FB_Init I have to copy the data to another instance of the ENUM, but how do I design this in EA.
Next question is, if I place an instance of the FB in the class diagram for the project it doesn’t show the attributes and operations any more, could this be activated, that it still does it.
Next thing is, that, as mentioned before, the FB is using two instances of an ENUM must/should I also add a link of the instance of the ENUM? If I do so, it doesn’t add the link automatically, should/must I add this manually? Another question is, if I drag and drop the instance used by the FB into the program diagram it doesn’t create a new instance, but each instance of the valve FB will of course have its own two instances of the ENUM. How must this solved correctly?
Thanks in advance.