Posted: Wed Jun 24, 2009 2:30 pm Post subject: Line Input -- How many bytes ??
Hello All,
I am currently testing the AVR-DOS and have successfully been writing ASCII data to and from the SD card. The data is from a log of temperatures and input status data
so you get something like:-
24/06/09,12:23:00,Sensor 1=20.34C,Input 1=ON .... up to 128 bytes
Interestingly when I increased the number of temperate sensors and make the string longer the writing is correct, I checked the SD card on a PC.
But if a use the "Line Input" command if the line is longer than around 82 bytes then I get the line split up when reading back on the AVR
I have checked my line input variable which is 128 bytes so I should not get a problem.
I have also checked the SD card with the FS Interpreter and if I enter
"type tmp.log" then I get the same result, which leads me to think that there is a limitation on the "line input" reading.
Can anyone check this for me and give me any tips on increasing the "line input" value so that I can read the full 128 bytes in my data line.
Joined: 17 Jun 2004 Posts: 269 Location: Austria, Hard
Posted: Wed Aug 12, 2009 10:14 am Post subject:
The length in LINE INPUT is limited to the defined length of the String in BASCOM.
Please note that in the FS_Interpreter the used variable to read in from the file is limited to 100 Charcaters and the length in the command "WL" (Write Line) is limited to 70 Characters. Some limitations in the FS_Interpreter are not limitations of AVR-DOS. They are due to the limited RAM resources.
you can test this code snippet
Code:
dim testline asString*200
open"Test1.txt"foroutputas #10
TestLine ="Dekade0001Dekade0002Dekade0003Dekade0004Dekade0005Dekade0006Dekade0007Dekade0008Dekade0009Dekade0010Dekade0011Dekade0012" print"Writing Line to File" print Testline
Print"with Length of ";len(testline);" Characters"
print #10, TestLine
close #10
testline ="..." print"Change line Variable" print Testline
Print"with Length of ";len(testline);" Characters"
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum