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
en:sw:01-mervis:analog-inputs-hidden [2018/10/15 14:10]
mkudlacek
en:sw:01-mervis:analog-inputs-hidden [2021/08/05 12:22] (current)
avsetula [Introduction]
Line 1: Line 1:
 ====== Analog inputs ====== ====== Analog inputs ======
 +<WRAP group 100%>
 +<WRAP half column 81%>
 In this tutorial, we are going to demonstrated how to use different modes of analog inputs. In this tutorial, we are going to demonstrated how to use different modes of analog inputs.
 +</​WRAP>​
 +<WRAP half column 15%>
 +;;#
 +<​html><​span class="​dev-tag dev-patron">​Patron</​span></​html>​ \\
 +<​html><​span class="​dev-tag dev-neuron">​Neuron</​span></​html>​ \\
 +<​html><​span class="​dev-tag dev-axon">​Axon</​span></​html>​ \\
 +<​html><​span class="​dev-tag dev-extens">​Extension</​span></​html>​
 +;;#
 +</​WRAP>​
 +</​WRAP>​
  
-===== Prerequisites ​=====+<WRAP center round box> 
 +<​html><​span class="​kbBlue-H4alt">​Prerequisites</​span></​html>​
   * UniPi controller running Mervis OS   * UniPi controller running Mervis OS
   * Basic project with attached controller a program in FBD mode   * Basic project with attached controller a program in FBD mode
-  * [[https://​www.unipi.technology/​power-supplies-c15|24V power supply]]+  * [[https://​www.unipi.technology/​power-supplies-c15|24 V⎓ power supply]]
   * Knowledge of how the [[en:​automation:​02-glossary:​analog-inputs-hidden|analog inputs]] work on UniPi units   * Knowledge of how the [[en:​automation:​02-glossary:​analog-inputs-hidden|analog inputs]] work on UniPi units
  
-In this tutorial, we will use [[https://​www.unipi.technology/​unipi-neuron-l503-p105?​categoryId=10|Unipi Neuron ​L503]].+In this tutorial, we will use [[https://​www.unipi.technology/​cs/neuron-c2|Unipi Neuron]]. 
 +</​WRAP>​
  
 ===== Introduction ===== ===== Introduction =====
-The different analog inputs have different modes of operation, see [[en:​automation:​02-glossary:​analog-inputs-hidden|Analog inputs]]. Change between modes in Mervis is done by configuring the UniPi module, therefor the **changes in modes cannot be done in the program** and the program has to be stopped during the configuration.+The different analog inputs have different modes of operation, see [[en:​automation:​02-glossary:​analog-inputs-hidden|Analog inputs]]. Change between modes in Mervis is done by configuring the Unipi module, therefor the **changes in modes cannot be done in the program** and the program has to be stopped during the configuration.
  
-<WRAP center round info 60%>+<WRAP center round info 80%>
  The default mode of each input is "​Voltage"​.  The default mode of each input is "​Voltage"​.
 </​WRAP>​ </​WRAP>​
Line 20: Line 34:
 The changes are done on the prototype of the PLC or Extension. Double click on the prototype in the **Left panel**. The list of all available inputs and outputs will show up in the **Main Window**. Search for "​AI_"​ and you will be presented with the list of all Analog input. The changes are done on the prototype of the PLC or Extension. Double click on the prototype in the **Left panel**. The list of all available inputs and outputs will show up in the **Main Window**. Search for "​AI_"​ and you will be presented with the list of all Analog input.
  
-{{ :​en:​sw:​01-mervis:​analog-outputs-01-search-for-ao.png?direct |}}+{{ :​en:​sw:​01-mervis:​analog-inputs-01-search-for-ai.png?direct |}}
  
-As you can see, for each physical Analog input you have two properties available: AO_X.Y_r and AO_X.Y_w. The one with suffix _w is for writing the values to the output. You will use this variable almost exclusively. The property with suffix _r is for reading back the current value set on the output. ​To change the mode, select appropriate ​"​write" ​variable, head over to the **Properties panel** and select the desired mode in the "​Analog Type" property.+To change the mode, select appropriate variable ​from the list, head over to the **Properties panel** and select the desired mode in the "​Analog Type" property.
  
-{{ :​en:​sw:​01-mervis:​analog-outputs-02-change-type.png?​direct |}}+{{ :​en:​sw:​01-mervis:​analog-inputs-02-set-type.png?​direct |}}
  
-We just changed the configuration of the PLC, which is not applicable by simply uploading the solution To save the configuration, ​right click on the prototype in the **Left panel** and in the context menu click on "UniPi - Configure Module". The same procedure applies when changing modes of the Analog Output on the Extension.+We just changed the configuration of the PLC modules, which is not applicable by simply uploading the solutionTo save the configuration, ​follow ​the [[en:​sw:​01-mervis:​unipi-configure-module-hidden|UniPi - Configure Module]] tutorial.
  
-{{ :en:​sw:​01-mervis:​analog-outputs-03-configure-module.png?​direct ​|}}+===== Reading the input values ===== 
 +Reading the input values for all modes is the same. Once you set the correct mode, you can just simple read a real value from the variable. The variable is called AI_X.Y depending on the Group (number X) and the position in the group (number Y). To include this variable into the program, you need to **[[en:​sw:​01-mervis:​autogen-hidden|Set Autogen]]**. After that, you will see the variable in **Variable Browser** and you will be able to read it in the **Debugging** mode.
  
-<WRAP center round important 60%> +<WRAP center round info 80%> 
-During ​the configuration,​ the PLC will be switched to "​Commissioning ​mode"which means it will stop running ​the previously deployed solutionAfter the configuration, the PLC will return to its previous stateMake sure, that the connected technology ​is prepared for this blackout.+When reading ​the value of AO_X.Y in Voltage ​mode, the value is in volts (value 1.234 = 1.234 V⎓). When reading ​the value in Current mode, the value is in miliampers (value 3.145 = 3.145 mA). When reading ​the value in Resistance mode, tha value is in ohms (value 1012 = 1012 Ω)
 </​WRAP>​ </​WRAP>​