Sub Main REM scaling of Y axis (8 DIVs = 128 Pixel) REM real the range is from 19 to 247 (218 steps) REM should be "43" pixel_per_div=25 REM scaling of X axis (10 DIVs = 2500 Pixel) REM real there are 2560 data points REM should be "256" values_per_div=250 dim raw_data as byte sheet = thisComponent.getSheets.getByName("import all") REM Clear data from previous import sheet.getCellRangeByName("A2:J2561").clearContents(255) REM Get input parameters dirname = sheet.getCellByPosition(14,2).string for filecount=0 to 9 REM generate filename filename = "LWAVE0"+filecount+filecount+".DAT" REM name the header sheet.getCellByPosition(filecount,0).String = filename REM generate path to file filename=dirname+"/"+filename REM open the data file open filename for binary as #1 REM Skip header bytes file_pos=21 REM Read the first byte get #1,file_pos,raw_data count=0 'ThisComponent.LockControllers while not eof(1) sheet.getCellByPosition(filecount,count+1).value=raw_data REM read next byte count=count+1 file_pos=file_pos+1 get #1,file_pos,raw_data wend 'ThisComponent.UnlockControllers close #1 if count=0 then msgbox "File not found or empty" end if next REM copy data for grafic sheet.getCellRangeByName("R1:AA2561").setDataArray(sheet.getCellRangeByName("A1:J2561").getDataArray) msgbox "Ready All" End Sub