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 StatesPosts: 7 |
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: AustraliaPosts: 899 |
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 ZealandPosts: 9063 |
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: GermanyPosts: 1133 |
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 |