Modular Application Creator Use Case Based Documentation
Loading...
Searching...
No Matches
TechnologyObjectClass.cs
1using Newtonsoft.Json;
2using Siemens.Automation.ModularApplicationCreator.Tia.Openness;
3using Siemens.Automation.ModularApplicationCreator.Tia.Openness.TO;
4
6
11{
15 public const string MotionControlVersion = "8.0";
16
20 public const int MainTelegramNumber = 105;
21
25 public const string TOType = OpennessConstants.TO_POSITIONING_AXIS;
26
30 public string MaximumVelocity = "999.0";
31
35 public string Name = "myTO";
36
40 public string VirtualAxisMode = "1";
41
48 {
49 TechnologicalObject = new TechnologicalObjectInfo(Name, TOType, MotionControlVersion, "");
50
51 //Add the main telegram number to the TechnologicalObjectInfo Object
52 TechnologicalObject.MainTelegramNumber = MainTelegramNumber;
53
54 //Add the TechnologicalObjectInfo Object to the list of ProvidedTechnologicalObjects of the module
55 myModule.ProvidedTechnologicalObjects.Add(TechnologicalObject);
56 }
57
62 [JsonConstructor]
64 {
65 }
66
70 public TechnologicalObjectInfo TechnologicalObject { get; set; }
71
79 public static void CreateTOs(PlcDevice plcDevice, MAC_use_casesEM module)
80 {
81 foreach (var toInfo in module.ProvidedTechnologicalObjects)
82 {
83 //GetOrCreateRootTO will create a TO in the TO root folder. If a TO with the same name already exists, this TO is returned.
84 var generatedTO = plcDevice.TechnologicalObjects.GetOrCreateRootTO(toInfo, module);
85 }
86 }
87
95 public void ConfigureTO(TechnologicalObjectInfo TechnologicalObject, MAC_use_casesEM myModule)
96 {
97 //Add the additional parameters to the TechnologicalObjectInfo Object
98 var toPath = "DynamicLimits.MaxVelocity";
99 TechnologicalObject.AdditionalParameter[toPath] = MaximumVelocity;
100
101 toPath = "VirtualAxis.Mode";
102 TechnologicalObject.AdditionalParameter[toPath] = VirtualAxisMode;
103
104 //Change parameter of TO
105 toPath = "DynamicDefaults.Velocity";
106 TechnologicalObject.AdditionalParameter[toPath] = "50.0";
107 }
108}
This is the main class in which the workflow starts. Here are all sections for creating or generating...
static void CreateTOs(PlcDevice plcDevice, MAC_use_casesEM module)
This function creates all TOs (toInfo objects) that the user added to module.ProvidedTechnologicalObj...
string MaximumVelocity
This attribute is the used MaximumVelocity of the TechnologyObject.
string Name
This attribute is the used name of the TechnologyObject.
const string TOType
This attribute is the used Type of the TechnologyObject.
TechnologicalObjectInfo TechnologicalObject
This object property is the used instance of the class TechnologyObjectInfo.
TechnologyObjectClass(MAC_use_casesEM myModule)
Creates a new object of the class, sets the MainTelegramNumber of the TechnologyObject add it to myMo...
const int MainTelegramNumber
This attribute is the used MainTelegramNumber.
const string MotionControlVersion
This attribute is the used MotionControlVersion.
void ConfigureTO(TechnologicalObjectInfo TechnologicalObject, MAC_use_casesEM myModule)
This function configures the TechnologyObject (toInfo objects) and add it to the myModule....
string VirtualAxisMode
This attribute is the used VirtualAxisMode of the TechnologyObject.