Dear all.
I am working with Modbus library with arduino. I have totally 30 parameter
24 hall sensor, 1 temprature sensor, 1 hv sensor, 1 disconnector status, 1 spd status, 1 device id.
But as soon as enter start address from 0- 30 i wont get error. if i say 0-31 i get check sum error.
Where i have mentioned array size has uint16_t au16data[32];
I dont have much more idea over modbus, Since i found code working i have implicated using it.
Since I have two digital signal status & 1 device ID . Is possible to combine them & store in one array
I mean to say
How can i represent buffer with array value store as [device_ID]+[SPD_Status]+[DC_Status]
While view in Modbus scan i should see buffer like
100 means 1-> device ID, 0-SPD_Status, 0-DC_Status
110 means 1-> device ID, 1-SPD_Status, 0-DC_Status
Is it possible to CONCATENATE value & store as integer value
int SPD_STATUS_PIN=6;
int DC_STATUS_PIN=7;
unsigned int DC_STATUS=0;
unsigned int SPD_STATUS=0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
int Spd=SPD_Check();
int DC_Sta= DC_Status();
delay(1000);
}
int SPD_Check()
{
SPD_STATUS=digitalRead(SPD_STATUS_PIN);
return(SPD_STATUS);
}
int DC_Status()
{
DC_STATUS=digitalRead(DC_STATUS_PIN);
return(DC_STATUS);
}