01-06-2017 06:56 PM
Hello
i have a question for RFID reader demo, it reads the serial of the RFID tag when i place it on the RFID reader as show on the string. However when i remove it from the RFID reader its serial code is still shown on the string.
What should i do to force the data string to be updated when RFID tag is removed from the reader ?
Thank you
01-06-2017 08:05 PM
How does the program know when the tag is removed?
Start with the following:
01-06-2017 08:56 PM
Thanks sir
But i am using local variable in the condition case for access control.
If you can show me how to place the string on an example or picture i will be thankful.
01-06-2017 09:23 PM
Attach the actual VI. I won't do "pictures".
The local variable creates a race condition because it will most likely be read before the lower part of the code has a chance to update the indicator, thus the comparison operates on stale values.
Place the string terminal after the case structure and make the output tunnel "use default if inwired". Wire it out of the true case. branch the wire to the indicator terminal and the comparison operation. No local needed.
01-07-2017 07:24 AM
well i attached the RFID VI demo example without doing any modification into it, what should i do to force the string to be updated when i remove the RFID tag.
i tried what you told me to do but it did not work with me or i did not get your point
Thanks
01-07-2017 01:00 PM - edited 01-07-2017 01:01 PM
If it is not your code, you should have provided a link from where you downloaded it. Is it a trustworthy source? (From the diagram comment it seems to originate from here. Does it?)
In any case, this is different code than what you showed. (e.g. no misused local variable).
You added a conditional 5000ms delay that will interfere with the normal 10ms loop time. Why?
Well, you need to decide how to detect removal. I am not familiar enough with RFID to help you with that, but it could be the "tag detected" boolean going false. Who knows? If this is the case, you could simply use a "select" node to either feed an empty string or the detected string to the indicator based on the boolean, right? You should make sure that the detected tag show for a sufficient amount of time. If it disappears after 10ms, you won't be able to read it.
01-07-2017 02:35 PM
Why is everything always "urgent"?