Touble with Driver transform Class

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
3 posts • Page 1 of 1
CyaNn
Posts:97
Joined: Tue Nov 23, 2010 9:48 am

Touble with Driver transform Class

Post by CyaNn »

Hello everyone,

I am developping a Serial/Modbus driver for WinCC and I experienced a little problem with Transform class.

I have created a TransformCoil specialized class to transform bit from Modbus to database and reciprocally

In fact, the method TransformCoil::toVar is never called, and the datapoint is never updated.
Where am I doing something wrong in my code:

Code: Select all

HWObject* SerialModbusHWService::storeToDB(QString address, PVSSchar *value) {
	HWObject *obj = new HWObject();
	obj->setDlen(sizeof(value));

	obj->setType((TransformationType)DriverTypes::COILS);
	obj->setAddress(address.toStdString().data());
	obj->setData(value);

	HWMapper* mapper = (HWMapper*)DrvManager::getHWMapperPtr();
	if ( mapper ) {
		HWObject* addrObj = mapper->findHWObject(obj);

		if ( addrObj ) {
			try {
				DrvManager::getSelfPtr()->toDp(obj, addrObj);
				// optional, to send it now !!!!
				//DrvManager::getSelfPtr()->sendData2Dp();
				DEBUG_DRV_USR2("Message stored to DB " getAddress()

CyaNn
Posts:97
Joined: Tue Nov 23, 2010 9:48 am

Re: Touble with Driver transform Class

Post by CyaNn »

I have these messages at the starting up of the driver:

Code: Select all

PVSS00event  (0), 2014.12.08 11:27:28.308, SYS,  WARNING,    65, Wrong destination address, (SYS: 1 Driver -num 4 CONN: 1(R)), DP_MSG_SIMPLE_REQUEST
PVSS00event  (0), 2014.12.08 11:27:28.308, SYS,  WARNING,    65, Wrong destination address, (SYS: 1 Driver -num 4 CONN: 1(R)), DP_MSG_SIMPLE_REQUEST
PVSS00ui     (1), 2014.12.08 11:27:28.308, SYS,  SEVERE,     38, Message could not be sent, DP: ISup_G:Modbus.Coils.001:_address.._type, MAN: (SYS: 1 Driver -num 4 CONN: 1(R)), Could not send message DP_MSG_SIMPLE_REQUEST #809
PVSS00ui     (1), 2014.12.08 11:27:28.308, SYS,  SEVERE,     38, Message could not be sent, DP: ISup_G:Modbus.Coils.001:_msg_conv.._type, MAN: (SYS: 1 Driver -num 4 CONN: 1(R)), Could not send message DP_MSG_SIMPLE_REQUEST #809
PVSS00ui     (1), 2014.12.08 11:27:28.308, SYS,  SEVERE,     38, Message could not be sent, DP: ISup_G:Modbus.Coils.001:_cmd_conv.._type, MAN: (SYS: 1 Driver -num 4 CONN: 1(R)), Could not send message DP_MSG_SIMPLE_REQUEST #809
PVSS00ui     (1), 2014.12.08 11:27:28.308, SYS,  SEVERE,     38, Message could not be sent, DP: ISup_G:Modbus.Coils.001:_smooth.._type, MAN: (SYS: 1 Driver -num 4 CONN: 1(R)), Could not send message DP_MSG_SIMPLE_REQUEST #809

CyaNn
Posts:97
Joined: Tue Nov 23, 2010 9:48 am

Re: Touble with Driver transform Class

Post by CyaNn »

OK! I have found my mistake.
I had hidden the para address direction config. So it was setted to output and not input by default.
Thuse, the driver could not write in the database.
Great ! I will continue. :lol:

3 posts • Page 1 of 1