add labview
This commit is contained in:
@@ -183,24 +183,31 @@ for ( int i=0; i<hdallas.onewire->RomCnt;i++)
|
||||
if (init)
|
||||
{
|
||||
init=0;
|
||||
MB_DATA.Coils.init_param=0;
|
||||
for(int i=0;i<hdallas.onewire->RomCnt;i++)
|
||||
{
|
||||
MB_DATA.HoldRegs.set_Temp[i]=21;
|
||||
|
||||
}
|
||||
// init_all_T_sense();
|
||||
DS18B20_Search(&DS, &OW);
|
||||
//DS18B20_Search(&DS, &OW);
|
||||
|
||||
|
||||
}
|
||||
|
||||
init=MB_DATA.Coils.init_param;
|
||||
Dallas_StartConvertTAll(&hdallas,DALLAS_WAIT_BUS,0);
|
||||
|
||||
for(int i=0;i<hdallas.onewire->RomCnt;i++)
|
||||
{
|
||||
Dallas_ReadTemperature(&sens[i]);
|
||||
sens[i].set_temp = MB_DATA.InRegs.set_Temp[i];
|
||||
sens[i].set_temp = MB_DATA.HoldRegs.set_Temp[i];
|
||||
MB_DATA.InRegs.sens_Temp[i]=sens[i].temperature*10;
|
||||
|
||||
if (sens[i].temperature<sens[i].set_temp-sens[i].hyst)
|
||||
|
||||
{
|
||||
GPIOC->ODR|=1<<13;
|
||||
MB_DATA.Coils.coils.all|=1<<i;
|
||||
|
||||
}
|
||||
|
||||
@@ -208,7 +215,8 @@ for ( int i=0; i<hdallas.onewire->RomCnt;i++)
|
||||
|
||||
if (sens[i].temperature>sens[i].set_temp+sens[i].hyst)
|
||||
{
|
||||
GPIOC->ODR&=~(1<<13);
|
||||
GPIOC->ODR&=~(1<<13);
|
||||
MB_DATA.Coils.coils.all&=~(1<<i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -365,7 +365,7 @@
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>6</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\Core\Src\ow_port.c</PathWithFileName>
|
||||
@@ -389,7 +389,7 @@
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>8</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\Modbus\modbus.c</PathWithFileName>
|
||||
|
||||
@@ -47,12 +47,13 @@
|
||||
|
||||
typedef struct //MB_DataInRegsTypeDef
|
||||
{
|
||||
uint16_t sens_Temp[MAX_SENSE];
|
||||
uint16_t UzptPLUS;
|
||||
uint16_t UzptMINUS;
|
||||
uint16_t UzptPLUS_MIN;
|
||||
uint16_t sens_Temp[MAX_SENSE];
|
||||
|
||||
|
||||
uint16_t set_Temp[MAX_SENSE];
|
||||
|
||||
|
||||
}MB_DataInRegsTypeDef;
|
||||
|
||||
@@ -62,7 +63,7 @@ typedef struct //MB_DataInRegsTypeDef
|
||||
*/
|
||||
typedef struct //MB_DataInRegsTypeDef
|
||||
{
|
||||
|
||||
uint16_t set_Temp[MAX_SENSE];
|
||||
}MB_DataHoldRegsTypeDef;
|
||||
|
||||
|
||||
@@ -107,9 +108,38 @@ typedef struct //MB_DataInRegsTypeDef
|
||||
* @brief Коилы
|
||||
* @details Желательно с помощью reserved делать стркутуру кратной 16-битам
|
||||
*/
|
||||
typedef union
|
||||
{
|
||||
struct {
|
||||
unsigned state_val_01:1;
|
||||
unsigned state_val_02:1;
|
||||
unsigned state_val_03:1;
|
||||
unsigned state_val_04:1;
|
||||
unsigned state_val_05:1;
|
||||
unsigned state_val_06:1;
|
||||
unsigned state_val_07:1;
|
||||
unsigned state_val_08:1;
|
||||
unsigned state_val_09:1;
|
||||
unsigned state_val_10:1;
|
||||
unsigned state_val_11:1;
|
||||
unsigned state_val_12:1;
|
||||
unsigned state_val_13:1;
|
||||
unsigned state_val_14:1;
|
||||
unsigned state_val_15:1;
|
||||
unsigned state_val_16:1;
|
||||
} state_val_bit;
|
||||
uint16_t all;
|
||||
|
||||
|
||||
}word;
|
||||
typedef struct //MB_DataCoilsTypeDef
|
||||
{
|
||||
unsigned reserved:16;
|
||||
|
||||
|
||||
word coils;
|
||||
unsigned init_param:1;
|
||||
unsigned reserved:15;
|
||||
|
||||
}MB_DataCoilsTypeDef;
|
||||
|
||||
// DEFINES FOR COIL ARRAYS
|
||||
|
||||
Reference in New Issue
Block a user