From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How access to Smart Card Readers using Labview?

I´am trying access to Smart Card Readers by Labview, but I have problems.

I want to read SIM card GSM using Labview.!

The file winscard.dll has the functions to access, but I dont have skill with "Using External codes in LabView".

In MSDN library there is the specification about the functions for winscard.dll

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secauthn/security/smart_card_authentication.asp

When you install a driver for some smart card reader you access to it by winscard.dll.


Att. Enrique
0 Kudos
Message 1 of 11
(4,747 Views)
Hello Enrique,

As I understand your question, you want to know how to use the Call Library Node to call the winscard.dll. Assuming this is the case, all you need to do is put down the Call Library Node, right-click it and select "Configure", and a dialog window will pop up in which you can specify the dll to be called, the calling convention, etc. When it finds the dll, it will automatically populate with the correct number and types of inputs. Unfortunately, I don't have time to go through the functionality of the dll and layout the specifications on each input, but I imagine that information is available for you on the website you gave. But I hope this information at least gets you started.

Good luck!

Tyler S
0 Kudos
Message 2 of 11
(4,724 Views)
In winscard.dll I have the function SCardEstablishContext;

In MSDN the especification for this functions is:

LONG SCardEstablishContext(
DWORD dwScope, /* IN
LPCVOID pvReserved1, /* NULL
LPCVOID pvReserved2, /* NULL
LPSCARDCONTEXT phContext /* OUT
);

This an example in C++:

SCARD_SCOPE_USER=0;
SCARDCONTEXT hSC;
LONG lReturn;

lReturn = SCardEstablishContext(SCARD_SCOPE_USER,NULL,NULL,&hSC);


The Call Node Library that I programed is:

long SCardEstablishContext(unsigned long arg1, long arg2, long arg3,
LStrHandle arg4);

My problem is how define the arg4 in Labview ? I put it as "LStrHandle" but when I run it all Labview stop and I need start again Labview.

Regards!
0 Kudos
Message 3 of 11
(4,711 Views)
According to this, the last argument is a handle. I believe that when interacting with windows, the handles are treated as a U32 (but they're not used inside LV). Any reason not to do that here?

___________________
Try to take over the world!
0 Kudos
Message 4 of 11
(4,701 Views)
Has anyone found out anymore information about calling the winscard.dll? I am running into the same problem. The prototypes are kinda screwy.

Thanks
BJD1613

Lead Test Tools Development Engineer

Philips Respironics

Certified LV Architect / Instructor
0 Kudos
Message 5 of 11
(4,647 Views)
Finally I can acces to the smart card readers (PC/SC) with Labview,   this is the first part where I can establish the context and realease it, and  I can get the first  name of my list of PC/SC readers that I have connected to my computer.
 
I was wearing the "Call Library Function"  for  winscard.dll
 
For  Establish the context you need :
 
  function name :  SCardEstablishContext
Calling conventions :  stdcall (WINAPI)
function prototype :    long SCardEstablishContext(long SCARD_SCOPE_USER, long NULL1, long NULL2, unsigned long *hContextHandle);
 
 
function name : SCardReleaseContext
Calling conventions :  stdcall (WINAPI)
 
function prototype :  void SCardReleaseContext(unsigned long hContextHandle);
 
0 Kudos
Message 6 of 11
(4,526 Views)
Finally I can acces to the smart card readers (PC/SC) with Labview,   this is the first part where I can establish the context and realease it, and  I can get the first  name of my list of PC/SC readers that I have connected to my computer.
 
I was wearing the "Call Library Function"  for  winscard.dll
 
For  Establish the context you need :
 
   function name :  SCardEstablishContext
Calling conventions :  stdcall (WINAPI)
function prototype :    long SCardEstablishContext(long SCARD_SCOPE_USER, long NULL1, long NULL2, unsigned long *hContextHandle);
 
 
function name : SCardReleaseContext
Calling conventions :  stdcall (WINAPI)
 
function prototype :  void SCardReleaseContext(unsigned long hContextHandle);
 
0 Kudos
Message 7 of 11
(4,526 Views)
Finally I can acces to the smart card readers (PC/SC) with Labview,   this is the first part where I can establish the context and realease it, and  I can get the first  name of my list of PC/SC readers that I have connected to my computer.
 
I was wearing the "Call Library Function"  for  winscard.dll
 
For  Establish the context you need :
 
    function name :  SCardEstablishContext
Calling conventions :  stdcall (WINAPI)
function prototype :    long SCardEstablishContext(long SCARD_SCOPE_USER, long NULL1, long NULL2, unsigned long *hContextHandle);
 
 
function name : SCardReleaseContext
Calling conventions :  stdcall (WINAPI)
 
function prototype :  void SCardReleaseContext(unsigned long hContextHandle);
 
0 Kudos
Message 8 of 11
(4,527 Views)
Have anyone try to read the ATM Card / Credit Card before?
0 Kudos
Message 9 of 11
(4,211 Views)
I have not, but I'm sure that if you have a card reader, the manufacturer would provide a library of calls to get information.  At the very least the reader would have some sort of serial interface that you could communicate with through VISA calls.  It all depends on the device.  What device would you be using?
 
I'm assuming you will be using this for purely legal reasons of course.
Brian Coalson

Software Engineer
National Instruments
0 Kudos
Message 10 of 11
(4,191 Views)