Any source code for SFGDemo software

I am creating a finger print based c# application.Any one know the SFGDemo software methods to enroll/scan and get the image to the software interface and other methods to communicate with the finger print and c# software ?

The closest I can find for source code is "finger.c" in [8051 CODE.zip](http://"https://decibel.ni.com/content/servlet/JiveServlet/download/50964-62960/8051 CODE.zip") It is C code for the 8051 processor but it might give you a start on a C# program. Looks like it will enroll and verify fingerprints. You will need to study the datasheet for other commands.

Can you send me the valid link to get it.This link seems broken.Thank you

Here it is:
https://decibel.ni.com/content/servlet/JiveServlet/download/50964-62960/8051%20CODE.zip
The forum seems to mess up URLs sometimes.

EDIT: That link has since gone dead. The new link is:
https://forums.ni.com/ni/attachments/ni/420/4099/3/8051%20CODE.zip

Thank you.

In finger.c file there are hard coded arrays.

unsigned char a[16] = { 0xef, 0x01, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x07, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b };
unsigned char b[10], i = 0, j, c = -1;
unsigned char a1[12] = { 0xef, 0x01, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x03, 0x16, 0x00, 0x1a };
unsigned char a2[12] = { 0xef, 0x01, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x03, 0x01, 0x00, 0x05 };
unsigned char a3[13] = { 0xef, 0x01, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x04, 0x02, 0x01, 0x00, 0x08 };
unsigned char a4[17] = { 0xef, 0x01, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x08, 0x1b, 0x01, 0x00, 0x00, 0x00, 0xa3, 0x00, 0xc8 };
unsigned char a5[13] = { 0xef, 0x01, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x04, 0x02, 0x02, 0x00, 0x09 };
unsigned char a7[12] = { 0xef, 0x01, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x03, 0x05, 0x00, 0x09 };
unsigned char a6[12] = { 0xef, 0x01, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x06, 0x06, 0x02, 0x00 };

Is this command of fingerprints or address to get the fingerprint methods ? I am not clear about this. Can any one explain this ?

Those appear to be command packets for the fingerprint reader. Note that they all start with the same header:
0xef, 0x01, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00

You should find the message formats in the datasheet.

The byte after the header appears to be the payload size. It indicates how many more bytes are in the message. You will note that ‘a6’ says the payload size is 6 but only 3 more bytes are in the array. That’s because those last three bytes are not constants.

The byte after the payload size is most likely a message type. Note that ‘a3’ and ‘a5’ are the same type with different parameter values.

From context within the program:

‘a’ has something to do with initializing the com port. It is sent 5 times with 1.2-second delays between at the start of the program.

‘a1’ is sent right after the program displays “BAUD RATE 9600” so I expect it is setting the baud rate.

‘a2’ seems to be checking for a fingerprint. It is sent repeatedly until the 10th byte of the returned message is 0 or the loop has run 255 times.

‘a3’ seems to be sent when a finger is detected. I think it moves the fingerprint to a scratch buffer.

‘a4’ is sent to check the validity of the print. The result is in the 10th byte of the return message:

0x00 = VALID
0x09 = NOT REGISTERED
0x01 = ERROR

If the Enroll button is pressed:
‘a2’ is sent first
‘a3’ is set second and appears to be a verification that the same fingerprint is read twice.
‘a5’ is sent. I don’t know why.
The first 9 bytes of ‘a1’ are sent followed by 0x05, 0x00, 0x09 (which makes it identical to ‘a7’)
‘a6’ is sent which says it has a 6 byte payload but only the first three are included in the array.
The last three are then sent:
‘c’ A one-byte fingerprint identifier
0x00
0x0F+c (the checksum which changes with message contents.

I assume that the ‘a4’ message, when it indicates a valid print, will have the ‘c’ value in the buffer somewhere.

can you send the source code link again? the link above is down. i’m trying to understand the code too. Thanks alot.

I believe this is the the NI forum thread from which that file came:

and here's the new download link:
https://forums.ni.com/ni/attachments/ni/420/4099/3/8051%20CODE.zip

Thank you for the quick reply.With this i will be able to understand better. Have a good day. :slight_smile:

lahirud:
I am creating a finger print based c# application.Any one know the SFGDemo software methods to enroll/scan and get the image to the software interface and other methods to communicate with the finger print and c# software ?

Visit this page... it maybe the solution of your requirements...

Link: Getting Started with Optical Fingerprint Reader – R305