Browse Source

显示信息添加

master
sc 1 week ago
parent
commit
d0495cd3fc
  1. 3
      applications/PLC_link.c
  2. 10
      applications/data/DATA_comm.c
  3. 29
      applications/data/SC828_DATA_table.c
  4. 10
      applications/data/Variable.c
  5. 10
      applications/data/Variable.h
  6. 2
      applications/lvgl/guider/generated/setup_scr_screen.c
  7. 1
      applications/lvgl/lv__user_gui.c

3
applications/PLC_link.c

@ -65,7 +65,8 @@ static void mb_plc_read_regs(mb_inst_t *hinst)
// 写入 Modbus // 写入 Modbus
mb_write_bits(hinst, 2256, DO_TABLE_SIZE, w_buffer); mb_write_bits(hinst, 2256, DO_TABLE_SIZE, w_buffer);
//输入寄存器d0->6000 u16 r_regsD[AI_TABLE_SIZE]; //输入寄存器d0->6000
u16 r_regsD[AI_TABLE_SIZE];
// 读 Modbus // 读 Modbus
mb_read_regs(hinst, 6000, AI_TABLE_SIZE, r_regsD); mb_read_regs(hinst, 6000, AI_TABLE_SIZE, r_regsD);
for (int i = 0; i < AI_TABLE_SIZE; i++) for (int i = 0; i < AI_TABLE_SIZE; i++)

10
applications/data/DATA_comm.c

