Posted 10 Aug 2016 I put together a demo of the c# library I am working on for Rockwell PLC. It basically allows you to parse/construct the L5X files for code generation, documentation, and other uses. https://www.youtube.com/watch?v=kV0nXSyM7Gg Share this post Link to post Share on other sites
Posted 11 Aug 2016 CsvFileDescription d = new CsvFileDescription { SeparatorChar = ',', FirstLineHasColumnNames = true }; CsvContext cc = new CsvContext(); List<Pump> Pumps = new List<Pump>(cc.Read<Pump>(@"c:\tmp\pumps.csv", d)); RSLogix5000Content c = RSLogix5000Content.Load(@"C:\tmp\test.l5x"); Tag PAck = new Tag() { Name = "AlarmsProgAck", DataType = "BOOL", Description = new Description { TypedValue = "All Alarms Program Ack" } }; Tag PRes = new Tag() { Name = "AlarmsProgRes", DataType = "BOOL", Description = new Description { TypedValue = "All Alarms Program Reset" } }; Tag PEn = new Tag() { Name = "AlarmsProgEn", DataType = "BOOL", Description = new Description { TypedValue = "All Alarms Program Enable" } }; Tag PDis = new Tag() { Name = "AlarmsProgDis", DataType = "BOOL", Description = new Description { TypedValue = "All Alarms Program Disable" } }; c.Controller.Tags.Tag.Add(PAck); c.Controller.Tags.Tag.Add(PRes); c.Controller.Tags.Tag.Add(PEn); c.Controller.Tags.Tag.Add(PDis); int x = 1; foreach (Pump p in Pumps) { String InterlockBuilder = ""; if ((p.Interlocks ?? "").Contains(',')) { string[] Interlocks = p.Interlocks.Trim().Split(','); foreach (string interlock in Interlocks) { InterlockBuilder += "XIC(" + interlock + "Running)"; } } Tag PStart = new Tag() { Name = p.Name + "Start", DataType = "BOOL", Description = new Description { TypedValue = p.Description + " Start Command" } }; Tag PStop = new Tag() { Name = p.Name + "Stop", DataType = "BOOL", Description = new Description { TypedValue = p.Description + " Stop Command" } }; Tag PRunA = new Tag() { Name = p.Name + "Run", TagType = "Alias", AliasFor = p.StartOutput, Description = new Description { TypedValue = p.Description + " Run Output" } }; Tag PRunningA = new Tag() { Name = p.Name + "Running", TagType = "Alias", AliasFor = p.RunInput, Description = new Description { TypedValue = p.Description + " Running Input" } }; Tag PAlarmD = new Tag() { Name = p.Name + "Alarm", DataType = "ALARM_DIGITAL", Description = new Description { TypedValue = p.Description + " Start Alarm" } }; Rung r = new Rung(); r.Number = x++; r.Comment = new Comment { TypedValue = "Pump Logic Code for " + p.Description }; r.Text = new Text { TypedValue = "[" + InterlockBuilder + "[XIC(" + p.Name + "Run)XIO(" + p.Name + "Stop),XIC(" + p.Name + "Start)]OTE(" + p.Name + "Run),XIC(" + p.Name + "Run)XIO(" + p.Name + "Running)ALMD(" + PAlarmD.Name + "," + PAck.Name + "," + PRes.Name + "," + PDis.Name + "," + PEn.Name + ")];" }; Routine PumpRoutine = new Routine { Name = p.Name, Type = "RLL" }; PumpRoutine.RLLContent = new RLLContent(); PumpRoutine.RLLContent.Rung.Add(r); c.Controller.Programs.Program[0].Routines.Routine.Add(PumpRoutine); c.Controller.Programs.Program[0].Routines.Routine[0].RLLContent.Rung.Add(new Rung { Number = x, Text = new Text { TypedValue = "JSR(" + p.Name + ",0);" } }); c.Controller.Tags.Tag.Add(PStart); c.Controller.Tags.Tag.Add(PStop); c.Controller.Tags.Tag.Add(PRunA); c.Controller.Tags.Tag.Add(PRunningA); c.Controller.Tags.Tag.Add(PAlarmD); } c.Save("c:\\tmp\\testout.l5x"); Here is the code that generates the ladder logic. Share this post Link to post Share on other sites
Posted 19 Aug 2016 And here is another video demo of me generating FT View Studio SE Faceplates directly from an Add-on Instruction Definition File. https://youtu.be/KRj43JQJ-9A Share this post Link to post Share on other sites
Posted 27 Dec 2017 wuld you mind sharing more info on this topic. How you are doing it e.t.c, e.t.c Share this post Link to post Share on other sites
Posted 1 Feb 2019 This is a really nice application. Only I see that you are using your own defined package "TemperedEnterprises.Tools.Rockwell.PLC" - is this possible to share this on this forum or on GitHub. This package is actually what does the construction of the XML files. Share this post Link to post Share on other sites
Posted 11 January On 10/8/2016 at 3:53 AM, TemperedEnterprises said: I put together a demo of the c# library I am working on for Rockwell PLC. It basically allows you to parse/construct the L5X files for code generation, documentation, and other uses. https://www.youtube.com/watch?v=kV0nXSyM7Gg Can you share libary ? thank you so much!! Share this post Link to post Share on other sites