I saw many needs for such batch conversion software.
I wrote for might own use and thought it might be useful to anyone.
So I posted here to share.
Hopes it helps in some way.
#include
#include
#include
#include
void plwToText(char *filename);
typedef struct PICO_header_struct
{
unsigned short header_bytes;
char signature[40];
unsigned long version;
unsigned long no_of_parameters;
unsigned short parameters[250]; // !! The value in the PICOlog documentation is entirely bogus!
unsigned long sample_no;
unsigned long no_of_samples;
unsigned long max_samples;
unsigned long interval;
unsigned short interval_units;
unsigned long trigger_sample;
unsigned short triggered;
unsigned long first_sample;
unsigned long sample_bytes;
unsigned long settings_bytes;
unsigned long start_date;
unsigned long start_time;
long minimum_time;
long maximum_time;
char notes[200];
long current_time;
unsigned char spare[78];
};
class PICO_data_reading
{
public:
unsigned long time_count;
float voltage;
};
void main(int argc,char **argv)
{
clrscr();
if(argc==1)
{
printf("file name not specified (program 'filename' 'start range' 'end range')\n");
}
else if(argc==2)
{
printf("Converting %s\n",argv[1]);
getch();
plwToText(argv[1]);
}
else if(argc==3)
{
printf("End range required\n");
}
else if(argc==4)
{
int start=atoi(argv[2]);
int end=atoi(argv[3]);
printf("Converting files \"%s\" from %d to %d\n",argv[1],start,end);
getch();
for(int x=start;x<=end;x++)
{
char string[50];
sprintf(string,"%s%d",argv[1],x);
plwToText(string);
}
}
else
{
printf("too many parameter\n");
}
printf("Program terminated\n");
}
I had since receive a number of enquiry on my pico-log convertion code.
It is a short/small program, to helps me to convert to a format that
I can export for other software purpose.
I had updated my website to provide
the *.plw to *.txt code and program for download.