LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SN Check

 

Hi,

 

 

I need to make an Serial Number check into my testsoftware.It must write the serialnumber to a binaryfile and then check if the serial is already used.It should also log all passed and not passed serialnumbers.How can this be done easely with Labview?

0 Kudos
Message 1 of 13
(4,139 Views)

LabVIEW has binary file I/O functions. There are examples that ship with LabVIEW that show you how to read/write binary files. Are you only storing the serial number? If so, perhaps a simple text file would be sufficient? The "easiness" or "hardness" depends not on LabVIEW, but on your skillset and what else your program has to do. Clearly, you must be doing something other than checking serial numbers. However, for just this small part you can read the file at startup and store it into an array. When a serial number is entered you can simply see if the number is in the array. As for the logging part you have to be more specific. Log in what way? To the same file as mentioned above? What else are you logging? Data? Test parameters? Test names? Measurement names?

 

So you see, you need to first congeal your requirements a bit more. That's really the hard part. 

Message 2 of 13
(4,125 Views)

 

I want to use it along with a simpel RS-232 Terminal program.My intension in using binary-file is that user can not edit the bin file and add a serialnumber into it.So what Yopu mean is i can make a POP-UP before my terminal program starts telling user to enter serialnumber and store this information in a binaryfile?.It shall only store the serials that passes test without failures.

0 Kudos
Message 3 of 13
(4,095 Views)

Here is a discussion on license management

 

http://forums.ni.com/ni/board/message?board.id=170&message.id=444750&query.id=1054392#M444750

 

 

Also you should think about encrypting this information if you are worried about security. You can use Blowfish. It is an encryption VI that is free from LabVIEW.

 

http://zone.ni.com/devzone/cda/epd/p/id/3473

Tim
GHSP
0 Kudos
Message 4 of 13
(4,080 Views)
Thanks for answers but they did not solve my request.I do not need a licence check,just a small sn.number check for test purposes so we can handle better units that has passed test and those who did not pass test.This means i have to write or scan a barcode ,then save this info to a file and after test passes/fails write the result to this file.Thats what i need some helps with, thanks.
0 Kudos
Message 5 of 13
(4,039 Views)
Well, reading/writing a binary file is not difficult. Have you looked at the examples that ship with LabVIEW?
0 Kudos
Message 6 of 13
(4,018 Views)

I have looked at examples shipped with Labview but i have no clue were to start. Only logging details i need is "Serial nbr on device" Date of test and result OK or Failed. Testing software is almost done and when it finish executing it gives a True/False LED at front panel for the test. Is it not any examples out for this purpose?

0 Kudos
Message 7 of 13
(3,882 Views)

Is this what you are looking for?

 

You said three things to save, a) Serial number b) Test DateTime and c) Passed/NotPassed

So for me that's a cluster of three elements.

You want to save multiple clusters, so just make an array of it and save/recall the complete array.

 

I also add the file with some fake data but you can start with no file at all.

 

Hope this helped.

 

 

Edit: I had to rename the extension of the binary file since ".bin" is not allowed 🙂

Message Edited by Alain S on 11-15-2009 04:16 PM
Download All
0 Kudos
Message 8 of 13
(3,868 Views)
Thank You for example.I think it is closer than before now :-). But it do not check if serial has been used before? I need new serials stored,to be compared with those stored inside BIN file and then POP up a message "Serial is already used" or similar to this.My app should work like this: It pops up when app starts asking User to input a "valid"(Not used) serial, then my test proggy starts and when it stops it stores the serial as Test Ok or Test Failed. Then i can see what serial did pass my test and who did not pass.
0 Kudos
Message 9 of 13
(3,862 Views)

The example was just how to read and write to a binary file.
What happend with the data is something else.

Since we don't have the complete picture it's almost impossible to give you a final system 🙂

 

For comparing a SN I would suggest the following steps (states)

  • When program starts, read complete file into an array
  • When user hits the button "Accept Serial", after entering a SN, first loop through the array and compare all SN from the array with the one entered by the user
  • If it's found, give your error message, if not go on with I don't know what
  • Once I don't know is done, add one element to the array with SN, DatTime and Passed/Failed
  • If user enter a new SN, process starts all over again from second bullet in the list
  • When user quit the program, the array is written to the file so that next time all added SN's are loaded

 

This is best implemented with a state machine architecture.
Do you use one or not?

0 Kudos
Message 10 of 13
(3,859 Views)