LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to update string for RFID demo example "Urgent"

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

Download All
0 Kudos
Message 1 of 7
(3,929 Views)

How does the program know when the tag is removed?

 

Start with the following:

 

  1. fix the blatant race codition by eliminating the "String" local variable.
  2. Place the string terminal outside the case structure.

 

0 Kudos
Message 2 of 7
(3,878 Views)

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.

0 Kudos
Message 3 of 7
(3,866 Views)

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.

0 Kudos
Message 4 of 7
(3,856 Views)

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 

0 Kudos
Message 5 of 7
(3,816 Views)

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.

0 Kudos
Message 6 of 7
(3,794 Views)

Why is everything always "urgent"?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 7
(3,783 Views)