Commit 6349baca authored by Pasha's avatar Pasha

I2,U2 MBTCPMaster

parent 2da0b071
......@@ -3,7 +3,7 @@
Name: libuniset
Version: 0.99
Release: eter2
Release: eter4
Summary: UniSet - library for building distributed industrial control systems
License: GPL
Group: Development/C++
......@@ -184,6 +184,12 @@ rm -f %buildroot%_libdir/*.la
%exclude %_pkgconfigdir/libUniSet.pc
%changelog
* Fri Sep 17 2010 Pavel Vainerman <pv@etersoft.ru> 0.99-eter3
- add new value types (I2,U2) in to MBTCPMaster
* Fri Sep 17 2010 Pavel Vainerman <pv@etersoft.ru> 0.99-eter2
- build for new MBSlave
* Tue Sep 14 2010 Pavel Vainerman <pv@altlinux.ru> 0.99-eter1
- test UDP build
......
......@@ -1878,6 +1878,50 @@ void MBTCPMaster::updateRSProperty( RSProperty* p, bool write_only )
IOBase::processingFasAI( p, (float)f, shm, force );
}
}
else if( p->vType == VTypes::vtI2 )
{
RegMap::iterator i(p->reg->rit);
if( save && r->mb_init )
{
long v = IOBase::processingAsAO( p, shm, force_out );
VTypes::I2 i2(v);
for( int k=0; k<VTypes::I2::wsize(); k++, i++ )
i->second->mbval = i2.raw.v[k];
}
else
{
ModbusRTU::ModbusData* data = new ModbusRTU::ModbusData[VTypes::I2::wsize()];
for( int k=0; k<VTypes::I2::wsize(); k++, i++ )
data[k] = i->second->mbval;
VTypes::I2 i2(data,VTypes::I2::wsize());
delete[] data;
IOBase::processingAsAI( p, (int)i2, shm, force );
}
}
else if( p->vType == VTypes::vtU2 )
{
RegMap::iterator i(p->reg->rit);
if( save && r->mb_init )
{
long v = IOBase::processingAsAO( p, shm, force_out );
VTypes::U2 u2(v);
for( int k=0; k<VTypes::U2::wsize(); k++, i++ )
i->second->mbval = u2.raw.v[k];
}
else
{
ModbusRTU::ModbusData* data = new ModbusRTU::ModbusData[VTypes::U2::wsize()];
for( int k=0; k<VTypes::U2::wsize(); k++, i++ )
data[k] = i->second->mbval;
VTypes::U2 u2(data,VTypes::U2::wsize());
delete[] data;
IOBase::processingAsAI( p, (unsigned int)u2, shm, force );
}
}
}
catch(IOController_i::NameNotFound &ex)
{
......
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