Powervision Variables have the following user configured features.
Data Invalid
Use this setting if the variable is expected to be periodically updated as in the case of a received CAN variable. If the variable is not refreshed within the allowable time the value will go invalid (Not a Number).
You can use this on the display to change a widget to a different color to alert the user. This is found in the widgets data error property.
Use the function IsValid() to test the variable in a calculation event, Activity Program, Scripting, or an expression.
In Scripting use the Library Function smRead which returns a Boolean, to test if a variable is valid. If it is valid, "true" is returned.
if (smRead(VariableIDs.MyCANvariable, tempVariable))
{
Valid condition - Do some work
}
Saving Variables in Non Volatile Memory (Persistent and Retained Variables)
Variables can be set to retain their value after a power cycle or after the display has been reprogrammed as in the example of an odometer.
Select the desired type then use the action NVmgr->Save-Variable Name to save the value to Flash memory. Writing to Flash memory consumes a lot of resources so be mindful of that when calling this function. Typically memory saves would be conducted as a response to a menu operation.
Note: This only works on Double data types.
Monochrome Limitations:
Variables are saved to EEPROM on the Monochrome platforms, to preserve it life span limitations are applied. During each power up cycle only 250 writes are allowed irrespective of time.
Once the 250 count is reached then every 6 minutes the count is decremented by one.
This throttles the writes to just one every 6 minutes once you reach the initial count of 250.
When you use the individual variable save action that means every six minutes just one variable will get saved and the counter will immediately go back to 250 and the 6 minute counter will start over. Only that one variable will ever get saved.
Simulation Mode/ Test Mode
When the display is in simulation mode or when a Calculation Event is in test mode the min and max values are derived from the variables settings.
Set the desired min and max as well as the step size, this applies to any variable.
Simulation mode can be entered by setting the system variable Setting.SimData to a value of 1. Use this mode for demonstrations or to check the UI design in dynamic mode.
Comments
0 comments
Please sign in to leave a comment.