步科触摸屏宏指令
这个数组写不进去触摸屏地址
#include "macrotypedef.h"
#include "math.h"
int MacroEntry()
{
// 定义配方名称缓冲区和参数缓冲区
signed short recipeNameBuf[12] = {0};
signed short recipeParamBuf[27] = {0};
signed short Buf[12] = {0};
signed short Buff[27] = {0};
signed short i
// 确定当前配方编号
int currentRecipeNumber = LW130;
if (currentRecipeNumber != 0)
// 读取当前配方名称和参数
ReadLocal("RW", 0, 12, (void*)recipeNameBuf, 0);
ReadLocal("RL", 400, 27, (void*)recipeParamBuf, 0);
{
// 计算配方名称和参数的写入地址
int recipeNameStartAddress = 20 + (currentRecipeNumber - 1) * 100;
int recipeParamStartAddress = 50 + (currentRecipeNumber - 1) * 100;
// 写入配方名称和参数
WriteLocal("RW", recipeNameStartAddress, 12, (void*)recipeNameBuf, 0);
WriteLocal("RW", recipeParamStartAddress, 27, (void*)recipeParamBuf, 0);
}
// 确定当前选择的模型编号
int currentModelNumber = LW132;
// 判断 LW132 是否不等于 0
if (currentModelNumber != 0)
{
// 计算模型名称和参数的读取地址
int modelNameStartAddress = 20 + (currentModelNumber - 1) * 100;
int modelParamStartAddress = 50 + (currentModelNumber - 1) * 100;
// 读取模型名称和参数
ReadLocal("RW", modelNameStartAddress, 12, (void*)Buf, 0);
ReadLocal("RW", modelParamStartAddress, 27, (void*)Buff, 0);
// 写入模型名称和参数
WriteLocal("RW", 0, 12, (void*)Buf, 0);
WriteLocal("RL", 400, 27, (void*)Buff, 0);
}
return 0;
}