Read variable from a file
== Read a variable from a file ==
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)