3

TL;DR: What is the best way to Export Ladder Logic in Tia 14?

Recently my company has started using Tia Portal v14. The update was due and we have begun to do some work with the S7 1500 series of CPUs. It has come to the attention of those in my team that there is not a simple way to export LAD logic (FBs, FCs, OBs) from Tia 14. Since we are working on separate PCs its very inconvenient not to be able to send the individual blocks to one another when an update is put out. It is even more inconvenient for the people debugging the machines that are using the CPUs. We have come up with a few ways around this, but I wanted to hear the opinion of people on SO regarding the best ay to export LAD logic.

Things we are doing or have tried:

  • Zipping entire project so that it can be sent to a new pc and have the file copied over (Working solution, but seems rather clunky and inconvenient as compared to sending a single file and importing it).

  • Conversion of the Ladder Logic to a language or view that has "Generate Source from Blocks" enabled (SCL, STL, etc.) (Comes with its own host of issues, such as issues converting back to LAD, unfamiliarity with Text based languages, etc).

  • Looking into a solution where the LAD file is converted to XML using a piece of Third party software, and then imported back in through the program on the other end (Not me who is looking into it, so I cant give a lot of details. One of the guys on my team believes this to be possible and is looking into it).

Calling attention to any oversights or offering suggestions is appreciated.

eglease
  • 2,445
  • 11
  • 18
  • 28
JustinCoplin
  • 169
  • 3
  • 16

2 Answers2

6

Your third option you listed may be the best way to do this. You can use the Openness API that is a .net dll. You can quite easily export a plc block (in xml) then import the function block into another project. you don't even have to look at the xml to do this.

Here is an example code of how to do so

//Import blocks
private static void ImportBlocks(PlcSoftware plcSoftware)
{
   PlcBlockGroup blockGroup = plcSoftware.BlockGroup;
   IList<PlcBlock> blocks = blockGroup.Blocks.Import(new 
        FileInfo(@"D:\Blocks\myBlock.xml"), ImportOptions.Override);
}


private static void ExportBlock(PlcSoftware plcSoftware)
{
  PlcBlock plcBlock = plcSoftware.BlockGroup.Blocks.Find("MyBlock");
  plcBlock.Export(new FileInfo(string.Format(@”D:\Samples\{0}.xml”, 
  plcBlock.Name)),
  ExportOptions.WithDefaults);
}

Check out this link for an example project. Openness

mrsargent
  • 2,267
  • 3
  • 19
  • 36
  • Thank you very much. This was what my team member was looking to do when I first wrote this post. I did not receive a briefing about it until after I had asked this question. – JustinCoplin Mar 12 '18 at 10:21
  • I read something about TIA openess scripter, a simpler variant of the answer above: https://support.industry.siemens.com/cs/document/109742322/tool-for-easier-use-of-the-tia-portal-openness-interface-(openness-scripter)?dti=0&lc=en-WW – Brent Mar 17 '18 at 08:34
  • It is not working if block is ladder .LAD – jagdish desai Oct 27 '21 at 12:07
  • Yes it 100% will. I just did it yesterday using this method. It exports the entire ladder as xml – mrsargent Oct 27 '21 at 13:04
4

Another option is to use TIA portal Multiuser Engineering. Siemens has created that solution just for the problem you describe. Check it out here.

It is also possible to create a global library and update from there.

Lastly, just hookup a PLC on your network and go online. Blocks which are changed by your teammate show up orange and you can copy them to your local project.

Brent
  • 101
  • 4
  • All very good ideas, thank you! The only issue with going online is that some of us are not working on the same PLCs, but using the same logic to program multiple machines with many similarities. – JustinCoplin Mar 14 '18 at 10:23