Calculation problem dspMIAC
Posted: Fri Jan 04, 2019 3:18 pm
Hi Leigh,
Hope all is well!,
I am struggling with a calculation for a SD Card Saving routine.
I want to concatenate the MAINT1.txt file (I can save my Tag reader Serial/ID Number with no issues but I can only save it once using MAINT1.txt in the calculation) and I would like to use the RTC clock as the concatenation "byte" as I doubt very much that I would ever get any duplication. If I use a standard byte I am sure I would get duplicates especially once the unit switches on/off as I will start at 0 and repeat which is bound to have duplicate files. Perhaps you have a better idea?,
Please calculation below, I am not sure if the below will work?
RTC[8] = 0
RTC[7] = RTC[5]
RTC[6] = RTC[4]
RTC[5] = ':'
RTC[4] = RTC[3]
RTC[3] = RTC[2]
RTC[2] = ':'
RTC[1] = RTC[1]
RTC[0] = RTC[0]
.filename = "MAINT1" + RTC[0] + RTC[1] + RTC[2] + RTC[3] + ".TXT"
.filestring = ""
I have also attached the code of which the above is under the Macro of Save_Data
Any help would be greatly appreciated,
Regards,
Gavin
Hope all is well!,
I am struggling with a calculation for a SD Card Saving routine.
I want to concatenate the MAINT1.txt file (I can save my Tag reader Serial/ID Number with no issues but I can only save it once using MAINT1.txt in the calculation) and I would like to use the RTC clock as the concatenation "byte" as I doubt very much that I would ever get any duplication. If I use a standard byte I am sure I would get duplicates especially once the unit switches on/off as I will start at 0 and repeat which is bound to have duplicate files. Perhaps you have a better idea?,
Please calculation below, I am not sure if the below will work?
RTC[8] = 0
RTC[7] = RTC[5]
RTC[6] = RTC[4]
RTC[5] = ':'
RTC[4] = RTC[3]
RTC[3] = RTC[2]
RTC[2] = ':'
RTC[1] = RTC[1]
RTC[0] = RTC[0]
.filename = "MAINT1" + RTC[0] + RTC[1] + RTC[2] + RTC[3] + ".TXT"
.filestring = ""
I have also attached the code of which the above is under the Macro of Save_Data
Any help would be greatly appreciated,
Regards,
Gavin