plcsiemensladder-logic

Exporting Ladder Logic in Tia 14


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:

Calling attention to any oversights or offering suggestions is appreciated.


Solution

  • 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