Browse Source

v5.0 新增上传4路重量

pingche_yh4
ysw 4 years ago
parent
commit
cd225927d9
  1. BIN
      si4/soft_gsm_main.si4project/soft_ps5ws.sip_sym
  2. BIN
      si4/soft_gsm_main.si4project/soft_ps5ws.sip_xc
  3. BIN
      si4/soft_gsm_main.si4project/soft_ps5ws.sip_xf
  4. BIN
      si4/soft_gsm_main.si4project/soft_ps5ws.sip_xm
  5. BIN
      si4/soft_gsm_main.si4project/soft_ps5ws.sip_xr
  6. BIN
      si4/soft_gsm_main.si4project/soft_ps5ws.siproj
  7. BIN
      si4/soft_gsm_main.si4project/soft_ps5ws.siwork
  8. 8
      source/app/app_common.c
  9. 5
      source/app/app_common.h
  10. 22
      source/app/app_task_485.c
  11. 2
      source/app/app_task_tcp.c
  12. 4
      source/app/app_task_tcp_control.c
  13. 2
      source/msp/UART2.h
  14. 2
      source/tpc/tpc_ccmodbus.h
  15. 4
      source/tpc/tpc_modbus.h

BIN
si4/soft_gsm_main.si4project/soft_ps5ws.sip_sym

Binary file not shown.

BIN
si4/soft_gsm_main.si4project/soft_ps5ws.sip_xc

Binary file not shown.

BIN
si4/soft_gsm_main.si4project/soft_ps5ws.sip_xf

Binary file not shown.

BIN
si4/soft_gsm_main.si4project/soft_ps5ws.sip_xm

Binary file not shown.

BIN
si4/soft_gsm_main.si4project/soft_ps5ws.sip_xr

Binary file not shown.

BIN
si4/soft_gsm_main.si4project/soft_ps5ws.siproj

Binary file not shown.

BIN
si4/soft_gsm_main.si4project/soft_ps5ws.siwork

Binary file not shown.

8
source/app/app_common.c

@ -74,6 +74,10 @@ void L2_register_init()
G.total_weight = 0;
G.pi_weight = 0;
G.jing_weight = 0;
G.ch_weight[0] = 0;
G.ch_weight[1] = 0;
G.ch_weight[2] = 0;
G.ch_weight[3] = 0;
G.thrombolytic_val = G.bolus_val = G.hold_val = 0;
G.asga.xaxis = G.asga.yaxis = G.asga.zaxis = 0;
G.rfidval = G.rfidHospitalNo = 0;
@ -90,7 +94,7 @@ void L2_register_init()
G.md_slaver_info[0].slaver = SLAVER_DW20_ID;
G.md_slaver_info[0].oper = MODBUS_OPER_READ;
G.md_slaver_info[0].reg = 0x02;
G.md_slaver_info[0].regnum = 0x02;
G.md_slaver_info[0].regnum = 0x12;
G.md_slaver_info[0].mask = 2; //0->无效 1:暂时有效 2->永久有效
G.md_slaver_info[1].slaver = SLAVER_ASGA03_ID; //倾角XYZ
@ -164,7 +168,7 @@ void L2_register_init()
G.ccmd_slaver_info[3].slaver = SLAVER_TCP_SERVER_ID; //�务�
G.ccmd_slaver_info[3].oper = MODBUS_OPER_WRITE_M;
G.ccmd_slaver_info[3].reg = 0x10;
G.ccmd_slaver_info[3].regnum = 0x0B;
G.ccmd_slaver_info[3].regnum = 0x13;
G.ccmd_slaver_info[3].bytes = G.ccmd_slaver_info[3].regnum * 2;
G.ccmd_slaver_info[3].buf = (U8*)&G.jing_weight;
G.ccmd_slaver_info[3].mask = 0;

5
source/app/app_common.h

@ -106,6 +106,7 @@ typedef struct printer_paper_calib
#define MD_SLAVER_INFO_MAX 6
#define CCMD_SLAVER_INFO_MAX 4
#define D_ch_max_num 4
//需要持久化的参数,不能超过72字节,否则会导致eeprom溢出
typedef struct global_param_changable
@ -135,7 +136,8 @@ typedef struct printer_maintenance_global
U16 hold_val;
CCAsGaInfo asga;
U8 rfid[6];
S32 weight[4];
S32 ch_weight[D_ch_max_num];
//S32 weight[4];
//U16 reserved2[16 - 9];
MD_SLAVER_INFO md_slaver_info[MD_SLAVER_INFO_MAX];
@ -153,6 +155,7 @@ typedef struct printer_maintenance_global
U16 _key;
S32 pi_weight;
S32 total_weight;
CCAsGaInfo asga_02;
U8 reset;

