A wireless tag communication system that includes a wireless tag communication apparatus that communicates with a wireless tag and a primary apparatus that is connected to the wireless tag communication apparatus and controls the wireless tag communication apparatus, comprising:
- a wireless communication device that transmits, to the wireless tag, a read command for reading identification information of the wireless tag and receives the identification information from the wireless tag, the read command designating a flag state stored in a flag of the wireless tag, the flag state being one of a first state and a second state, the wireless tag returning the identification information upon receiving the read command designating the flag state only where the flag state corresponds to the designated flag state;
- a state detector that detects a communication state with the wireless tag by the wireless communication device;
- a memory that includes a detection target storage unit that stores detected information in association with identification information of each of one or more wireless tags whose positions are to be detected, the detected information indicating whether or not the position of the corresponding wireless tag has been detected;
- and
- a processor configured to
- transmit, by the wireless communication device, the read command designating the first state as the flag state and acquire, by the wireless communication device, the identification information returned from the wireless tag whose flag state is the first state,
- detect a position of the wireless tag on a basis of the communication state detected by the state detector,
- determine, on a basis of the detected information stored in the detection target storage unit of the memory in association with the acquired identification information, whether or not a position of the wireless tag that has returned the identification information has been detected, and
- instruct, where the position of the wireless tag that has returned the identification information has been detected, the tag wireless that has returned the identification information to rewrite the flag state to the second state by the wireless communication device.