Before commenting read Forum rules
Don't comment the topic if you have a new question.
You can create a new topic selecting correct category from Gurux Forum and then create a new topic selecting "New Topic" from the top left.
Before commenting read Forum rules
Don't comment the topic if you have a new question.
You can create a new topic selecting correct category from Gurux Forum and then create a new topic selecting "New Topic" from the top left.
Hi,
I'm testing the DLMS.AMI solution with the GXDLMSDirectory.
Whenever I try to capture and view the Profile Generic data I get a cast exception after refreshing the view:
System.InvalidCastException: Unable to cast object of type 'Gurux.DLMS.GXDLMSMeter' to type 'Gurux.DLMS.AMI.Messages.DB.GXDevice'.
at Gurux.DLMS.AMI.UI.GXDlmsAmi.GetRowsByRange(GXDLMSMeterBase device, GXDLMSProfileGeneric pg, DateTime start, DateTime end)
at GXDLMSDirector.MainForm.Refresh(Object sender, GXAsyncWork work, Object[] parameters)
System.InvalidCastException: Unable to cast object of type 'Gurux.DLMS.GXDLMSMeter' to type 'Gurux.DLMS.AMI.Messages.DB.GXDevice'.
at Gurux.DLMS.AMI.UI.GXDlmsAmi.GetRowsByRange(GXDLMSMeterBase device, GXDLMSProfileGeneric pg, DateTime start, DateTime end)
at GXDLMSDirector.MainForm.Refresh(Object sender, GXAsyncWork work, Object[] parameters)
System.InvalidCastException: Unable to cast object of type 'Gurux.DLMS.GXDLMSMeter' to type 'GXDLMSDirector.GXDLMSDevice'.
at GXDLMSDirector.MainForm.UpdateDescriptionsMenu_Click(Object sender, EventArgs e)
System.InvalidCastException: Unable to cast object of type 'Gurux.DLMS.GXDLMSMeter' to type 'Gurux.DLMS.AMI.Messages.DB.GXDevice'.
at Gurux.DLMS.AMI.UI.GXDlmsAmi.GetRowsByRange(GXDLMSMeterBase device, GXDLMSProfileGeneric pg, DateTime start, DateTime end)
at GXDLMSDirector.MainForm.Refresh(Object sender, GXAsyncWork work, Object[] parameters)
System.InvalidCastException: Unable to cast object of type 'Gurux.DLMS.GXDLMSMeter' to type 'Gurux.DLMS.AMI.Messages.DB.GXDevice'.
at Gurux.DLMS.AMI.UI.GXDlmsAmi.GetRowsByRange(GXDLMSMeterBase device, GXDLMSProfileGeneric pg, DateTime start, DateTime end)
at GXDLMSDirector.MainForm.Refresh(Object sender, GXAsyncWork work, Object[] parameters)
System.InvalidCastException: Unable to cast object of type 'Gurux.DLMS.GXDLMSMeter' to type 'Gurux.DLMS.AMI.Messages.DB.GXDevice'.
at Gurux.DLMS.AMI.UI.GXDlmsAmi.GetRowsByRange(GXDLMSMeterBase device, GXDLMSProfileGeneric pg, DateTime start, DateTime end)
at GXDLMSDirector.MainForm.Refresh(Object sender, GXAsyncWork work, Object[] parameters)
System.InvalidCastException: Unable to cast object of type 'Gurux.DLMS.GXDLMSMeter' to type 'Gurux.DLMS.AMI.Messages.DB.GXDevice'.
at Gurux.DLMS.AMI.UI.GXDlmsAmi.GetRowsByRange(GXDLMSMeterBase device, GXDLMSProfileGeneric pg, DateTime start, DateTime end)
at GXDLMSDirector.MainForm.Refresh(Object sender, GXAsyncWork work, Object[] parameters)
System.InvalidCastException: Unable to cast object of type 'Gurux.DLMS.GXDLMSMeter' to type 'Gurux.DLMS.AMI.Messages.DB.GXDevice'.
at Gurux.DLMS.AMI.UI.GXDlmsAmi.GetRowsByRange(GXDLMSMeterBase device, GXDLMSProfileGeneric pg, DateTime start, DateTime end)
at GXDLMSDirector.MainForm.Refresh(Object sender, GXAsyncWork work, Object[] parameters)
System.InvalidCastException: Unable to cast object of type 'Gurux.DLMS.GXDLMSMeter' to type 'Gurux.DLMS.AMI.Messages.DB.GXDevice'.
at Gurux.DLMS.AMI.UI.GXDlmsAmi.GetRowsByRange(GXDLMSMeterBase device, GXDLMSProfileGeneric pg, DateTime start, DateTime end)
at GXDLMSDirector.MainForm.Refresh(Object sender, GXAsyncWork work, Object[] parameters)
This happens after the ObjectController returns the ListObjectResponse.
{SELECT GXObject.`Id`, GXObject.`DeviceId`, GXObject.`TemplateId`, GXObject.`Version`, GXObject.`ObjectType`, GXObject.`Name`, GXObject.`LogicalName`, GXObject.`ShortName`, GXObject.`Generation`, GXObject.`Updated`, GXObject.`Removed`, GXObject.`ExtraInfo`, GXAttribute.`Id`, GXAttribute.`ObjectId`, GXAttribute.`TemplateId`, GXAttribute.`Index`, GXAttribute.`Name`, GXAttribute.`Value`, GXAttribute.`Generation`, GXAttribute.`Updated`, GXAttribute.`Read`, GXAttribute.`TaskId`, GXAttribute.`ExpirationTime`, GXAttribute.`Removed`, GXAttribute.`AccessLevel`, GXAttribute.`Exception`, GXAttribute.`DataType`, GXAttribute.`UIDataType`, GXAttribute.`ExtraInfo` FROM GXObject INNER JOIN GXAttribute ON GXObject.`Id`=GXAttribute.`ObjectId`}
{WHERE ((((GXObject.`Removed` = '0001-01-01 00:00:00') AND (GXObject.`ObjectType` = 7)) AND (UPPER(GXObject.`LogicalName`) LIKE('0.0.98.1.0.126'))) AND (GXAttribute.`Removed` = '0001-01-01 00:00:00') AND (GXObject.`DeviceId` IN (SELECT `DeviceId` FROM GXObject WHERE GXObject.`DeviceId` = 1)))}
Br Mikael