zoukankan      html  css  js  c++  java
  • B&R配方机制例程

    B&R配方机制例程

    1. 添加库文件 MpWebXs,MpFile,MpRecipe

    2. 添加mapp文件夹

      configuration->PC_any->mapp文件夹

    3. 添加MpRecipe配置
      mapp文件夹右击添加XML Recipe文件

    4. 添加程序

    5. 在程序中添加MpRecipeXml功能块,配置功能块

      PROGRAM _CYCLIC
          (* Insert code here *)
          MpRecipeXml_0.MpLink := ADR(gRecipeXml);
          MpRecipeXml_0.Enable := 1;
          MpRecipeXml_0.DeviceName := ADR('address');
          MpRecipeXml_0.FileName := ADR('recipe');
          MpRecipeXml_0();
      END_PROGRAM
      
    6. 创建文件存储地址

      Physical View->PC_any右击->Configuration->File devices->右击添加

    7. 创建需要保存的数据,放在一个结构体里面

    8. 声明结构体变量,在初始化程序中初始化

      PROGRAM _INIT
          (* Insert code here *)
          saveParameter.saveBOOL := 1;
          saveParameter.saveREAL := 3.14;
          saveParameter.saveSTRING := 'this is a test program by Z.K.';
          saveParameter.saveUDINT := 120;
      END_PROGRAM
      
    9. 在程序中添加MpRecipeRegPar功能块并在程序中配置功能块

      PROGRAM _CYCLIC
          MpRecipeRegPar_0.MpLink := ADR(gRecipeXml);
          MpRecipeRegPar_0.PVname := ADR('Program:saveParameter');
          MpRecipeRegPar_0.Enable := 1;
          MpRecipeRegPar_0();
      END_PROGRAM
      
    10. 测试程序

    11. PROGRAM _INIT
          (* Insert code here *)
          saveParameter.saveBOOL := 1;
          saveParameter.saveREAL := 3.14;
          saveParameter.saveSTRING := 'this is a test program by Z.K.';
          saveParameter.saveUDINT := 120;
      
      END_PROGRAM
      PROGRAM _CYCLIC
          (* Insert code here *)
          MpRecipeXml_0.MpLink := ADR(gRecipeXml);
          MpRecipeXml_0.Enable := 1;
          MpRecipeXml_0.DeviceName := ADR('address');
          MpRecipeXml_0.FileName := ADR('recipe');
          MpRecipeXml_0();
      
      
          MpRecipeRegPar_0.MpLink :=  ADR(gRecipeXml);
          MpRecipeRegPar_0.PVName := ADR('Program:saveParameter');
          MpRecipeRegPar_0.Enable := 1;
          MpRecipeRegPar_0(); 
      
      END_PROGRAM
      


  • 相关阅读:
    jQuery 选择器
    Linux vs Window
    Git是什么?
    JS三大经典变量命名法
    常用html、CSS、javascript前端命名规范
    Ajax中Get请求与Post请求的区别
    HTTP 请求方式: GET和POST的比较
    poj2195 Going Home
    bzoj1059 [ZJOI2007]矩阵游戏
    bzoj1191 [HNOI2006]超级英雄Hero
  • 原文地址:https://www.cnblogs.com/zhengkang/p/5712446.html
Copyright © 2011-2022 走看看