@ -442,9 +442,15 @@ void pasre_DAT(const char *api, const char *json_str)
else if (strcmp(api, "SC832") == 0) else if (strcmp(api, "SC832") == 0)
{//当前细节信息 {//当前细节信息
cJSON_AddItemToObject(dat,"Pump",cJSON_CreateNumber(Pump));//泵 cJSON_AddItemToObject(dat,"Pump",cJSON_CreateNumber(Pump));//泵
cJSON_AddItemToObject(dat,"TC",cJSON_CreateNumber(TC));//温度比例 cJSON_AddItemToObject(dat,"TC",cJSON_CreateNumber(TC_H));//温度比例
cJSON_AddItemToObject(dat,"TCL",cJSON_CreateNumber(TC_L));//温度比例
cJSON_AddItemToObject(dat,"Fan",cJSON_CreateNumber(Fan));//风机 cJSON_AddItemToObject(dat,"Fan",cJSON_CreateNumber(Fan));//风机
cJSON_AddItemToObject(dat,"Pull",cJSON_CreateNumber(Pull));//提布 cJSON_AddItemToObject(dat,"Pull",cJSON_CreateNumber(Pull1));//提布
cJSON_AddItemToObject(dat,"Pull2",cJSON_CreateNumber(Pull2));//提布
cJSON_AddItemToObject(dat,"Pull3",cJSON_CreateNumber(Pull3));//提布
cJSON_AddItemToObject(dat,"Pull4",cJSON_CreateNumber(Pull4));//提布
cJSON_AddItemToObject(dat,"Pull5",cJSON_CreateNumber(Pull5));//提布
cJSON_AddItemToObject(dat,"Pull6",cJSON_CreateNumber(Pull6));//提布
cJSON_AddItemToObject(dat,"Swing",cJSON_CreateNumber(Swing));//摆布 cJSON_AddItemToObject(dat,"Swing",cJSON_CreateNumber(Swing));//摆布
cJSON_AddItemToObject(dat,"STA",cJSON_CreateNumber(STA));//料1 cJSON_AddItemToObject(dat,"STA",cJSON_CreateNumber(STA));//料1
cJSON_AddItemToObject(dat,"STB",cJSON_CreateNumber(STB));//料2 cJSON_AddItemToObject(dat,"STB",cJSON_CreateNumber(STB));//料2

29
applications/data/SC828_DATA_table.c

@ -310,8 +310,10 @@ void DATA_INSTRUCTION_START(char p[25]){
rt_snprintf(step_table[i].StepID_S2, 3,"000"); rt_snprintf(step_table[i].StepID_S2, 3,"000");
rt_snprintf(step_table[i].StepID_S3, 3,"000"); rt_snprintf(step_table[i].StepID_S3, 3,"000");
} }
Pump = 0;TC = 0;Fan = 0;Pull = 0;Swing = 0; Pump = 0;TC_H = 0;TC_L = 0;Fan = 0;
STA = 0;STB = 0;STC = 0;Time = 0;StepN = 0; Swing = 0;Pull1 = 0;Pull2 = 0;Pull3 = 0;
Pull4 = 0;Pull5 = 0;Pull6 = 0;StepN = 0;
STA = 0;STB = 0;STC = 0;Time = 0;
P6 = 0;P7 = 0;P8 = 0;P9 = 0;P10 = 0; P6 = 0;P7 = 0;P8 = 0;P9 = 0;P10 = 0;
P1 = 0;P2 =0;P3 =0;P4 =0;P5 =0; P1 = 0;P2 =0;P3 =0;P4 =0;P5 =0;
P1S1 =0;P2S1 =0;P3S1 =0;P4S1 =0; P1S1 =0;P2S1 =0;P3S1 =0;P4S1 =0;
@ -353,8 +355,10 @@ void DATA_INSTRUCTION_STOP(){
rt_snprintf(step_table[i].StepID_S2, 3,"000"); rt_snprintf(step_table[i].StepID_S2, 3,"000");
rt_snprintf(step_table[i].StepID_S3, 3,"000"); rt_snprintf(step_table[i].StepID_S3, 3,"000");
} }
Pump = 0;TC = 0;Fan = 0;Pull = 0;Swing = 0; Pump = 0;TC_H = 0;TC_L = 0;Fan = 0;
STA = 0;STB = 0;STC = 0;Time = 0;StepN = 0; Swing = 0;Pull1 = 0;Pull2 = 0;Pull3 = 0;
Pull4 = 0;Pull5 = 0;Pull6 = 0;StepN = 0;
STA = 0;STB = 0;STC = 0;Time = 0;
P6 = 0;P7 = 0;P8 = 0;P9 = 0;P10 = 0; P6 = 0;P7 = 0;P8 = 0;P9 = 0;P10 = 0;
P1 = 0;P2 =0;P3 =0;P4 =0;P5 =0; P1 = 0;P2 =0;P3 =0;P4 =0;P5 =0;
P1S1 =0;P2S1 =0;P3S1 =0;P4S1 =0; P1S1 =0;P2S1 =0;P3S1 =0;P4S1 =0;
@ -396,6 +400,7 @@ void table_thread_entry(void *parameter)
{ {
rt_thread_delay(1000); rt_thread_delay(1000);
//Ai输入
MTT = get_ai_value(4001)/10.0f; MTT = get_ai_value(4001)/10.0f;
MUT = get_ai_value(4002)/10.0f; MUT = get_ai_value(4002)/10.0f;
STTA = get_ai_value(4003)/10.0f; STTA = get_ai_value(4003)/10.0f;
@ -407,7 +412,21 @@ void table_thread_entry(void *parameter)
STLC = get_ai_value(4010); STLC = get_ai_value(4010);
MTH = get_ai_value(4022); MTH = get_ai_value(4022);
//Ao输出
get_ao_value(5001,TC_H);
get_ao_value(5002,TC_L);
get_ao_value(5003,Fan);
get_ao_value(5004,Pump);
get_ao_value(5005,STA);
get_ao_value(5006,STB);
get_ao_value(5007,STC);
get_ao_value(5008,Swing);
get_ao_value(5009,Pull1);
get_ao_value(5010,Pull2);
get_ao_value(5011,Pull3);
get_ao_value(5012,Pull4);
get_ao_value(5013,Pull5);
get_ao_value(5014,Pull6);
} }
} }

10
applications/data/Variable.c

