You need to sign in or sign up before continuing.
Commit f612b836 authored by Pavel Vainerman's avatar Pavel Vainerman

fixed bug: don`t send DO,AO values

parent c58f3217
...@@ -61,6 +61,8 @@ activated(false) ...@@ -61,6 +61,8 @@ activated(false)
if( !speed.empty() ) if( !speed.empty() )
mb->setSpeed(speed); mb->setSpeed(speed);
mb->setLog(dlog);
if( recv_timeout > 0 ) if( recv_timeout > 0 )
mb->setTimeout(recv_timeout); mb->setTimeout(recv_timeout);
...@@ -431,9 +433,7 @@ void RTUExchange::poll() ...@@ -431,9 +433,7 @@ void RTUExchange::poll()
switch(it->mbfunc) switch(it->mbfunc)
{ {
case fnWriteOutputSingleRegister: case fnWriteOutputSingleRegister:
{
WriteSingleOutputRetMessage ret = mb->write06( it->mbaddr,it->mbreg,d); WriteSingleOutputRetMessage ret = mb->write06( it->mbaddr,it->mbreg,d);
}
break; break;
case fnWriteOutputRegisters: case fnWriteOutputRegisters:
...@@ -801,8 +801,8 @@ void RTUExchange::askSensors( UniversalIO::UIOCommand cmd ) ...@@ -801,8 +801,8 @@ void RTUExchange::askSensors( UniversalIO::UIOCommand cmd )
if( it->stype != UniversalIO::DigitalOutput && it->stype != UniversalIO::AnalogOutput ) if( it->stype != UniversalIO::DigitalOutput && it->stype != UniversalIO::AnalogOutput )
continue; continue;
if( it->safety == NoSafetyState ) // if( it->safety == NoSafetyState )
continue; // continue;
try try
{ {
...@@ -826,12 +826,12 @@ void RTUExchange::sensorInfo( UniSetTypes::SensorMessage* sm ) ...@@ -826,12 +826,12 @@ void RTUExchange::sensorInfo( UniSetTypes::SensorMessage* sm )
if( it->si.id == sm->id ) if( it->si.id == sm->id )
{ {
if( it->stype == UniversalIO::DigitalOutput ) if( it->stype == UniversalIO::DigitalOutput ) // || it->stype == UniversalIO::DigitalInput )
{ {
uniset_spin_lock lock(it->val_lock); uniset_spin_lock lock(it->val_lock);
it->value = sm->state ? 1 : 0; it->value = sm->state ? 1 : 0;
} }
else if( it->stype == UniversalIO::AnalogOutput ) else if( it->stype == UniversalIO::AnalogOutput ) // || it->stype == UniversalIO::AnalogInput )
{ {
uniset_spin_lock lock(it->val_lock); uniset_spin_lock lock(it->val_lock);
it->value = sm->value; it->value = sm->value;
...@@ -867,8 +867,8 @@ void RTUExchange::sigterm( int signo ) ...@@ -867,8 +867,8 @@ void RTUExchange::sigterm( int signo )
RSMap::iterator it=rsmap.begin(); RSMap::iterator it=rsmap.begin();
for( ; it!=rsmap.end(); ++it ) for( ; it!=rsmap.end(); ++it )
{ {
if( it->stype!=UniversalIO::DigitalOutput && it->stype!=UniversalIO::AnalogOutput ) // if( it->stype!=UniversalIO::DigitalOutput && it->stype!=UniversalIO::AnalogOutput )
continue; // continue;
if( it->safety == NoSafetyState ) if( it->safety == NoSafetyState )
continue; continue;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment