LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

MicroSD card reading/writing/formating using LabVIEW

Hi all, 

 

I want to develop a test equipment that is capable to test Memory cards used in phones. In the test process at  first the card should be formatted then write some data into it ,read that data and again should be formatted.

 ie.  1.formating

      2.writing

      3.reading

      4.formating 

 

The first formatting part I have done using calling a SHFormatDrive in shell32.dll and then I got stuck in WRITING AND READING DATA on to the card  .I planned to do it by using winscard.dll .But Im confused what are the functions to be called.Im using LabVIEW 8.5.Please help.

Message Edited by george_82 on 12-11-2009 12:56 AM
Message Edited by george_82 on 12-11-2009 12:58 AM
0 Kudos
Message 1 of 12
(5,505 Views)
0 Kudos
Message 2 of 12
(5,490 Views)

Yes I checked that discussions but when i run that Reading Smart Card w SCR3351.vi  

then Im getting the card status return ,card connect return,Disconnect return and release context return  as 6.   My winscard.dll version is 5.1.2600.0.I tried all the suggestions mentioned in that discussion.

 

Operating system is windows XP professional.

LabVIEW version 8.6 

 

 



 

Message Edited by george_82 on 12-11-2009 04:09 AM
0 Kudos
Message 3 of 12
(5,473 Views)

Did you really moved from 8.5 to 8.6 in a single day? That's great.

 

Ok coming to your problem. You said only few of the functions are failing with error 6. What happened to the first 2 functions? I mean don't you get any errors with scardestablishcontext and scardlistreaders function? Did your reader got listed in it and you are selecting that particular reader name only to pass it to scardconnect function?

 

Trying to help

Mathan 

0 Kudos
Message 4 of 12
(5,461 Views)

 Hello,

 

 Please find the below vi to check the status of my smart card .I am new in using DLL in LabVIEW so can I know whether procedures are correct in this code.

 

Scard status check

Message Edited by george_82 on 12-12-2009 09:08 AM
Message 5 of 12
(5,431 Views)

You did not answered any of my question. You need lot of changes. You have to change the protocol value input. Try this one and let me know whether it work. Go step by step. Check whether the scardestablishcontext returns any error code and if not go for scardlistreaders. Check whether the reader name got displayed. Then check scardconnect and if that passes then you will get the ATR value in scardstatus. Post back your findings.

 

 Temp.png

0 Kudos
Message 6 of 12
(5,383 Views)

Hi,

 

I checked SCardListReader output ...but even though there is no error Im not getting any output....Plz help..scardstatus.JPG

Message Edited by george_82 on 12-17-2009 02:26 PM
0 Kudos
Message 7 of 12
(5,355 Views)
Let's start this again

1) Is your reader name displayed in Device Manager under smart card readers section?
2) You are telling both scardestablishcontext and scardlistreaders functions get passed at that time what you are getting in the mszReaders output? 
3) Try increasing the readername length from 500 to 1000. Tell me how many smartcard readers are connected to the system at this point and what will be the full length of the readername.

Trying to help
0 Kudos
Message 8 of 12
(5,340 Views)

Actually Im communicating with the memory card  through a USB smart card reader. So  in devicemanager under disc drives “USB 2.0 SD MMC Reader USB device” is displayed.

 

scardestablishcontextand scardlistreaders functions are getting  passed without any errorsand at that time mszReader output which is a 1D array , is full of zeros.

 

Im gettinga return type value of  -2146435068.

 

 

I alsochanged pcchReaders to 1000 but nothing happened.

 

Smart cardis connected through a “Multi in onememory card reader USB 2.0”.At this time only one reader and one smart cardis connected to the system…in future I want to connect up to 10 cards or morefor testing.

 

Plz note Im using a MicroSD card and not a smart card....

 

0 Kudos
Message 9 of 12
(5,243 Views)

@george_82 wrote:
scardestablishcontextand scardlistreaders functions are getting  passed without any errorsand at that time mszReader output which is a 1D array , is full of zeros.

Im gettinga return type value of  -2146435068.  


 

 

Here is a contradiction in your statement. You told scardlistreaders function passed but in the below statement, you are telling it is returning error  -2146435068. So your reader name is not at all listed instead all are zeros. 

 

The error code in Hex is 80100004. That means, "One or more of the supplied parameters could not be properly interpreted" as per msdn library. So please post in detail how you are passing all the parameters in scardlistreaders function. Please post your updated vi so that i will check it out.

 

Trying to help, 

Mathan 

0 Kudos
Message 10 of 12
(5,221 Views)