Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 01:45 28 Apr 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Simple problem

Author Message
nnvpaul
Newbie

Joined: 12/12/2014
Location: United States
Posts: 7
Posted: 05:23pm 30 Dec 2014
Copy link to clipboard 
Print this post

I have built a processor that cleans and processes waste motor oil for use as fuel for diesel engines. It works very well but it needs a controller. I have been building a program for it with a color maximite2. It has been time consuming because this is not something I am very familiar with. With a lot of trial and error I have been able to get the maximite to do everything necessary to control the unit except one small detail that I cannot figure out.

One of the tanks of the unit holds gasoline that is dispensed with a pump. It has been fairly easy to get the maximite to calculate the proper amount of time to operate the pump to dispense the desired amount of gasoline. The maximite also has to keep track of the gallons left in the tank which is also easy. The problem is that the maximite has to be shut down after the processor is finished. All of the variables are reset when the maximite is shut down and the gallons remaining are lost. Is there a way for the maximite to remember the gallons remaining? This seems like it should be simple but I am not getting it.
 
OA47

Guru

Joined: 11/04/2012
Location: Australia
Posts: 899
Posted: 05:34pm 30 Dec 2014
Copy link to clipboard 
Print this post

Gday Paul, you have the option of saving values to a file on the SD Card and read it back in to the program when it re-starts.
GM
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9063
Posted: 08:02pm 30 Dec 2014
Copy link to clipboard 
Print this post

Hi there - as Graeme says, you can save this to a file on the SD card.

You need to know your variable names, but I guess you do.

You could do this in a GOSUB or plain old sub like this:


SUB SAVE_SETTINGS:
Open "B:\SETTINGS.INI" for Outpuy as #1
Print #1,variable_name1$
print #1,variable_name2$
...
Close #1
End Sub


You can read the file back in as soon as you run your main code if you like, to restore the settings.

If you need me to elaborate, then let me know.

Smoke makes things work. When the smoke gets out, it stops!
 
twofingers
Guru

Joined: 02/06/2014
Location: Germany
Posts: 1133
Posted: 05:11am 31 Dec 2014
Copy link to clipboard 
Print this post

Hi nnvpaul,

or you can use a eeprom (on cheap RTC modules) for this.
Alternativly you can use a FRAM.

Regards Michael
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024