步科触摸屏宏指令
我寻思我也没写啥压,也没报错,写了这个就找不到编译文件了,真是奇奇怪怪
#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 AAA = LW132;
// 计算配方名称和参数的写入地址
int AAA1234 = 20 + (AAA - 1) * 100;
int AAA123456789 = 50 + (AAA - 1) * 100;
// 读取当前配方名
ReadLocal("RW", AAA1234, 12, (void*)A, 0);
ReadLocal("PLC", AAA123456789, 27, (void*)B, 0);
// 写入配方名称和参数
WriteLocal("RW", 0, 12, (void*)buf, 0);
WriteLocal("PLC", 0, 27, (void*)buff, 0);
return 0;
}