Problem with method not being called
I have a main method "Version 1.6" which is calling another method "SD_log" to write ADC values to an SD card. When the SD_log is run by itself with all lines active (no apostrophes) the method will come up on the PST as it should and when the SD card is checked through a card reader it functions correctly.
When the SD_log method is called through the "Version 1.6" method the PST logs the ADC prep and ADC running strings correctly but when I try to read the card there is no file.
I have a couple ideas of what the problem could be but I am not sure. First in the "SD_log" program lines 86 and lines 127 are used to start and stop the logging period and this needs to be done if there is not a finite number on the repeat block for writing to the SD card.
Also "SD_log" will not work correctly if term.start (line 79) is active when I run it from the main program.
The problem must be in calling "SD_log" from "Version 1.6" I do need to figure out a way as well to close the log file (line 133) and unmount (line 139) the ADC before I can read the SD card.
This program will not be connected to a computer when it is running so it is not possible to have the data read out on the PST only.
Let me know if you need to see any of the other methods.
Cheers!
When the SD_log method is called through the "Version 1.6" method the PST logs the ADC prep and ADC running strings correctly but when I try to read the card there is no file.
I have a couple ideas of what the problem could be but I am not sure. First in the "SD_log" program lines 86 and lines 127 are used to start and stop the logging period and this needs to be done if there is not a finite number on the repeat block for writing to the SD card.
Also "SD_log" will not work correctly if term.start (line 79) is active when I run it from the main program.
The problem must be in calling "SD_log" from "Version 1.6" I do need to figure out a way as well to close the log file (line 133) and unmount (line 139) the ADC before I can read the SD card.
This program will not be connected to a computer when it is running so it is not possible to have the data read out on the PST only.
Let me know if you need to see any of the other methods.
Cheers!
spin

8K
Comments
In fact both term objects are different where only one is initialized. The uninitialized term (in SD_log) causes the problems. When the TX buffer is full, (which will overwrite other memory) it will wait until the TX buffer is send. But this does not happen, as the term is not initialized, so it's waiting forever - no more SD card logging, no more ADC.
PS:
If you want to use the same fullduplexserial you have to tweak it. Move all VARs to the DAT section. Then it's fine to initialize it once and use it in different objects. BUT ... as both programs (the main of Version 1.6 and the main of SD_log) use it anytime they want you need a way to synchronize all the term functions.
If you want to use FSRW in Version 1.6 as well (for reading) you have the same problem as with fullduplexserial. You have 2 different versions of FSRW running in different objects.
I think the easiest way is to move the code from SD_log into version 1.6.
You only have to
1. rename main from SD_log to for example sd_main
2. copy the whole code from SD_log to Version 1.6
3. Instead of COGNEW( SD_ADC, ... ) you do a COGNEW( sd_main, ... )