I am using the Arduino Mega
I know what that is.
with the SparkFun Simultaneous RFID Reader - M6E Nano with an external UHF RFID antenna
No clue what that is, so you should provide a link.
I got all the Arduino SparkFun_Simultaneous_RFID_Tag_Reader_Library
Another link needed.
How do I use the Sparkfun library to count the number of unique tags?
Well, first you need to collect all the tag data in an array. Then, you need to iterate over the array comparing the data at the nth position for the data at the 0th to ni1st positions. If the data at the nth position matches that of a previous position, move the rest of the array up one position, and decrement the count of used array positions. When you get to the end of the array, all the elements will contain unique values, so you know how many there are.
Right now, I have an idea of adapting the "RFID_Constant_Read" example. My idea is to store EPC numbers into an array. Whenever it gives a EPC number, I will check whether it is already in the array or not. I will only add it into the array if it is not already in the array because it is a new unique tag. After letting the RFID reader do its scanning for about 30 seconds, I will then check the size of the array to determine the number of unique tags. Will this work?
Yes, if the RFID_Constant_Read example does what I expect it to do. Of course, I have no way of knowing whether it does, or doesn't.
I am using the Arduino Mega
#include <SoftwareSerial.h> //Used for transmitting to the device
SoftwareSerial softSerial(12, 13); //RX, TX
These just do NOT go together.
if (setupNano(38400) == false) //Configure nano to run at 9600bps
That is NOT what that code does.
Currently, that code starts reading at the end of setup(). You'll need to move that to loop(), and determine what the appropriate action is to take after the desired scanning interval. Whether there is a method to stop reading, or whether you simply need to clear some variables and/or arrays, I couldn't tell you, without knowing more about the library.
Why is the instance of the RFID class called nano?