顺宗
顺宗
2024-05-29 11:43:29

找不到编译的文件

#include "macrotypedef.h"

#include "math.h"


int MacroEntry()

{

    // 配方名称 12个字符串写入到R20

    signed short buf[12] = {0};

    signed short buff[27] = {0};


    // 读取当前配方名

    ReadLocal("RW", 0, 12, (void*)buf, 0);

    ReadLocal("PLC", 0, 27, (void*)buff, 0);


    // 确定配方编号

    int recipeNumber = LW130;

    // 计算配方名称和参数的写入地址

    int recipeNameAddress = 20 + (recipeNumber - 1) * 100;

    int recipeParamAddress = 50 + (recipeNumber - 1) * 100;



    // 写入配方名称和参数

    WriteLocal("RW", recipeNameAddress, 12, (void*)buf, 0);

    WriteLocal("RW", recipeParamAddress, 27, (void*)buff, 0);







    signed short A[12] = {0};

    signed short B[27] = {0};

//选择配方型号


 int 配方型号 = LW132;

    // 计算配方名称和参数的写入地址

    int 配方名称 = 20 + (配方型号 - 1) * 100;

    int 配方地址 = 50 + (配方型号 - 1) * 100;


    // 读取当前配方名

    ReadLocal("RW", 配方名称, 12, (void*)A, 0);

    ReadLocal("PLC", 配方地址, 27, (void*)B, 0);


    // 写入配方名称和参数

    WriteLocal("RW", 0, 12, (void*)buf, 0);

    WriteLocal("PLC", 0, 27, (void*)buff, 0);



















































    

    

    return 0;

}

就写了这些

152
1
0
分享
全部回答1
  • lys
    lys
    WriteLocal是写给本地地址的,”PLC“是外部变量,要用WriteData
    2024-06-03 16:26:50
    0
    评论