当前做的项目要在触摸屏上实现操作人员权限管理,主要是前后翻页,人员添加删除等等
由于nb可以支持.h,我逻辑引擎已经用c语言全部用Qt+mwing实现完毕,到时候在MainEntry中添加Go(),不过其中要用到读写本地内存的操作,就遇到难点了
NB7有2个读写内存的函数ReadLocal(),WriteLocal(),我在一个头文件加了这么一段代码,这样就可以不借助OMRON的静态库在Qt中编译调试了
#ifndef BAO_OMRON_HELPER_H
#define BAO_OMRON_HELPER_H
/**
Read,Write Local address function:
int ReadLocal( const char *type, int addr, int nRegs, void *buf, int flag );
int WriteLocal( const char *type, int addr, int nRegs, void *buf , int flag );
Parameter: type is the string of "LW","LB" etc;
address is the Operation address ;
nRegs is the length of read or write ;
buf is the buffer which store the reading or writing data;
flag is 0,then codetype is BIN,is 1 then codetype is BCD;
return value : 1 ,Operation success