Hello,
The current FAT component hard codes the file creation time and date as the compilation time and date.
To get around this you will have to edit the create file routine using code customization.
In the Create file function you will see the following section of code.
Code: Select all
Write_Byte_To_Buffer((i * 32) + 11, 0x20); //File Attribute
Write_Byte_To_Buffer((i * 32) + 12, 0x18); //Reserved for NT
Write_Byte_To_Buffer((i * 32) + 13, 0); //Creation time
Write_Byte_To_Buffer((i * 32) + 14, MX_FILE_CREATETIME);
Write_Byte_To_Buffer((i * 32) + 15, MX_FILE_CREATETIME >> 8);
Write_Byte_To_Buffer((i * 32) + 16, MX_FILE_CREATEDATE); //Creation date
Write_Byte_To_Buffer((i * 32) + 17, MX_FILE_CREATEDATE >> 8);
Write_Byte_To_Buffer((i * 32) + 18, MX_FILE_CREATEDATE); //Access date
Write_Byte_To_Buffer((i * 32) + 19, MX_FILE_CREATEDATE >> 8);
Write_Byte_To_Buffer((i * 32) + 20, 0x00);
Write_Byte_To_Buffer((i * 32) + 21, 0x00);
Write_Byte_To_Buffer((i * 32) + 22, MX_FILE_CREATETIME); //Modified time 0 no modification entry
Write_Byte_To_Buffer((i * 32) + 23, MX_FILE_CREATETIME >> 8);
Write_Byte_To_Buffer((i * 32) + 24, MX_FILE_CREATEDATE); //Modified date
Write_Byte_To_Buffer((i * 32) + 25, MX_FILE_CREATEDATE >> 8);
Where CREATEDATE is the hard coded date and CREATETIME is the hard coded time.
You could replace the hard coded definitions with variables from Flowcode. eg a variable called time in Flowcode would be called FCV_TIME in the C code.
From doing a Google search of the FAT format I have come up with this bit of info regarding the date and time parameters.
Time (5/6/5 bits, for hour/minutes/doubleseconds)
Date (7/4/5 bits, for year-since-1980/month/day)
Both time and date will have to be INT type variables in Flowcode.
Let me know how you get on.