Difference between revisions of "Read variable from a file"
(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 | + | <p><br /> pwrp@proview:~$ echo "Val=53 T=33 J23" > /tmp/textline.txt<br /> 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 > IO > OneWire) in Example1 $Node object(MB2)<br />* Change name to "FILES"<br />* Insert OneWire_AiDevice object (Node > IO > OneWire_AiDevice) in FILES OneWire object <br />* Change name (ObjectName) to "FILE"<br />* DataFile /tmp/textline.txt<br />* ValueSearchString "Val="<br />* ChAi -> RawValRAngeLow=-100<br />* ChAi -> RawValRAngeLow=100<br />* Insert $PlantHier object (Plant > $PlantHier) in center box (MB2)<br />* Change name to "MyPlant"<br />* Insert Ai object (Plant > Signals > 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 -> Start Run time Navigator<br />* Open Object Graph VAR Ai (Database, MyPlant, MB3 on VAR, Object Graph)<br /><br /></p> |
Latest revision as of 05: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)