Basic Methods for Reading & Writing Tags
A quick start into the steps required to read and write to a tag.
There are two distinct methods of reading and writing to a tag using your SkyeTek module. Both of these methods offer trade-offs in performance and complexity - and are meant to address the wide range of use cases available to the SkyeTek modules.
1. Initial Scan
This is the preliminary scan to activate all available tags in the field. From here, you should be able to receive two pieces of key data about your tag: it's TagID and TagType. These two parts of data are required for the eventual Read or Write commands.
After the tag is in the field and the proper data is gathered, we can begin to Read or Write to the defined tag. Next, we will describe the two ways you can program your reader to execute your R/W command.
2. The "One-Time" Method
After scanning the tag initially, we can do a "one-time" read with the ReadTag command. It is called a "one-time" command because is a simple to implement method without requiring a lot of programming overhead. In fact, It only requires sending one command.
All we need to do is to provide the proper TagID, TagType, Address, and Num of Blocks to the ReadTag command. From here, the tag should respond with the requested data. We can repeat the same process with a WriteTag command as well.
There are some more points of interest to this method as well:
- Good for singe, quick writes
- Simple to implement in code
- Slower in comparison to other method (Reader automatically re-selects and reads every time)
- Not good to scale with many R/W operations back to back due to cycle time.
3. The "Tracking" Method
This method is useful for applications that require fine-grain control of their module's behavior, as well as those requiring multiple back-to-back Reads and Writes. This method, while being useful, requires a bit more programming setup to use. The basic method as follows:
- After the initial SelectTag operation is performed, send another SelectTag command - except this time include the TagID as well as the RF ON flag. This will keep the target tag selected and powered while it's still inside the reader's field.
- Call ReadTag like above, except without the TagID (but still keeping TagType and RF ON in the command). This will instruct the reader to write to the already selected tag, without re-selecting it.
- Additional Read and Write commands can be sent while the tag is still powered in the field. This can be stopped by turning off the RF flag, or sending a new SelectTag command.
As with the previous method, there are some additional points of interest:
- By holding the Tag inside the field and keeping it powered, we are able to perform R/W operations much quicker. This method should be used when multiple operations on a tag are required.
- The order of selecting and reading a tag is very important. If the proper order is not followed, the reader may reply with an error such as "INVALID_FLAGS" (even if the command is valid).
- When doing sequential reads and writes, it's important to throttle the speed of your while-loop. Attempting to send commands before the reader is ready will cause instability and possibly garbage data. Please see your readers specific documentation for more information.
- Controlling the RF flag manually also carries the risk of your reader consuming more power if care is not taken during programming. It's advisable that you program all Error / Exception code blocks (related to manually controlling the flag) also include a command to be sure the RF field is powered off.