22
source/app/app_task_485.c

@ -71,7 +71,27 @@ void L3_task_485_handle(TS_485 *s)
| (S32)(s->pAckPkg->buf[2]) << 16
| (S32)(s->pAckPkg->buf[3]) << 8
| (S32)(s->pAckPkg->buf[4]);
G.ch_weight[0] =
(S32)(s->pAckPkg->buf[5]) << 24
| (S32)(s->pAckPkg->buf[6]) << 16
| (S32)(s->pAckPkg->buf[7]) << 8
| (S32)(s->pAckPkg->buf[8]);
G.ch_weight[1] =
(S32)(s->pAckPkg->buf[9]) << 24
| (S32)(s->pAckPkg->buf[10]) << 16
| (S32)(s->pAckPkg->buf[11]) << 8
| (S32)(s->pAckPkg->buf[12]);
G.ch_weight[2] =
(S32)(s->pAckPkg->buf[13]) << 24
| (S32)(s->pAckPkg->buf[14]) << 16
| (S32)(s->pAckPkg->buf[15]) << 8
| (S32)(s->pAckPkg->buf[16]);
G.ch_weight[3] =
(S32)(s->pAckPkg->buf[17]) << 24
| (S32)(s->pAckPkg->buf[18]) << 16
| (S32)(s->pAckPkg->buf[19]) << 8
| (S32)(s->pAckPkg->buf[20]);
G.jing_weight = (G.total_weight <= G.pi_weight) ? (0) :(G.total_weight - G.pi_weight) ;
break;
case 1:

2
source/app/app_task_tcp.c

@ -46,7 +46,7 @@ void L3_task_tcp_handle(TS_tcp *s)
TTSS_Task_step(D_task_tcp_send_modbus_pkg) //发送包
L0_uart4_sendArray((U8*)&s->loopPkg, s->pkglen);
//L0_uart0_sendArray((U8*)&s->loopPkg, s->pkglen);
L0_uart0_sendArray((U8*)&s->loopPkg, s->pkglen);
s->sendStamp = s_nos_tick.t_1s;
if(G.ccmd_slaver_info[s->slaverIndex].mask == 1)
{

4
source/app/app_task_tcp_control.c

@ -32,12 +32,12 @@ void L3_task_tcp_control_handle(TS_tcp_control *s)
//3s一次发送数据包
if(s_nos_tick.t_1s - ts_tcp_control.tcp_send_stmp >= 3)
{
if(!G.authed)
if(/*!G.authed*/0)
{
//发送认证包
G.ccmd_slaver_info[0].mask = 1;
}
else if(!G.flowStarted)
else if(/*!G.flowStarted*/0)
{
//发送流程开始包
G.ccmd_slaver_info[2].mask = 1;

2
source/msp/UART2.h

@ -64,7 +64,7 @@ msp/uartx.c 底层代码 和cpu相关 缓存发送也放在里面
#define D_s_uart2_rec_open(); s_uart2_rec.ok = 0;// 关闭串口协议解析
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
#define D_send2_buf_max 64 /// 9600bps = 10000bps = 1000 Bps = 1Byte/ms
#define D_send2_buf_max 128 /// 9600bps = 10000bps = 1000 Bps = 1Byte/ms
/// 19200bps = 20000bps = 2000Bps = 2Byte/ms = 1Byte/0.5ms
/// 128Bytes = 128*0.5ms = 64ms
struct _s_uart2_send_buf_

2
source/tpc/tpc_ccmodbus.h

@ -66,7 +66,7 @@ msp/uartx.c 底层代码 和cpu相关
/// 协议表达的意思为地址为0x52的从机, 功能码16 数据为11 22 33 44,校验码 F5 9F
/// 校验码的范围为
#define D_s_PH3_ccmodbus_max 64
#define D_s_PH3_ccmodbus_max 128
#define D_s_PH3_ccmodbus_min 4
typedef struct

4
source/tpc/tpc_modbus.h

@ -48,8 +48,8 @@ enum MODBUS_ERR_CODE
};
//协议类型: MODBUS RTU模式
#define D_s_PH4_modbus_max (32)
//#define D_s_PH4_modbus_max (64)
//#define D_s_PH4_modbus_max (32)
#define D_s_PH4_modbus_max (64)
typedef struct ts_ph4_modbus
{

Loading…
Cancel
Save