Write and Read into a file etxt?

Lio

Member
Hello,

It is possible to:
- write the value of a variable Picaxe in a file text (.txt )?
- read a datum of a file text in a variable Picaxe?

Of the side Picaxe to read and write, is needed X2, no?

Thanks to you,

Lio
 

hippy

Ex-Staff (retired)
The PICAXE itself has no ability to access files, you will need to create software for a PC which can communicate with the PICAXE and store or provide that data for the PICAXE.

Forum members may be able to offer more helpful advice if you can describe what it is you are attempting to do.
 

Jamster

Senior Member
I can attept to create code for the computer, i have been able to write data to files from picaxe but havnt had too much luck reading to PICAXE due to sending information that i dint expect.

Buntay creates custom software and may be somone to ask.
 

Lio

Member
Thank you Hippy and Jamster!

I would like to build a web page (php) with wampserver for example..
PHP allows to read and to write in a file text, but I don't know if picaxe can make the same thing...
Another solution would be to use " serproxy " ( php )?
To use Kermit?
Thank you
Lio
 
Last edited:

Jamster

Senior Member
I dont know how wampserver or the other servers work so dont know whether they would work.

I presume the use of a webserver is so that you can see the data online, so you would need to send the data to the webserver using a program or by uploading the data directly to the webserver.

If you have to use a program to update the data file then you may be able to generate a HTML file in the program, then save the data to the sever. Unfortunatly I dont know PHP so the program would have to generate the code in HTML if I was to write the code. I can proably make the code flexible so you can write a template in HTML and the program will add the data as it comes in using the template.

Good luck
Jamster
 

Lio

Member
Thanks to you,

The PHP part is not the most difficult. Wampserver allows to realize a server php on the pc (in local)
I base myself on the kit picaxe net server which I bought..... The data are stored in files .cgi and used with html
This kit is very good to make a server having access to the Web. On the other hand the available space is not very important... It is necessary to avoid the images etc.... I must to built a site on a php server with links towards the kit net server...

Another question, picaxe works with serin and sertxd together? It seems to me that for the 08M or the 28X1 the command serin stop the program as long as it receives nothing... Does the 28X1 manage interruptions?
Thank you
Lio
 

Lio

Member
Oups I didn't want to write "interruptions" but rather "timeout" which should be utilies..., no?
 

Jamster

Senior Member
serin stops program execution on all chips, hserin works in the background.

...and sertxd outputs on the programming out pin...i think you mean serrxd...
 

BeanieBots

Moderator
Correct, serin will stop program execution until something is recieved.
All PICAXE chips support interrupts but they will not jump out of a serin.

The 28X1 supports a timeout on serin which will jump to a location if nothing is recieved within a defined period.

Have a read in manual 2 under "hsersetup" and "hserin".
Some PICAXEs support background serial inputs.
 

Lio

Member
OK, you're right, I've write too fast...
I shall use one 28X1 or one 18X2 and the commands serin (with timeout) and also serrxd and not sertxd...
Thank you
Lio
 

Lio

Member
Yes, thanks...
If someone have a solution for my local webserver, I'll take it... Ok, I can built something with vb.net...
Can be a vb.net script integrated into php...
Thanks to you
Lio
 
Top