12345678910111213141516171819202122232425262728 |
- #include "variable.h"
- //线圈缓冲
- byte_bits_t middle_coils[(MIDDLE_COILS_NUMBER + 7) >> 3];
- //X输入的通讯缓冲
- byte_bits_t io_x_reg[(IO_X_NUMBER + 7) >> 3];
- //Y输出的通讯缓冲
- byte_bits_t io_y_reg[(IO_Y_NUMBER + 7) >> 3];
- //用户数据
- unsigned short user_datas[USER_DATA_NUMBER];
- UserParam_t *UserParam; //用户数据
- MotorParam_t *MotorParam; //电机参数
- CurAxisParam_t *CurAxisParam; //当前轴状态
- IOPinConfigStrct *IOPinConfig; //输入输出接口配置
- /**
- * 变量初始化,可以在这里添加一些常用的变量与数据结构
- *
- * @author lxz (2019/5/17/周五)
- */
- void variable_init(void)
- {
- UserParam = (UserParam_t *)&user_datas[0];
- MotorParam = (MotorParam_t *)&user_datas[370];
- CurAxisParam = (CurAxisParam_t *)&user_datas[418];
- IOPinConfig = (IOPinConfigStrct *)&user_datas[426];
- }
|