User Tools

Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
get_access_to_registers [2019/01/09 10:27]
akuzmuk
get_access_to_registers [2019/07/05 15:43]
emozolyak
Line 41: Line 41:
   * warning   * warning
   * alert   * alert
 +
 +==== SetReg(variable_name[,​connection_name],​ new_value) ====
 +The SetReg function sets the current value of the register with the name of the variable **variable_name** to **new_value** for the current scan. This function **DOES NOT** send new value to external devices. When polling this register in subsequent cycles, the old value will be read. 
 +
 +Function returns 1 if an error occurred and 0 on success.
 +
 +The parameters **variable_name** and **connection_name** work just like in the GetReg function. Since version 3.2 there is no more **connection_name** parameter.
 +
 +
 +==== WriteReg(variable_name[,​ connection_name],​ new_value) ====
 +The WriteReg function sets the current value of the register with the name of the variable **variable_name** (optionally you can specify the connection **connection_name**) to provided **new_value** for the current scan and writes this value to the external device in the beginning of the next cycle. When polling this register in subsequent scans, a new value will be read (if it was not changed by the device itself). ​
 +
 +Function returns 1 if any error occurred and 0 on success.
 +
 +The parameters **variable_name** and **connection_name** work just like in the GetReg function. Since version 3.2 there is no more **connection_name** parameter.
 +
 +===== Getting register'​s values stored in a log =====
  
 ==== GetRegFromLog(variable_name,​ query_parameters) ==== ==== GetRegFromLog(variable_name,​ query_parameters) ====
Line 99: Line 116:
  
  
-==== SetReg(variable_name[,​connection_name],​ new_value) ==== 
-The SetReg function sets the current value of the register with the name of the variable **variable_name** to **new_value** for the current scan. This function **DOES NOT** send new value to external devices. When polling this register in subsequent cycles, the old value will be read.  
- 
-Function returns 1 if an error occurred and 0 on success. 
- 
-The parameters **variable_name** and **connection_name** work just like in the GetReg function. Since version 3.2 there is no more **connection_name** parameter. 
- 
- 
-==== WriteReg(variable_name[,​ connection_name],​ new_value) ==== 
-The WriteReg function sets the current value of the register with the name of the variable **variable_name** (optionally you can specify the connection **connection_name**) to provided **new_value** for the current scan and writes this value to the external device in the beginning of the next cycle. When polling this register in subsequent scans, a new value will be read (if it was not changed by the device itself). ​ 
- 
-Function returns 1 if any error occurred and 0 on success. 
- 
-The parameters **variable_name** and **connection_name** work just like in the GetReg function. Since version 3.2 there is no more **connection_name** parameter. 
- 
-==== ApplyRecipe(recipeId,​ userId) ==== 
-The **ApplyRecipe** function applies the recipe with the number **recipeId** on behalf of the user with id = **userId**. If this user does not have permissions for this recipe, the recipe will not be applied. ​ 
- 
-The application of the recipe is to write the corresponding values to the registers that are specified in the recipe. 
- 
-==== GetRecipeById(recipeId) ==== 
-The **GetRecipeById** function gets the recipe with the number **recipeId**. Function is available since WebHMI v 3.2. 
- 
-On success table with following fields will be returned: 
-  * id - Recipe Id 
-  * title - Recipe title 
-  * registers - table with Register Id as key and new value as value 
- 
-On error (recipe not found, etc) false will be returned. 
  
  

Page Tools