Difference between revisions of "Read variable from a file"

From Proview Wiki
Jump to: navigation, search
(Created page with "<p>== Read a variable from a file ==<br /><br /><br />  pwrp@proview:~$ echo "Val=53 T=33 J23" > /tmp/textline.txt<br />  pwrp@proview:~$ pwra<br /><br />* Enter ...")
 
 
Line 1: Line 1:
<p>== Read a variable from a file ==<br /><br /><br />&nbsp; pwrp@proview:~$ echo "Val=53 T=33 J23" &gt; /tmp/textline.txt<br />&nbsp; pwrp@proview:~$ pwra<br /><br />* Enter edit mode from the menu 'Edit/Edit mode' (Ctrl+E).<br />* Create a ProjectReg object and enter project name "example1", base version "V4.8", path "/usr/local/pwrp/example1" and description "Read a file".<br />* The project is created when saving (Ctrl+S). First you have to confirm the changes.<br />* Close edit mode.<br />* Open project "example1"<br />* Next<br />* Next<br />* Next<br />* Next<br />* Next- Do you want edit volume? Yes<br />* Process Station, Next<br />* Next<br />* Next<br /><br /><br />In PwR VolExample1<br />* Enter edit mode from the menu 'Edit/Edit mode' (Ctrl+E).<br />* Insert OneWire object (Node &gt; IO &gt; OneWire) in Example1 $Node object(MB2)<br />* Change name to "FILES"<br />* Insert OneWire_AiDevice object (Node &gt; IO &gt; OneWire_AiDevice) in FILES OneWire object <br />* Change name (ObjectName) to "FILE"<br />* DataFile /tmp/textline.txt<br />* ValueSearchString&nbsp; "Val="<br />* ChAi -&gt; RawValRAngeLow=-100<br />* ChAi -&gt; RawValRAngeLow=100<br />* Insert $PlantHier object (Plant &gt; $PlantHier) in center box (MB2)<br />* Change name to "MyPlant"<br />* Insert Ai object (Plant &gt; Signals &gt; Ai) in MyPlant $PlantHier object <br />* Change name to "VAR"<br />* Connect the signal channel. Select ChAi (MB1), insert selected object on SigChanCon (SigChanCon=Nodes-Example1-FILES-FILE.ChAi).<br />* Set ScanTime=10 second in the PlcThead<br />* Ctrl+S<br />* Ctrl+E<br />* Shift+Ctrl+B<br />* Build node select "example1" Ok<br />* Open the Runtime Monitor<br />* Start Runtime<br />* File -&gt; Start Run time Navigator<br />* Open Object Graph VAR Ai (Database, MyPlant, MB3 on VAR, Object Graph)<br /><br /></p>
+
<p><br />&nbsp; pwrp@proview:~$ echo "Val=53 T=33 J23" &gt; /tmp/textline.txt<br />&nbsp; pwrp@proview:~$ pwra<br /><br />* Enter edit mode from the menu 'Edit/Edit mode' (Ctrl+E).<br />* Create a ProjectReg object and enter project name "example1", base version "V4.8", path "/usr/local/pwrp/example1" and description "Read a file".<br />* The project is created when saving (Ctrl+S). First you have to confirm the changes.<br />* Close edit mode.<br />* Open project "example1"<br />* Next<br />* Next<br />* Next<br />* Next<br />* Next- Do you want edit volume? Yes<br />* Process Station, Next<br />* Next<br />* Next<br /><br /><br />In PwR VolExample1<br />* Enter edit mode from the menu 'Edit/Edit mode' (Ctrl+E).<br />* Insert OneWire object (Node &gt; IO &gt; OneWire) in Example1 $Node object(MB2)<br />* Change name to "FILES"<br />* Insert OneWire_AiDevice object (Node &gt; IO &gt; OneWire_AiDevice) in FILES OneWire object <br />* Change name (ObjectName) to "FILE"<br />* DataFile /tmp/textline.txt<br />* ValueSearchString&nbsp; "Val="<br />* ChAi -&gt; RawValRAngeLow=-100<br />* ChAi -&gt; RawValRAngeLow=100<br />* Insert $PlantHier object (Plant &gt; $PlantHier) in center box (MB2)<br />* Change name to "MyPlant"<br />* Insert Ai object (Plant &gt; Signals &gt; Ai) in MyPlant $PlantHier object <br />* Change name to "VAR"<br />* Connect the signal channel. Select ChAi (MB1), insert selected object on SigChanCon (SigChanCon=Nodes-Example1-FILES-FILE.ChAi).<br />* Set ScanTime=10 second in the PlcThead<br />* Ctrl+S<br />* Ctrl+E<br />* Shift+Ctrl+B<br />* Build node select "example1" Ok<br />* Open the Runtime Monitor<br />* Start Runtime<br />* File -&gt; Start Run time Navigator<br />* Open Object Graph VAR Ai (Database, MyPlant, MB3 on VAR, Object Graph)<br /><br /></p>

Latest revision as of 06:31, 6 August 2013


  pwrp@proview:~$ echo "Val=53 T=33 J23" > /tmp/textline.txt
  pwrp@proview:~$ pwra

* Enter edit mode from the menu 'Edit/Edit mode' (Ctrl+E).
* Create a ProjectReg object and enter project name "example1", base version "V4.8", path "/usr/local/pwrp/example1" and description "Read a file".
* The project is created when saving (Ctrl+S). First you have to confirm the changes.
* Close edit mode.
* Open project "example1"
* Next
* Next
* Next
* Next
* Next- Do you want edit volume? Yes
* Process Station, Next
* Next
* Next


In PwR VolExample1
* Enter edit mode from the menu 'Edit/Edit mode' (Ctrl+E).
* Insert OneWire object (Node > IO > OneWire) in Example1 $Node object(MB2)
* Change name to "FILES"
* Insert OneWire_AiDevice object (Node > IO > OneWire_AiDevice) in FILES OneWire object
* Change name (ObjectName) to "FILE"
* DataFile /tmp/textline.txt
* ValueSearchString  "Val="
* ChAi -> RawValRAngeLow=-100
* ChAi -> RawValRAngeLow=100
* Insert $PlantHier object (Plant > $PlantHier) in center box (MB2)
* Change name to "MyPlant"
* Insert Ai object (Plant > Signals > Ai) in MyPlant $PlantHier object
* Change name to "VAR"
* Connect the signal channel. Select ChAi (MB1), insert selected object on SigChanCon (SigChanCon=Nodes-Example1-FILES-FILE.ChAi).
* Set ScanTime=10 second in the PlcThead
* Ctrl+S
* Ctrl+E
* Shift+Ctrl+B
* Build node select "example1" Ok
* Open the Runtime Monitor
* Start Runtime
* File -> Start Run time Navigator
* Open Object Graph VAR Ai (Database, MyPlant, MB3 on VAR, Object Graph)

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox