Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

how to read and store RFID signal and to use them in the application

sir here i am attaching the vi file including all the dependencies..

so u can verify the code from this folder named a1.zip

0 Kudos
Message 11 of 15
(1,181 Views)

sir

The above attached folder doesn't contains all the dependet files..so i am attaching new folder and sending again..please refer the latest folder for checking0 the code of my project.

0 Kudos
Message 12 of 15
(1,181 Views)

Sir

In a hurry to get reply from you i have attached the files partially so please ignore the above 3 (attachments) posts and refer the latest attached folder(ars.zip) to view the code of my project that contains all the depending files with it..

0 Kudos
Message 13 of 15
(1,174 Views)

While I sympathize with your need for "hurry" you should understand that I don't really share that need. I, like most people on this forum, am a volunteer. I have a full-time job, and on weekends I try to have a real life. As much as that's possible. If you are in need of immediate assistance, then you need to contact NI Tech Support directly. Public forums are not the avenue for immediate assistance.

 

That said, your VI..... where do I start? Well, I can say that 1000 word aren't going to be nearly enough to describe it. Your wiring is a complete mess. If you want people to understand your code you have to program properly. Whether it's text-based code or graphical programming it doesn't matter. Easy to read code translates into easy to debug code and easy to modify code. Your code is none of that.

 

The issue:

  • Using string functions to create paths. NEVER do this. Use the path functions. Using the string functions makes you platform-dependent. It also causes you to use extra functions, such as Concatenate Strings and String to Path.
  • Do not set the Timeout inside the loop. That's pointless. You're just setting it to the same value over and over and over again.
  • What in the world is the point of using a case structure to convert a Boolean to a Boolean (at the far-right in the "checkin" case)? This is simply silly.
  • You have used a constant of "/t" for the delimeter for the Write to Spreadsheet" file. First, that's incorrect. If you want a tab, it should be "\t", and then the string should be set to view in "\" display mode. Otherwise, the string simply means two characters, instead of it indicating an escape code. Second, use the string constants. There is a string constant for tab.
  • I do not know what you are reading from the "master(ars)tempdb" file, but you are using it to drive a loop. Then inside the loop you read the same file again and again just to strip out each line in order to look for the card ID. You've already read the file. Why are you reading it again and again for each loop iteration? What if there are 5000 lines? You're going to read the file 5000 times!!! Read the file once and search the first column for your card ID. When you find it, pull out the corresponding row from the 2D array of data.
  • Wires not doing anything. Most of these are branches that don't actually do anything, and some of these create unnecessary tunnels, making the diagram even harder to read that it already is. Some are duplicates (like the VISA session
  • Your "stop" case doesn't do anything.
  • Instead of using Concatenate String with tab characters to create the line you need to append to your file, use a single Build Array function. The Write to Spreadsheet File has a 1D array input.
  • Instead of using multiple Concatenate String functions, use one. It's resizable. This makes the code more readable.
  • You don't check for serial port errors inside the loop.
  • What is the intent of the "register" state?
  • ...

See attached cleanup of your code for a starting point for a much cleaner and easier to debug program.

 

Now, as to the original problem, which is the timeout issue, your the VISA Configure Serial Port will, by default, set up the VISA session so a VISA Read will stop reading once it sees the termination character or it reads the number of bytes you tell it to read. The default termination character is a linefeed. You can enable/disable termination and you can also set the termination character. You have to look at the documentation for your reader to see what character, if any, is used to indicate the end of the serial number. It may not be a linefeed. It may be a carriage return. If that's the case, you need to wire the appropriate value to the "termination charater" input of the VISA Configure Serial Port VI. That input is a numeric value, which corresponds to the ASCII code of the character that is used to indicate the end of the message. A linefeed has an ASCII code of decimal 10. A carriage return has an ASCII code of decimal 13.

0 Kudos
Message 14 of 15
(1,169 Views)

Hello sir

Thank u very much for briefly describing the dos and don'ts in my project and about the code complexity.which helps me a lot to modify it in a simple way and to know about some new vi modules..and i am sure from now i will use the related vi modules effectively  to write code efficiently..as u mentioned in the previous mail i have tried to configure visa serial port with termination char by giving a value 13 and enabled terminal char..

but still it is showing the same error as timeout expired before operation completed.

when i tried to read the card in the labview help example vi that named "advanced serial write and read.vi" it is reading the card as \020B0070CAC1\r\n

and can you tell me on which basis we will give byte count to visa read,and how it varies.

so help me out in clearing the mentioned error

 

 

Thank u

 

0 Kudos
Message 15 of 15
(1,156 Views)