本动态库 c++ 调用方式
1.添加头文件和动态库文件
#include "myModbus.h"
#pragma comment(lib, "myModebus.lib")
2.调用功能函数
//打开串口 可设置 波特率 停止位 校验位 等
CmyModbus t_mod;
t_mod.openPort(1,9600);
//发送数据 前提打开串口
bool a = t_mod.sendMsg("aslkdjf");
//设置接收包
char rstBuff[100];
UINT a;
//接收数据 前提打开串口
bool b = t_mod.getMsg(rstBuff, a);
b = !b;
1