@ -56,9 +56,15 @@ float STLC = 0.0f;//料c水位
// 控制输出 // 控制输出
unsigned int Pump = 0;//主泵 unsigned int Pump = 0;//主泵
unsigned int TC = 0;//温度比例 unsigned int TC_H = 0;//温度比例
unsigned int TC_L = 0;//温度比例
unsigned int Fan = 0;//风机 unsigned int Fan = 0;//风机
unsigned int Pull = 0;//提布 unsigned int Pull1 = 0;//提布
unsigned int Pull2= 0;//提布
unsigned int Pull3 = 0;//提布
unsigned int Pull4 = 0;//提布
unsigned int Pull5 = 0;//提布
unsigned int Pull6 = 0;//提布
unsigned int Swing = 0;//摆布 unsigned int Swing = 0;//摆布
unsigned int STA = 0;//料a比例 unsigned int STA = 0;//料a比例
unsigned int STB = 0; unsigned int STB = 0;

10
applications/data/Variable.h

@ -42,9 +42,15 @@ extern unsigned int UserInfoStart;
extern unsigned int RUN; extern unsigned int RUN;
extern unsigned int STEPID; extern unsigned int STEPID;
extern unsigned int Pump; extern unsigned int Pump;
extern unsigned int TC; extern unsigned int TC_H;//温度比例
extern unsigned int TC_L;//温度比例
extern unsigned int Fan; extern unsigned int Fan;
extern unsigned int Pull; extern unsigned int Pull1;
extern unsigned int Pull2;
extern unsigned int Pull3;
extern unsigned int Pull4;
extern unsigned int Pull5;
extern unsigned int Pull6;
extern unsigned int Swing; extern unsigned int Swing;
extern unsigned int STA; extern unsigned int STA;
extern unsigned int STB; extern unsigned int STB;

2
applications/lvgl/guider/generated/setup_scr_screen.c

@ -903,7 +903,7 @@ void setup_scr_screen(lv_ui *ui)
//Write codes screen_w_io //Write codes screen_w_io
ui->screen_w_io = lv_tabview_create(ui->screen_tabview_tab_3, LV_DIR_RIGHT, 50); ui->screen_w_io = lv_tabview_create(ui->screen_tabview_tab_3, LV_DIR_RIGHT, 50);
lv_obj_set_pos(ui->screen_w_io, 0, 1); lv_obj_set_pos(ui->screen_w_io, 0, 1);
lv_obj_set_size(ui->screen_w_io, 984, 460); lv_obj_set_size(ui->screen_w_io, 980, 450);
lv_obj_set_scrollbar_mode(ui->screen_w_io, LV_SCROLLBAR_MODE_OFF); lv_obj_set_scrollbar_mode(ui->screen_w_io, LV_SCROLLBAR_MODE_OFF);
//Write style for screen_w_io, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. //Write style for screen_w_io, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.

1
applications/lvgl/lv__user_gui.c

@ -31,6 +31,7 @@
void setup_user_screen(lv_ui *ui) void setup_user_screen(lv_ui *ui)
{ {
lv_obj_clear_flag(lv_tabview_get_content(ui->screen_tabview), LV_OBJ_FLAG_SCROLLABLE);//禁止左右滑动 lv_obj_clear_flag(lv_tabview_get_content(ui->screen_tabview), LV_OBJ_FLAG_SCROLLABLE);//禁止左右滑动
lv_obj_clear_flag(lv_tabview_get_content(ui->screen_w_io), LV_OBJ_FLAG_SCROLLABLE);//禁止左右滑动
lv_textarea_set_text(ui->screen_machine_id, machine_ID);//设备id lv_textarea_set_text(ui->screen_machine_id, machine_ID);//设备id
lv_textarea_set_text(ui->screen_machine_name, machine_name);//设备名 lv_textarea_set_text(ui->screen_machine_name, machine_name);//设备名

Loading…
Cancel
Save