From 1595_SNAP_PAC_R_series_user_guide.pdf
Displaying Free Space on the Card
If you need to know how many free bytes are left on a microSD/SDHC card, you can use PAC
Control or PAC Manager to read this data from an address in the controller’s memory map.
In a PAC Control strategy, for example, you could notify an operator if the card needs
replacing, based on the number of bytes still unused.
Make sure the card is in the controller.
In PAC Control, use the command Read Number from I/O Unit Memory Map to read
memory map address F7002204. Use Integer 32 Variable in Argument 2.
For more information, see “I/O Unit—Memory Map Commands” in Chapter 10 of the
PAC Control User’s Guide, and see “Read Number from I/O Unit Memory Map” in the
Command Reference or Help.)
In PAC Manager, open the Inspect window for the controller. Click Other and choose
Generic Read/Write from the popup menu. In the Address field, type F7002204. From
the Type dropdown list, choose 32-bit Integer. Leave the Length as 1. Click Refresh.
The number of bytes appears in the Value column.
I am trying 3. in PAC Manager
Choose Type:
32-Bit Integer “Refresh” -1385496576
32-Bit Integer (HEX) “Refresh” AD6B0000
How much space is left? It is a near empty 16 GB microSCHC card. Obviously, I am doing something wrong. Can someone point out my mistake?
Looks like a limitation from back when only 2GB cards were supported. A 32 bit unsigned int can only represent 4GB of free space. I would send an e-mail off to support, maybe there is an update to the memory map that has this value as a 64-bit integer - I don’t see it in the memory map docs though.
The cards I got for my client are only 2Gb. So this isn’t a big issue at the moment. I was just testing my code on my system and the only MicroSD card I have in my possession is this 16Gb card.
You could partition your SD card down to 2GB if you want to test with it, but it would be nice to have a method to check the free space on larger cards - can you even buy 2GB cards anymore???
Yes, they are $8-10 on amazon/walmart. I tried formatting mine down to 2GB last night, but I can’t in windows. Thought I read somewhere you have to use an actual program to format a MicroSD card.
Looks like some documentation updates are needed.
I’m on it.
(Sorry it wasn’t there before you encountered your problem, @Drenton, but thanks for helping us improve the docs for the future.)
FYI - beta/fix coming soon: * Fix added to B9.5g 3/26/18 and later, Added new memory map location (xF7002208) that returns free space as an unsigned 64-bit integer.