Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Line Input -- How many bytes ??

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> AVR-DOS
View previous topic :: View next topic  
Author Message
NickUK

Bascom Member



Joined: 15 Nov 2005
Posts: 25
Location: Ashbourne

uk.gif
PostPosted: Wed Jun 24, 2009 2:30 pm    Post subject: Line Input -- How many bytes ?? Reply with quote

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.


Regards

Nick
Back to top
View user's profile
oe9vfj

Moderator



Joined: 17 Jun 2004
Posts: 269
Location: Austria, Hard

austria.gif
PostPosted: Wed Aug 12, 2009 10:14 am    Post subject: Reply with quote

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 as String * 200

open "Test1.txt" for output as #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"


open "Test1.txt" for input as #10
Line Input #10, TEstline

print "Now read Line back from File"
print  Testline
Print "with Length of " ; len(testline) ; " Characters"
close #10

_________________
regards Josef

DOS - File System for BASCOM-AVR on http://members.aon.at/voegel
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> AVR-DOS All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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