LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

pc/sc Scardtransmit

Hi guys,

 

I have a question here, any of you try multiple card readers using labview before? As what I mean is that by connecting more than one smart card reader to a single PC and use the scard commands to read the smart chip information?

 

The current method that I tried is, by increase the readerlistlength and collect the full string of all the readers' name and process them sequentially in a subsequent For Loop, to get the ATR return and send in scardtransmit command.

 

The current result is that I am only able to get the correct result from the 1st reader from SmartCardSlot 0. the rest was unsuccessful... anyone can help out? thanks.

 

Regards,

Eit.

0 Kudos
Message 31 of 51
(4,397 Views)

Hello.

 

I'm trying to make a VI that can read the UID of card.

I've based my code on the SmartCard_transmit-vi by Mathan, but I don't think I understand wich values should go into pioSendPci.

I think I'm suppose to send 0xFF 0xCA 0x00 0x00 0x00 in the sendBuffer to get the UID, but all I get is 80100004 which means invalid parameter (?).

 

I'm also not sure about the difference between the protocol-parameter returned from SCardConnectA and SCardStatusA...

 

Anybody?

 

Best regards Marius

0 Kudos
Message 32 of 51
(4,350 Views)

also, when I use the same values for pioSendPci as Mathan (1 and 😎 I get the error 16 (directory cannot be removed) from the card, what ever that's suppose to mean....

0 Kudos
Message 33 of 51
(4,335 Views)

Mariusra, Attach ur vi here. Its hard to guess where it went wrong. Please attach ur vi here so that its possible to identify where it went wrong.

 

Mathan

0 Kudos
Message 34 of 51
(4,324 Views)

Eit, I hope the problem is very minor one. The name from the readerlist has not been extracted correctly or has not been transferred to the next block i guess.

 

Post ur vi here so that i can help you out.

 

Mathan

0 Kudos
Message 35 of 51
(4,323 Views)

Thank you for replying, but I managed a work-around by using the SCardCLGetUID from the scardsyn library, instead of the SCardTransmit.

 

Anyways, I'll post the VI with the SCardTransmit in case you're interested.

Note that I had some problems with LabView crashing when I used blocks from your code, and I think it was some memory foul up because of incorrect types and/or undefined variables. As you can see I used the SCardListReadersA block from another VI in this thread, and this behaves correctly.

 

Marius 

0 Kudos
Message 36 of 51
(4,316 Views)

Finally i managed to get implement the scard transmit function. Posting it here for future reference. Mathan

0 Kudos
Message 37 of 51
(3,776 Views)

Hi Mathan

 

Can you also post a version of your TresMan.vi that is compatible with Labview 2011? I think this is just what I need to get my NFC project going. Thank you very much!

0 Kudos
Message 38 of 51
(3,717 Views)

Hey guys,

 

I have tried Mathan's implementation of the SCardTransmit and I think it works for me. Well, at least it returns a zero after each call of the function. But there is no data on the pbRecvBuffer. I don't know why. Please advise.

 

Bley

0 Kudos
Message 39 of 51
(3,700 Views)

Hello.

 

I've read this thread and I've found it really helpful! Thanks to Mathan and the rest of you guys.

 

I have a problem with the SCardTransmit function that maybe someone here can help me solve; I implemented Mathan's VI to my program and everything works fine until it gets to the SCardTransmit block, then it returns error code 80100004, which I found out it's for an invalid parameter.

 

I think the problem may be in the pioSendPci array (labeled with "[Protocol] [Length]" for convenience), more specifically the protocol, or maybe the instruction I send to the function.

 

Here's what I'm working with:

- Mifare Ultralight NFC Card

- ACS ACR122 Reader

 

The instruction I'm trying to send is a simple Write command, which is FF B0 00 04 04 (hex), and should return 4 bytes from the 4th page of the memory block.

 

Hope somebody can help me out. Thanks!

 

PS: Attached is the VI I'm using, for reference.

0 Kudos
Message 40 of 51
(3,558 Views)