LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

LIFA Serial

Well im using a ID12/ID20 as RFID Reader, and i have to wait for my input before my code has to do anything ( Door Lock ), it works but only in a specific period sadly, but thats good for now

0 Kudos
Message 11 of 35
(2,219 Views)

I see what you mean, you could put the Serial Find Regex in a loop and wire the timeout to continue the loop, stop the loop whenever timeout is false and output the read data.

0 Kudos
Message 12 of 35
(2,219 Views)

And how do you check if the timeout is false ? But i see what you mean, could be an idea.

0 Kudos
Message 13 of 35
(2,219 Views)

Check the Serial Find Regex vi.. That does a read in a loop with a timeout, You can make your own version to work as you like.

0 Kudos
Message 14 of 35
(2,219 Views)

I tired but cant seem to get it working correctly do you have any ideas ?

0 Kudos
Message 15 of 35
(2,219 Views)

You have to give me some details, show me some VIs, explain where the troubles are.  Without seeing the hardware and with no description of the problem I have no idea.

0 Kudos
Message 16 of 35
(2,219 Views)

Serial.RFID.pngSerial.RFID.Fritzing.pngIMAG0005-smaller.jpg

This is the Images i got, i hope this can help

The problem is the read vi, i have to read my RFID tag at a specific time in the loop, but i want to make it read constantly and when i get a tag then spit the tag out to me and do a task.

i made a few vi's and its the same, maybe iits just me and the code setup but im just a hobby coder 😛

Message 17 of 35
(2,219 Views)

Is this something you can help with ?

0 Kudos
Message 18 of 35
(2,219 Views)

Ok sorry about the delay, I'm in the middle of a pretty time-intensive project.  Let me explain some things here and then offer you a few suggestions:

  1. The Arduino has a read buffer where it stores whatever is read on the serial port and waits for you to go get it, you don't have to read real quickly because it will wait for you to go get the data (unless alot of data is coming across and overflowing the read buffer between reads but this probably isnt the case for you).
  2. There is a small chance that you'll read the read buffer in the middle of when your device is transmitting and only get half of the string.  With your code, you'll miss this event because you throw away the string between every read. You want to use a shift-register within your while loop and concatenate the read string onto the previous string to prevent this.

Can I assume that you just need a VI that continously reads until you see "470025D6FA4E and then returns a match found true?  Do you need a timeout like say wait 10 seconds and then return if it doesn't see that?  If you can tell me exactly what you want your VI to do I can write one up real quick and put it here for you to use.

0 Kudos
Message 19 of 35
(2,219 Views)

Well right now im trying to read a spreadsheet and then read it as an array, and make it search for the string im getting.

But the "470025D6FA4E" number is a RFID ID, and im going to get alot of ID's.

i tried your Regex Serial Read but thats the same thing, im getting it way to late ( Would really love it instantly (Or very close to))

also tried with the length of the string and it works but still the same thing, i can wait along time or i can read the card at a specific time in the loop.

i could send you the big VI i got on the door lock im creating, then you can check out the code and see if there's something you could do to read "faster" or better timeframe

0 Kudos
Message 20 of 35
(2,219 Views)