Powervision 2.9, the latest beta.
Using some guid values in angelscript and ran into some behavior I am having a hard time figuring out.
I am Packing a List table with variable GUID's, and then pulling them out in a smRead loop to update the List table.
The table has GUID defined as int32, and is the GUID column is packed with something like,
Code: Select all
VariableIDs.MB1_Low_SysVar_1_Alarm;
Code: Select all
//get the length of the list for indexing purposes
int length = ListManagerGetCount(ListDataType.Menu_List);
int index = 0;
//Temporary holding variables for performing lookups and updates
int32 variable_guid = 0;
float variable_value = 0;
float list_value = 0;
//declare a class to hold the retrieved information
CustomListData data;
//Loop through the list and update a row when the current list value does not match the variable values in PowerVision folders etc.
while (index < length)
{
//Get the list row
ListManagerGetItem(ListDataType.Menu_List, index, data);
//Get the list row's Variable GUID value
variable_guid = data.ReadInt32(CustomListColumn.Menu_List_Guid);
//Get the list row's variable value
list_value = data.ReadFloat(CustomListColumn.Menu_List_variable);
//Lookup current variable GUID value
smRead(variable_guid, variable_value);
//Compare current variable value to the value in the list, if different update list
if(variable_value != list_value)
{
data.WriteFloat(CustomListColumn.Menu_List_variable, variable_value);
ListManagerSetItem(ListDataType.Menu_List, index, data);
}
index = index + 1;
}
Code: Select all
PrintNumber(variable_guid);
PrintNumber(VariableIDs.MB1_Low_SysVar_1_Alarm);
1145143296
1052
and if I do,
Code: Select all
smRead(variable_guid, variable_value); // Returns 0
smRead(1145143296, variable_value); // Returns 0
smRead(variableIDs.MB1_Low_SysVar_1_Alarm, variable_value); // Returns a true value
smRead(1052, variable_value); // Returns a true value