teste de publish
Diff: devices.cpp
- Revision:
- 6:f20c0e094294
- Parent:
- 5:8efd609dea7d
- Child:
- 7:b4b2b8720166
--- a/devices.cpp Tue Jul 11 11:55:44 2017 +0000 +++ b/devices.cpp Wed Aug 09 20:37:54 2017 +0000 @@ -362,19 +362,22 @@ } break; - case modBusType_bit: + case modBusType_bit: //Montar bit! //O valor de alarm para bit é o value[0]!!! value_bit = (this->alarms[alarmIndex].value[0] > 0); //Qualquer valor maior que zero da saída 1 - //Bloco de leitura da variável modBus; - modBusMaster1::readCoils( - this->alarms[alarmIndex].addrModbusRead, - this->alarms[alarmIndex].regModbusRead, - 1, - &leitura_bit - ); - + if(this->alarms[alarmIndex].addrModbusRead != enderecoControladoraVirtual){//Bloco de leitura da variável modBus; + //Bloco de leitura da variável modBus; + modBusMaster1::readCoils( + this->alarms[alarmIndex].addrModbusRead, + this->alarms[alarmIndex].regModbusRead, + 1, + &leitura_bit + ); + }else{ + leitura_bit = entradasDigitais[this->alarms[alarmIndex].regModbusRead]; + } if(leitura_bit == value_bit){ this->alarms[alarmIndex].secAlarm++; if(this->alarms[alarmIndex].secAlarm >= this->alarms[alarmIndex].seconds){ @@ -1106,7 +1109,7 @@ endOfFile = feof(sdCard::devices.fp); if(!endOfFile){fgets(actString,1024,sdCard::devices.fp);} }while((strstr(actString,"actList")==NULL)&&(endOfFile==0)); - + pc.printf("Achei o actList.\r\n"); do{ endOfFile = feof(sdCard::devices.fp); if(!endOfFile){fgets(actString,1024,sdCard::devices.fp);}