Hello,
I have two questions:
1. how can I edit the BitAddr of a variable (see remark in code below)?
2. how to access properties of Variable.SubItem?
i.e. zVar.SubItemName(inc) is working, but zVar.SubItem(inc).Name throws an exception saying: "Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt."
same with zVar.SubItem(inc).BitAddr = 1;
please look at this code:
Code:
zenOn.IVariable zVar = myVariables.CreateArrayVarEx(VarName, zDriver, kanalType, zVarType, editedStartIdx, idxEnd, 0, 0, 0, true);
if (zVar != null)
{
zVar.NetAddr = netAddress;
zVar.DataBlock = dataBlock;
zVar.Offset = Offset;
//setting BitAddress ist not possible, Exception = "Beim Aufruf einer COM-Komponente wurde ein HRESULT E_FAIL-Fehler zurückgegeben."
zVar.BitAddr = BitAddr;
for (int inc = 0; inc < zVar.SubItemCount(); inc++)
{
zVar.ActivateSubItem(inc);
}
}