|
|
|
@ -34,6 +34,7 @@ int Size_AI = 16;
|
|
|
|
|
|
|
|
|
|
int Values_DI; // digit values to a number
|
|
|
|
|
int Values_AI[16];
|
|
|
|
|
int Recent_AI[16][10];
|
|
|
|
|
|
|
|
|
|
/* ---------- I2C (Analog Output, DAC) ---------- */
|
|
|
|
|
// Addresses
|
|
|
|
@ -62,6 +63,40 @@ unsigned long timeoutPeriod = 5000; // 이더넷 타임아웃 시간 (5초)
|
|
|
|
|
|
|
|
|
|
bool State_eth = false;
|
|
|
|
|
|
|
|
|
|
HardwareSerial* Serials[] = {&Serial1, &Serial2};
|
|
|
|
|
|
|
|
|
|
const int BUFF_SIZE = 1024;
|
|
|
|
|
char Buff_Eth_Rd[BUFF_SIZE] = {0};
|
|
|
|
|
char Buff_485_1_Wr[BUFF_SIZE] = {0};
|
|
|
|
|
char Buff_485_1_Rd[BUFF_SIZE] = {0};
|
|
|
|
|
char Buff_485_2_Wr[BUFF_SIZE] = {0};
|
|
|
|
|
char Buff_485_2_Rd[BUFF_SIZE] = {0};
|
|
|
|
|
|
|
|
|
|
String latest_sent_msg;
|
|
|
|
|
int numOf485 = 0;
|
|
|
|
|
int returnTime = 0;
|
|
|
|
|
|
|
|
|
|
/* ---------- RS485 ---------- */
|
|
|
|
|
// 485 CH 1
|
|
|
|
|
bool Wait_485_1;
|
|
|
|
|
int Wait_485_1_cnt;
|
|
|
|
|
int RS485_1_Addr[2] = {0,0};
|
|
|
|
|
bool RS485_1_Rcv_PV[2] = {false, false};
|
|
|
|
|
bool RS485_1_Rcv_SV[2] = {false, false};
|
|
|
|
|
int RS485_1_Rcv_size = 8;
|
|
|
|
|
int RS485_1_Values_PV[8*2];
|
|
|
|
|
int RS485_1_Values_SV[8*2];
|
|
|
|
|
|
|
|
|
|
// 485 CH 2
|
|
|
|
|
bool Wait_485_2;
|
|
|
|
|
int Wait_485_2_cnt;
|
|
|
|
|
int RS485_2_Addr[2];
|
|
|
|
|
bool RS485_2_Rcv_PV[2];
|
|
|
|
|
bool RS485_2_Rcv_SV[2];
|
|
|
|
|
int RS485_2_Rcv_size = 8;
|
|
|
|
|
int RS485_2_Values_PV[8*2];
|
|
|
|
|
int RS485_2_Values_SV[8*2];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Processes
|
|
|
|
|
String Prcss_ALL_Read();
|
|
|
|
|