LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using labview, how do I access the smart card with the smart card reader?

Solved!
Go to solution

Hi all,

 

I have read some of the post from 2006, it has help me some what but I am still stuck.  I can communicate with the card reader SCR335 as far as getting the card reader list.  When I use the winscard.dll to get the status of the card, I get "6" that doens't mean anything to me.  I am including what I have done so far but I still need to read the smart card.   I had also used two third pary active X control but not getting anywhere either.  One from Priore and one from SCardX_Easy.  Thanks in advance.

 

Peter N

0 Kudos
Message 1 of 15
(4,513 Views)

Peter,

 

Have you seen this thread?  There is at least one code example.

 

http://forums.ni.com/ni/board/message?board.id=170&requireLogin=False&thread.id=161979

Ben

National Instruments
Certified LabVIEW Associate Developer
Certified TestStand Developer
Message 2 of 15
(4,487 Views)

I did faced the same problem last time. I developed the application in XP and it works fine. But when i run the exe on vista, i got that error 6 you are telling.

 

What i did is just copy the winscard.dll from the PC from where i developed the application and pasted it on the another PC in which Vista is ruuning. That solved the problem.

 

So you are going to give me a bit more details please.

1) In what OS you developed the application"

2) In what OS you got this 6?

3) What LabVIEW version you are using?

4) Are you using the latest version of Winscard.dll?

5) Are you using the certified release dll in your application?

 

Thanks,

Mathan

0 Kudos
Message 3 of 15
(4,479 Views)
0 Kudos
Message 4 of 15
(4,473 Views)

Hi Mathan,

 

Just to answer a couple of things here.

 

/////////////////////////////////////////////////////////////////

So you are going to give me a bit more details please.

1) In what OS you developed the application"

2) In what OS you got this 6?

3) What LabVIEW version you are using?

4) Are you using the latest version of Winscard.dll?

5) Are you using the certified release dll in your application?

 

Thanks,

Mathan

//////////////////////////////////////////////////////////////////////

I am using XP and not dealing with Vista at this time.

 I am using labview 8.6

I don't know if I have the latest version of winscard.dll.  I just got this labtop so I assumed that it should be the latest.  I will download the latest anyway.

About certified release dll????  Which dll are you refering to?

 

Thanks

P

0 Kudos
Message 5 of 15
(4,458 Views)

I don't have access to LabVIEW right now. Could you please post a screen shot of your vi along with the dll function declaration parameters screen. Forget about the certified release dll talk.. It was about my last project where i just used winscard.dll just to establish communication with the reader and then another dll which is a microsoft certified one that controls the functions of the USB device.

So what in ur case? Are you using only winscard.dll to control all the functions of your device?

 

Thanks,

Mathan

0 Kudos
Message 6 of 15
(4,434 Views)

Well... I get the program to connect to the reader now.  The thing is sometimes it work and other time it doesn't.  The scardconnect is what I am using right now.  Sometime I can get the ATR from the card.  When I come in the morning it would work and then for hours later it wouldn't work.  Any of you experienced this?

 

Regards,

Peter

0 Kudos
Message 7 of 15
(4,418 Views)

 

 I found out where it went wrong. Just see the below picture. Remove the input to hcardhandle (you have connected 0 to it which inconsistently caused the problem). Post if still problems occur.

 

 

Thanks,

Mathan

Message Edited by mathan on 02-20-2009 07:21 AM
0 Kudos
Message 8 of 15
(4,399 Views)

thanks Mathan,

 

Here's my latest and still doens't work all the time.  I also use the activeX demo from Scard Soft.  My program is some what consistent with this demo.  When the demo work (connect to the card) my program would also work.  I am suspecting something is up with the winscard.dll.

 

Thanks,

P

0 Kudos
Message 9 of 15
(4,391 Views)

Dear Peter,

 

Here are some of the modifications i did in your program. I am sure this will definitely work consistently without any issues. Post me if still problems are there.

 

1) In scardconnect function, give 2 to sharedmode input and 3 to protocol selection (either T0 or T1).

2) In scardstatus function, no need to connect input to the middle 4 values, just assign some value to atrlen parameter (should be greater than or equal to the actual length of the ATR.)

3) In scarddisconnect funtion, for dwdisposition parameter pass a value of 3 rather than 1.

4) Include scardfreememory function before scardreleasecontext function.

0 Kudos
Message 10 of 15
(4,378 Views)