modify s7 read value num
This commit is contained in:
@@ -420,7 +420,7 @@ int FinsProtocolFormatCmd(struct ControlRecipe *p_recipe, ProtocolFormatInfo *pr
|
||||
p_read_item_data);
|
||||
|
||||
ControlPrintfList("CMD", fins_read_item->data_info.base_data_info.p_command, fins_read_item->data_info.base_data_info.command_length);
|
||||
protocol_format_info->last_item_size = GetValueTypeMemorySize(fins_read_item->value_type);
|
||||
protocol_format_info->last_item_size = GetValueTypeMemorySize(fins_read_item->value_type,1);
|
||||
|
||||
last_item_size += protocol_format_info->last_item_size;
|
||||
|
||||
|
||||
@@ -810,7 +810,7 @@ int MelsecProtocolFormatCmd(struct ControlRecipe *p_recipe, ProtocolFormatInfo *
|
||||
ret = MelsecInitialDataInfo(melsec_read_item, p_read_item_data);
|
||||
|
||||
ControlPrintfList("CMD", melsec_read_item->data_info.base_data_info.p_command, melsec_read_item->data_info.base_data_info.command_length);
|
||||
protocol_format_info->last_item_size = GetValueTypeMemorySize(melsec_read_item->value_type);
|
||||
protocol_format_info->last_item_size = GetValueTypeMemorySize(melsec_read_item->value_type,1);
|
||||
|
||||
last_item_size += protocol_format_info->last_item_size;
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ int8_t ReadPlcDataByRecipe(struct ControlRecipe *p_recipe)
|
||||
}
|
||||
TS7DataItem data_info = ((S7ReadItem*)p_read_item + i)->data_info;
|
||||
Cli_ReadMultiVars(s7_plc, &data_info, 1);
|
||||
uint16_t Size = GetValueTypeMemorySize(((S7ReadItem*)p_read_item + i)->value_type);
|
||||
uint16_t Size = GetValueTypeMemorySize(((S7ReadItem*)p_read_item + i)->value_type,data_info.Amount);
|
||||
ControlPrintfList("S7 RECV", data_info.pdata,Size);
|
||||
PushDataIntoStack(s7_data,data_info.pdata,Size);
|
||||
PrivTaskDelay(100);
|
||||
@@ -196,7 +196,7 @@ static uint8_t InitialS7ReadItem(S7ReadItem* p_read_item, cJSON* read_item_json,
|
||||
printf("value_type is %d, amount is %d, start is %04d, db_number is %d, area is 0x%03x, wordlen is %d.\n",
|
||||
p_read_item->value_type, p_data_info->Amount, p_data_info->Start, p_data_info->DBNumber,
|
||||
p_data_info->Area, p_data_info->WordLen);
|
||||
return GetValueTypeMemorySize(p_read_item->value_type);
|
||||
return GetValueTypeMemorySize(p_read_item->value_type, p_data_info->Amount);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user