async setGeneralPackMLMode(value: GeneralPackMLMode): Promise<CallMethodResult> {
const objectId = new NodeId(2, '::UnitMachin', 6);
const methodId = new NodeId(NodeIdType.STRING, '::UnitMachin:setModePackML', 6);
const parameter = new Variant({
dataType: DataType.UInt32,
value: value
});
return this.session.call({
inputArguments: [parameter],
objectId,
methodId,
});
}
CallMethodResult {
statusCode: ConstantStatusCode {
_value: 2158690304,
_description: 'One or more arguments are invalid.',
_name: 'BadInvalidArgument'
},
inputArgumentResults: [
ConstantStatusCode {
_value: 2155085824,
_description: "The value supplied for the attribute is not of the same type as the attribute's value.",
_name: 'BadTypeMismatch'
}
],
inputArgumentDiagnosticInfos: [],
outputArguments: []
}
I still get an error.
OK are you saying that
const parameter = new Variant({
dataType: DataType.UInt32,
value: value
});
Is not the correct definition?
async getGeneralPackMLMode(): Promise<DataValue> {
return await this.session.read({
nodeId: new NodeId(NodeIdType.NUMERIC, 180, 6),
attributeId: AttributeIds.DataType
});
}
DataValue {
value: Variant { dataType: 0, arrayType: 0, value: null, dimensions: null },
statusCode: ConstantStatusCode {
_value: 2150957056,
_description: 'The attribute is not supported for the specified Node.',
_name: 'BadAttributeIdInvalid'
},
sourceTimestamp: null,
sourcePicoseconds: 0,
serverTimestamp: 2022-08-26T15:17:47.617Z {
high_low: [ 30980446, -4282142 ],
picoseconds: 917000000
},
serverPicoseconds: 917000000
}
DataValue {
value: Variant { dataType: 0, arrayType: 0, value: null, dimensions: null },
statusCode: ConstantStatusCode {
_value: 2150957056,
_description: 'The attribute is not supported for the specified Node.',
_name: 'BadAttributeIdInvalid'
},
sourceTimestamp: null,
sourcePicoseconds: 0,
serverTimestamp: 2022-08-26T15:21:08.710Z {
high_low: [ 30980447, 2006644838 ],
picoseconds: 615000000
},
serverPicoseconds: 615000000
}
DataValue {
value: Variant { dataType: 0, arrayType: 0, value: null, dimensions: null },
statusCode: ConstantStatusCode {
_value: 2150957056,
_description: 'The attribute is not supported for the specified Node.',
_name: 'BadAttributeIdInvalid'
},
sourceTimestamp: null,
sourcePicoseconds: 0,
serverTimestamp: 2022-08-26T15:22:15.452Z {
high_low: [ 30980447, -1620898998 ],
picoseconds: 961000000
},
serverPicoseconds: 961000000
}