|
|
@ -204,8 +204,6 @@ IO_State_AIO ao_table[] = { |
|
|
{5015, 0, STR_NULL}, |
|
|
{5015, 0, STR_NULL}, |
|
|
{5016, 0, STR_NULL} |
|
|
{5016, 0, STR_NULL} |
|
|
}; |
|
|
}; |
|
|
//步骤数据表最大99
|
|
|
|
|
|
IO_STEP_DATA step_table[99]; |
|
|
|
|
|
|
|
|
|
|
|
const unsigned char DI_TABLE_SIZE = sizeof(di_table) / sizeof(di_table[0]); |
|
|
const unsigned char DI_TABLE_SIZE = sizeof(di_table) / sizeof(di_table[0]); |
|
|
const unsigned char DO_TABLE_SIZE = sizeof(do_table) / sizeof(do_table[0]); |
|
|
const unsigned char DO_TABLE_SIZE = sizeof(do_table) / sizeof(do_table[0]); |
|
|
@ -213,37 +211,32 @@ const unsigned char AI_TABLE_SIZE = sizeof(ai_table) / sizeof(ai_table[0]); |
|
|
const unsigned char AO_TABLE_SIZE = sizeof(ao_table) / sizeof(ao_table[0]); |
|
|
const unsigned char AO_TABLE_SIZE = sizeof(ao_table) / sizeof(ao_table[0]); |
|
|
const unsigned char DATA_TABLE_SIZE = sizeof(data_table) / sizeof(data_table[0]); |
|
|
const unsigned char DATA_TABLE_SIZE = sizeof(data_table) / sizeof(data_table[0]); |
|
|
|
|
|
|
|
|
void DATA_Table_Init(){ |
|
|
//步骤数据表最大
|
|
|
for(int i=0;i<DI_TABLE_SIZE;i++) |
|
|
//IO_STEP_DATA step_table[256] ;
|
|
|
{ |
|
|
IO_STEP_DATA *step_table= NULL; |
|
|
di_table[i].current_state = 0; |
|
|
|
|
|
} |
|
|
|
|
|
for(int i=0;i<DO_TABLE_SIZE;i++) |
|
|
|
|
|
{ |
|
|
|
|
|
do_table[i].current_state = 0; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for(int i=0;i<AI_TABLE_SIZE;i++) |
|
|
extern struct rt_memheap sram_SRAM1,sdram_heap; |
|
|
{ |
|
|
void DATA_Table_Init(){ |
|
|
ai_table[i].current_Value = 0; |
|
|
step_table = rt_memheap_alloc(&sdram_heap, sizeof(IO_STEP_DATA)*256); |
|
|
} |
|
|
|
|
|
for(int i=0;i<AO_TABLE_SIZE;i++) |
|
|
|
|
|
{ |
|
|
|
|
|
ao_table[i].current_Value = 0; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for(int i=0;i<DATA_TABLE_SIZE;i++) |
|
|
for(int i=0;i<256;i++) |
|
|
{ |
|
|
|
|
|
data_table[i].current_data = 0; |
|
|
|
|
|
} |
|
|
|
|
|
for(int i=0;i<99;i++) |
|
|
|
|
|
{ |
|
|
{ |
|
|
step_table[i].RUN = 0; |
|
|
step_table[i].RUN = 0; |
|
|
|
|
|
rt_snprintf(step_table[i].Dyelot ,1,""); |
|
|
|
|
|
step_table[i].ReDye = 0; |
|
|
|
|
|
rt_snprintf(step_table[i].StepID ,1,""); |
|
|
|
|
|
rt_snprintf(step_table[i].StepName ,1,""); |
|
|
|
|
|
rt_snprintf(step_table[i].ParameterName ,1,""); |
|
|
step_table[i].Parameter1 = 0; |
|
|
step_table[i].Parameter1 = 0; |
|
|
step_table[i].Parameter2 = 0; |
|
|
step_table[i].Parameter2 = 0; |
|
|
step_table[i].Parameter3 = 0; |
|
|
step_table[i].Parameter3 = 0; |
|
|
step_table[i].Parameter4 = 0; |
|
|
step_table[i].Parameter4 = 0; |
|
|
step_table[i].Parameter5 = 0; |
|
|
step_table[i].Parameter5 = 0; |
|
|
|
|
|
step_table[i].P6 = 0; |
|
|
|
|
|
step_table[i].P7 = 0; |
|
|
|
|
|
step_table[i].P8 = 0; |
|
|
|
|
|
step_table[i].P9 = 0; |
|
|
|
|
|
step_table[i].P10 = 0; |
|
|
step_table[i].Parameter1_S1 = 0; |
|
|
step_table[i].Parameter1_S1 = 0; |
|
|
step_table[i].Parameter2_S1 = 0; |
|
|
step_table[i].Parameter2_S1 = 0; |
|
|
step_table[i].Parameter3_S1 = 0; |
|
|
step_table[i].Parameter3_S1 = 0; |
|
|
@ -267,14 +260,24 @@ void DATA_Table_Init(){ |
|
|
} |
|
|
} |
|
|
//运行指令:开始
|
|
|
//运行指令:开始
|
|
|
void DATA_INSTRUCTION_START(char p[25]){ |
|
|
void DATA_INSTRUCTION_START(char p[25]){ |
|
|
for(int i=0;i<99;i++) |
|
|
for(int i=0;i<256;i++) |
|
|
{ |
|
|
{ |
|
|
step_table[i].RUN = 0; |
|
|
step_table[i].RUN = 0; |
|
|
|
|
|
rt_snprintf(step_table[i].Dyelot ,1,""); |
|
|
|
|
|
step_table[i].ReDye = 0; |
|
|
|
|
|
rt_snprintf(step_table[i].StepID ,1,""); |
|
|
|
|
|
rt_snprintf(step_table[i].StepName ,1,""); |
|
|
|
|
|
rt_snprintf(step_table[i].ParameterName ,1,""); |
|
|
step_table[i].Parameter1 = 0; |
|
|
step_table[i].Parameter1 = 0; |
|
|
step_table[i].Parameter2 = 0; |
|
|
step_table[i].Parameter2 = 0; |
|
|
step_table[i].Parameter3 = 0; |
|
|
step_table[i].Parameter3 = 0; |
|
|
step_table[i].Parameter4 = 0; |
|
|
step_table[i].Parameter4 = 0; |
|
|
step_table[i].Parameter5 = 0; |
|
|
step_table[i].Parameter5 = 0; |
|
|
|
|
|
step_table[i].P6 = 0; |
|
|
|
|
|
step_table[i].P7 = 0; |
|
|
|
|
|
step_table[i].P8 = 0; |
|
|
|
|
|
step_table[i].P9 = 0; |
|
|
|
|
|
step_table[i].P10 = 0; |
|
|
step_table[i].Parameter1_S1 = 0; |
|
|
step_table[i].Parameter1_S1 = 0; |
|
|
step_table[i].Parameter2_S1 = 0; |
|
|
step_table[i].Parameter2_S1 = 0; |
|
|
step_table[i].Parameter3_S1 = 0; |
|
|
step_table[i].Parameter3_S1 = 0; |
|
|
@ -312,14 +315,24 @@ void DATA_INSTRUCTION_START(char p[25]){ |
|
|
} |
|
|
} |
|
|
//运行指令:结束
|
|
|
//运行指令:结束
|
|
|
void DATA_INSTRUCTION_STOP(){ |
|
|
void DATA_INSTRUCTION_STOP(){ |
|
|
for(int i=0;i<99;i++) |
|
|
for(int i=0;i<256;i++) |
|
|
{ |
|
|
{ |
|
|
step_table[i].RUN = 0; |
|
|
step_table[i].RUN = 0; |
|
|
|
|
|
rt_snprintf(step_table[i].Dyelot ,1,""); |
|
|
|
|
|
step_table[i].ReDye = 0; |
|
|
|
|
|
rt_snprintf(step_table[i].StepID ,1,""); |
|
|
|
|
|
rt_snprintf(step_table[i].StepName ,1,""); |
|
|
|
|
|
rt_snprintf(step_table[i].ParameterName ,1,""); |
|
|
step_table[i].Parameter1 = 0; |
|
|
step_table[i].Parameter1 = 0; |
|
|
step_table[i].Parameter2 = 0; |
|
|
step_table[i].Parameter2 = 0; |
|
|
step_table[i].Parameter3 = 0; |
|
|
step_table[i].Parameter3 = 0; |
|
|
step_table[i].Parameter4 = 0; |
|
|
step_table[i].Parameter4 = 0; |
|
|
step_table[i].Parameter5 = 0; |
|
|
step_table[i].Parameter5 = 0; |
|
|
|
|
|
step_table[i].P6 = 0; |
|
|
|
|
|
step_table[i].P7 = 0; |
|
|
|
|
|
step_table[i].P8 = 0; |
|
|
|
|
|
step_table[i].P9 = 0; |
|
|
|
|
|
step_table[i].P10 = 0; |
|
|
step_table[i].Parameter1_S1 = 0; |
|
|
step_table[i].Parameter1_S1 = 0; |
|
|
step_table[i].Parameter2_S1 = 0; |
|
|
step_table[i].Parameter2_S1 = 0; |
|
|
step_table[i].Parameter3_S1 = 0; |
|
|
step_table[i].Parameter3_S1 = 0; |
|
|
@ -420,6 +433,8 @@ static struct rt_thread dat_table_thread; |
|
|
static void *dat_comm_stack __attribute__((aligned(4)))= RT_NULL ; |
|
|
static void *dat_comm_stack __attribute__((aligned(4)))= RT_NULL ; |
|
|
int data_table_th(void) |
|
|
int data_table_th(void) |
|
|
{ |
|
|
{ |
|
|
|
|
|
DATA_Table_Init(); |
|
|
|
|
|
|
|
|
rt_err_t dat_err; |
|
|
rt_err_t dat_err; |
|
|
|
|
|
|
|
|
dat_comm_stack = rt_memheap_alloc(&sram_DTCMRAM, 1024); |
|
|
dat_comm_stack = rt_memheap_alloc(&sram_DTCMRAM, 1024); |
|
|
|