API Driver on 3.17. method toVar is not called when the subindex is not zero

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
Search

Post Reply
2 posts • Page 1 of 1
Victor.Ermakov
Posts: 25
Joined: Fri Oct 20, 2017 8:50 am

API Driver on 3.17. method toVar is not called when the subindex is not zero

Post by Victor.Ermakov »

a virtual Method toVar implented from class Transformation:

Code: Select all

VariablePtr KSKD_set4tmTrans::toVar(const PVSSchar *_buffer, const PVSSushort _dlen,
                                   const PVSSushort subix) const
{
	DEBUG_WORK("toVar:Start")
	DEBUG_WORK("toVar:dlen="<< _dlen<<";subix="<< subix<<";transType="<< transType)
...
}
When a Para config _subindex is zero log is as described below:
WCCOAKSKD_set4tmDrv31:WCCOAKSKD_set4tmDrv(31), 2020.12.01 15:43:37.815, WORK, "processData2Dp called: startix = 0; nofElements = 1 at 2020.12.01 15:43:37.815"
WCCOAKSKD_set4tmDrv31:WCCOAKSKD_set4tmDrv(31), 2020.12.01 15:43:37.819, WORK, "convert2Ing called for (Type: 293 Sys: 101 Dp: 3447 El: 140 : _address..)"
WCCOAKSKD_set4tmDrv31:WCCOAKSKD_set4tmDrv(31), 2020.12.01 15:43:37.821, WORK, toVar:Start
WCCOAKSKD_set4tmDrv31:WCCOAKSKD_set4tmDrv(31), 2020.12.01 15:43:37.822, WORK, toVar:dlen=2;subix=0;transType=1001


When a Para config _subindex is not zero (example 1) log is as described below:
WCCOAKSKD_set4tmDrv31:WCCOAKSKD_set4tmDrv(31), 2020.12.01 15:56:12.857, WORK, "processData2Dp called: startix = 0; nofElements = 1 at 2020.12.01 15:56:12.857"

how to using of _subindex?

Victor.Ermakov
Posts: 25
Joined: Fri Oct 20, 2017 8:50 am

Re: API Driver on 3.17. method toVar is not called when the subindex is not zero

Post by Victor.Ermakov »

How to using subindex to read dyn types values in toVar method?
I configured subindex with value 1, but toVar called twice with subindex=0, and after with subindex=1.

In implemeted addDpPa method of HWMapper runned this code:

Code: Select all

  // Set Address and Subindex
  hwObj->setConnectionId(confPtr->getConnectionId());
  hwObj->setAddress(confPtr->getName());       // Resolve the HW-Address, too
  hwObj->setSubindex(confPtr->getSubindex());
  DEBUG_WORK("addDpPa:confPtr->getSubindex():"<< confPtr->getSubindex())
  hwObj->setNumberOfElements(confPtr->getTransform()->getNumberOfElements());

  // Set the data type.
  hwObj->setType(confPtr->getTransform()->isA());

  // Set the len needed for data from _all_ subindices of this PVSS-Address.
  // Because we will deal with subix 0 only this is the Transformation::itemSize
  hwObj->setDlen(confPtr->getTransform()->itemSize());
In "whilecycle" of implemeted groupQuery method of HWService I called setNumberOfElements with value 2.
Dlen and itemSize allow to fit NumberOfElements.


I planed to return in toVar the dyn type value. First item of dyn type value i want to set using subindex (example 0, 1 or 2 ..), next values by using subindex+1, etc

Post Reply
2 posts • Page 1 of 1