LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SCardTransmit function output only shows during highlight execution

Hi guys,

 

I am currently playing with the winscard.dll to control an NFC card reader with labview. I used information from a lot of threads on this forum and I am now able to successfully send commands to the card. The problem though is that the pbRecvBuffer is only able to receive the reply data from the card reader when I execute the program with highlight execution. Otherwise, no data is written to the buffer.

 

I wonder if it's in the delay in the execution of the command that allows labview to receive the reply data? But how do I put this kind of delay? Or how do I simulate the highlight execution programatically?

 

Thanks in advance!

 

_bley_

0 Kudos
Message 1 of 3
(2,891 Views)

Hi BleyBley 

,

 

Have you checked for 'race conditions' in your code?, sometimes the highlight executions delay compensates the effect of a race condition but when you run the code without it the race condition occurs.

0 Kudos
Message 2 of 3
(2,736 Views)

Thanks for the reply Danubio.

 

I highly doubt though that a 'race condition' occurs in the code. As I understand it, it occurs when parallel data flows are accessing the same variable. You'll see in the code, however, that there are no parallel data flows. I have got my project working, though. I just updated to labview 2013 and used Mathan's VI as a template. I got it from the following thread:

 

http://forums.ni.com/t5/LabVIEW/pc-sc-Scardtransmit/td-p/815089/page/4

 

I am now able to control my NFC card and reader fully. Thanks for the heads up on 'race conditions' anyway!

 

_bley_

0 Kudos
Message 3 of 3
(2,543 Views)