LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

error in set file position

Solved!
Go to solution

I am getting problems if i want to randomly access a byte in my file.

 

Please see aatached example

 

1. see that file path of test file is correct

2. click on load file: This will read all the file contnets and store the indices of new line characters

3. click on one shot check: this again reads the entire file and tries to see if all the characters pointed by indices are new line chars. this test passes

4. click on Set Pos check: this will try to read the character present at offset specified by the index(offset from file start position). I get first index pass but subsequent indices fail.

 

can anybody please help me to track the problem.

Tushar Jambhekar
tushar@jambhekar.com

Jambhekar Automation Solutions
LabVIEW Consultancy, LabVIEW Training
Rent a LabVIEW Developer, My Blog

0 Kudos
Message 1 of 3
(3,075 Views)
Solution
Accepted by topic author Tushar_Jambhekar

Right-click the "Read from text file" instances and uncheck "Convert EOL". With Convert EOL active the EOLs are converted into newline only, which removes characters from your file (your 10/13 (new line, carriage return) is converted into 10 only). So you get the newline matches at the "wrong" positions.

When setting the file position this sets the cursor on the "unconverted" file, so the position ends up wrong.

 

 

Message 2 of 3
(3,068 Views)

thanks a lot...

Tushar Jambhekar
tushar@jambhekar.com

Jambhekar Automation Solutions
LabVIEW Consultancy, LabVIEW Training
Rent a LabVIEW Developer, My Blog

0 Kudos
Message 3 of 3
(3,059 Views)