PCSDB Custom Variables
Previous Topic  Next Topic 


Custom Defined PCSDB Variables


The PCSDB Custom Variables can be used to track a few different types of data. The amount of time since a variable has changed can be tracked, the current value of a variable, historical data for a variable, and the color indicators based on the value of a variable, which will soon be used in conjunction with the RTV.   PCSDB Custom variables can be defined in the DataXchange tab under the Variable button. These variables can be added here to be utilized in Custom Commands.


Custom variable values and indicators can be displayed in the RTV Grid or with an ODI screen.  More information Here and Here.



Setting Custom Variables


PCSDB Custom Variables are set when using the Send variables in the Target.  For example, let us say that we want to use a custom variable to display the current value of the coolant level in an MTConnect enabled piece of equipment.


The following expression could be used in the Result.

PCSDB.send_custom_variable_value{coolant_level} == MTC.coolant_level


Note that a single equal sign is used to compare the variable to a value and will result in a True or False statement. A double equal sign is used to set the variable to the associated value.


In some cases you may want to send a custom variable that has two parameters. In that case you will need to inclose the variables in parenthesis.  


The following expression could be used in the Result.

[PCSDB.send_save_custom_variable_value] {pad_probe_delta}==([Focas.macro_variable] {584})



Variables

Description

Send Custom Variable Value

PCSDB.send_custom_variable_value{variableName}

This will set the value of the associated variable name to a value if a value is provided and set the time stamp for the variable to the current time.  If a value is not provided then the value will be set to Null and only the time stamp will be updated.

Send Custom Variable Indicator

PCSDB.send_custom_variable_indicator{variableName}

This will set the indicator of the associated variable name to the color provided.



When send_custom_variable_value is used in the Target field, the associated variable will be updated with the new value that it is being set to and the Time Stamp will be updated with the current time when the associated expression becomes true.  If send_custom_variable_value is used in the Target field and a value is not provided then the value of the variable will be set to Null, but the Time Stamp will still be updated.


Additionally, it may be necessary to add double parenthesis in an expression that uses parameters on both side of the operation. AN example of this would be:


This ...


([PCSDB.custom_variable_time] {equipment_connect_time} > [PCSDB.prev_custom_variable_time] {equipment_connect_time}) 



… becomes this …


(([PCSDB.custom_variable_time] {equipment_connect_time}) > ([PCSDB.prev_custom_variable_time] {equipment_connect_time})) 



The Gold level Custom Variable Target variables work the same as the Silver level variables with one addition, and that is that all of the data is kept.  This would allow not only the current value to be displayed, but it would also allow historical values to be displayed in a trend chart or analyzed for patterns.



Variables

Description

Send and Save Custom Variable Value

PCSDB.send_save_custom_variable_value{variableName}

This will set the value of the associated variable name to a value if a value is provided and set the time stamp for the variable to the current time.  If a value is not provided then the value will be set to Null and only the time stamp will be updated.  If a value is provided then the data will be stored for historical purposes.

Send Custom Variable Indicator

PCSDB.send_save_custom_variable_indicator{variableName}

This will set the indicator of the associated variable name to the color provided.  The data will be stored for historical purposes.




Reading Custom Variables


Once custom variables have been set, the following Silver level variables can be used in expressions for a variety of purposes.  These variables are used in Expressions and they will hold the most recent information set by the Send variables.



Variables

Description

Custom Variable Value

PCSDB.custom_variable_value{variableName}

This will hold the a value that was sent to the associated variable name. 

Custom Variable Current Time

PCSDB.custom_variable_time{variableName}

This will hold the time at while the variable value was last set.

Custom Variable Indicator

PCSDB.custom_variable_indicator{variableName}

This will hold the name of a color that was sent to the associated variable name.



See the examples listed below.

Example 1

Example 2