12-17-2012 09:16 AM
I am trying to read all the attributes from a Gige camera. I can get the attributes in I64, F64 and boolean fromat. But when the type is string or U32, the returned 'attribute' object is 'NULL". Can anyone let me know what's wrong with my code?
Thanks
object attribute = new object();
if(sType=="I64")
{
CWIMAQdx.GetAttribute(sid, attributeInformationArray[i].Name, CWIMAQdx.ValueType.I64, out attribute);
sValue =Convert.ToInt64(attribute).ToString();
}
if (sType == "String")
{
CWIMAQdx.GetAttribute(sid, "attributeInformationArray[i].Name", CWIMAQdx.ValueType.String, out attribute);
sValue =Convert.ToString(attribute);
}
if (sType == "U32")
{
CWIMAQdx.GetAttribute(sid, "attributeInformationArray[i].Name", CWIMAQdx.ValueType.U32, out attribute);
sValue =Convert.ToUInt32(attribute).ToString();
}
Solved! Go to Solution.
12-17-2012 01:06 PM
Is it just a coincidence that in your second two cases (that you mentioned aren't working) your example code appears to be passing the constant "attributeInformationArray[i].Name" rather than the actual attribute name?
Eric
12-17-2012 01:43 PM
Thanks for noticing the mistake of passing constant "attributeInformationArray[i].Name" rather than the actual attribute name.