[Article based on BioStarSDK_V2.6.2.2_20181004]


If you've tried searching Wiegand devices with the SDK sample Wiegand Control, you may have run into the error below.


image  

[screenshot is of a altered version of Slave control where I added the Wiegand control code] 


This occurs because if the Convert.ToUInt32 value is less than 0 an error occurs. 


In that case change the code

UInt32 wiegandDeviceID = Convert.ToUInt32(Marshal.ReadInt32(wiegandDeviceObj, (int)idx * sizeof(UInt32)));


to below to resolve the issue


UInt32 wiegandDeviceID = (UInt32)(Marshal.ReadInt32(wiegandDeviceObj, (int)idx * sizeof(UInt32)));



image

image