[foxboro] Reading Text Data from a File into a Sequence Block
- From: "Badura, Tom" <tbadura@xxxxxxxxxx>
- To: <foxboro@xxxxxxxxxxxxx>
- Date: Wed, 30 Apr 2008 15:56:10 -0500
Hello Everyone,
We have the need to read and parse data from a text file into a Sequence
block. The data consists of several fields of text and numeric values
in each record (line). These values need to be parsed into several
sequence block string and real variables. I have been able to use the
rdfile dm command to access and parse the file and the setl dm command
to write the numeric data into one of the sequence block RI variables.
However, I have not found a way to write the string data to the sequence
block. Does anyone know of a command for writing text similar to the
setl, seti, setb commands? Or perhaps someone knows of a better way to
accomplish this whole task. I would certainly appreciate any ideas and
suggestions from anyone who may have done this already.
Sincerely,
Tom Badura
Plastics Engineering Company
Here is a listing of the data file and sequence code I have using as a
test.
testfile
TestLine01 12345 67890
TestLine02 54321 09876
TestLine03 12345 67890
TestLine04 54321 09876
TestLine05 12345 67890
TestLine06 54321 09876
Test_Seq
DEPENDENT_SEQUENCE
VARIABLES
Index : I;
Width : I;
Offset : I;
FileName : S;
STATEMENTS
<<LOOP>>
WAIT UNTIL BI0001;
BO0001 := FALSE;
FileName := "D:/usr/plenco/displays/Develop/testfile.txt";
Index := II0001;
Width := II0002;
Offset := II0003;
/* Read Field From Data File and Set Into Real Input */
:AW9101DMCMD := "rdfile ",FileName," r24i",Index,"w",Width,"o",Offset,"
P8";
:AW9101DMCMD := "setl IA02_TEST:DEP1.RI0001 $P8";
BI0001 := FALSE;
BO0001 := TRUE;
GOTO LOOP
ENDSEQUENCE
_______________________________________________________________________
This mailing list is neither sponsored nor endorsed by Invensys Process
Systems (formerly The Foxboro Company). Use the info you obtain here at
your own risks. Read http://www.thecassandraproject.org/disclaimer.html
foxboro mailing list: http://www.freelists.org/list/foxboro
to subscribe: mailto:foxboro-request@xxxxxxxxxxxxx?subject=join
to unsubscribe: mailto:foxboro-request@xxxxxxxxxxxxx?subject=leave
- Follow-Ups:
- Re: [foxboro] Reading Text Data from a File into a Sequence Block
- From: Johnson, Alex P \(IPS\)
Other related posts:
- » [foxboro] Reading Text Data from a File into a Sequence Block
- Re: [foxboro] Reading Text Data from a File into a Sequence Block
- From: Johnson, Alex P \(IPS\)