PDA

View Full Version : كارت خوانrfid +pr101



samira3
چهارشنبه 04 بهمن 1391, 08:08 صبح
سلام
اميدوارم اين دفعه من حذف نكنيد
كارت خوان pr101 ويك كارت label+hf دارم
لينك كارت خوان
http://www.feig.de/uploads/media/Data_sheet_ID_ISC.PR101.pdf
لينك كارت

http://www.fastrfid.com/hf_tags_raflatac.html
دومي كارت

لينك برنامه
http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/APPLICATION_NOTE/CD00275180.pdf
برنامه كه توضيح كد

ميخواستم ببينم كسي كدش زده يا نه
من الان تا كانكت پيش رفتم يعني كد زدم هنوز اجرا نگرفتم اگر بشه اروز سعي مي كنم تا بقيه اش بزنم
حالا از دوستان كسي هست . تا چندتا سوال كنم .
خيلي هم گشتم هيچ نمونه كدي نداره فقط همين لينك زير خوب بود
من سعي مي كنم ولي...:گریه::گریه:

من برنامه آقاي صادقي كه مال كارت مايفر بود ديدم

uniqueboy_ara
چهارشنبه 04 بهمن 1391, 11:08 صبح
ببخشید، میشه یه توضیح مختصر بدید که این کارت ها به چه دردی می خورن، یا کلا کاربردشون و امکاناتشون چیه؟ :)

samira3
چهارشنبه 04 بهمن 1391, 11:21 صبح
اينا واسه rfid شناسايي با استفاده از فركانس راديويي
مثل استخر كه با يك تگ در كمدتان باز مي شه
http://barnamenevis.org/showthread.php?205681-%D9%86%D8%AD%D9%88%D9%87-%D8%A7%D8%B3%D8%AA%D9%81%D8%A7%D8%AF%D9%87-%D8%A7%D8%B2-%D8%AF%D8%B3%D8%AA%DA%AF%D8%A7%D9%87-RFT-200&highlight=%D9%83%D8%A7%D8%B1%D8%AA
من كد زدم
تو همون قسمت اتصال مشكل خوردم با عرض پوزش كدام vb‌
براتون مي زارم
ببينيد شما متوجه مي شويد مشكل كجاست

samira3
چهارشنبه 04 بهمن 1391, 11:27 صبح
كد برنامه من خيلي شبيه كد آقاي صادقي


Imports Microsoft.VisualBasic
Imports System.Runtime.InteropServices

Public Class Class1



' constants for uiFlag in FEUSB_MSG_INIT
Public Const FEUSB_THREAD_ID = 1 'not useable in Visual Basic
Public Const FEUSB_WND_HWND = 2 'not useable in Visual Basic
Public Const FEUSB_CALLBACK = 3

' defines for uiUse in FEUSB_EVENT_INIT
Public Const FEUSB_DEV_CONNECT_EVENT = 1
Public Const FEUSB_DEV_DISCONNECT_EVENT = 2

' scan options
Public Const FEUSB_SCAN_FIRST = &H1
Public Const FEUSB_SCAN_NEXT = &H2
Public Const FEUSB_SCAN_NEW = &H3
Public Const FEUSB_SCAN_ALL = &HF
Public Const FEUSB_SCAN_SEARCH = &H10000
Public Const FEUSB_SCAN_PACK = &H20000

' search options
Public Const FEUSB_SEARCH_FAMILY = &H1
Public Const FEUSB_SEARCH_PRODUCT = &H2
Public Const FEUSB_SEARCH_DEVICEID = &H4

' communication directions
Public Const FEUSB_DIR_IN = 1
Public Const FEUSB_DIR_OUT = 2

' Interface names
Public Const FEUSB_INTERFACE_OBID_RCI = "OBID-RCI"
Public Const FEUSB_INTERFACE_OBID_RCI_V2 = "OBID-RCI2"


' structure for transfering callback functions
Structure FEUSB_EVENT_INIT
Dim uiUse As Integer ' defines the event (e.g. FEUSB_DEV_CONNECT_EVENT)
Dim uiMsg As Integer ' set always to 0 - in Visual Basic not used !!
Dim uiFlag As Integer ' specifies the use of the Variant (e.g. FEUSB_CALLBACK)
Dim Method As Integer ' for callback-function
End Structure

' new datatype
Structure FeusbScansearch
Dim iMask As Integer
Dim cFamily As String()
Dim cProduct As String()
Dim cInterface As String()
Dim cDeviceID As String()

End Structure



' common functions
Public Declare Sub FEUSB_GetDLLVersion Lib "FEUSB.DLL" (ByVal cVersion As String)
Public Declare Function FEUSB_GetErrorText Lib "FEUSB.DLL" (ByVal iError As Integer, ByVal cText As String) As Integer
Public Declare Function FEUSB_GetLastError Lib "FEUSB.DLL" (ByVal iDevHnd As Integer, ByVal iErrorCode As Integer, ByVal cErrorText As String) As Integer

' scan functions
'<DllImport("FEUSB.DLL")> _
'Public Shared Function FEUSB_Scan(ByVal iScanOpt As Integer, ByVal searchOpt As FeusbScansearch) As Integer
'End Function
Public Declare Function FEUSB_Scan Lib "FEUSB.DLL" (ByVal iScanOpt As Integer, ByVal searchOpt As FeusbScansearch) As Integer
Public Declare Function FEUSB_ScanAndOpen Lib "FEUSB.DLL" (ByVal iScanOpt As Integer, ByVal searchOpt As FeusbScansearch) As Integer
Public Declare Function FEUSB_GetScanListPara Lib "FEUSB.DLL" (ByVal iIndex As Integer, ByVal cPara As String, ByVal cValue As String) As Integer
Public Declare Function FEUSB_GetScanListSize Lib "FEUSB.DLL" () As Integer
Public Declare Sub FEUSB_ClearScanList Lib "FEUSB.DLL" ()

' functions for event notification
Public Declare Function FEUSB_AddEventHandler Lib "FEUSB.DLL" (ByVal iPortHnd As Integer, ByVal pInit As FEUSB_EVENT_INIT) As Integer
Public Declare Function FEUSB_DelEventHandler Lib "FEUSB.DLL" (ByVal iPortHnd As Integer, ByVal pInit As FEUSB_EVENT_INIT) As Integer

' device functions
Public Declare Function FEUSB_OpenDevice Lib "FEUSB.DLL" (ByVal dwDeviceID As Integer) As Integer
Public Declare Function FEUSB_CloseDevice Lib "FEUSB.DLL" (ByVal iDevHnd As Integer) As Integer
Public Declare Function FEUSB_IsDevicePresent Lib "FEUSB.DLL" (ByVal iDevHnd As Integer) As Integer
Public Declare Function FEUSB_GetDeviceList Lib "FEUSB.DLL" (ByVal iNext As Integer) As Integer
Public Declare Function FEUSB_GetDeviceHnd Lib "FEUSB.DLL" (ByVal dwDeviceID As Integer) As Integer
Public Declare Function FEUSB_GetDevicePara Lib "FEUSB.DLL" (ByVal iDeviceHnd As Integer, ByVal cParaID As String, ByVal cValue As String) As Integer
Public Declare Function FEUSB_SetDevicePara Lib "FEUSB.DLL" (ByVal iDeviceHnd As Integer, ByVal cParaID As String, ByVal cValue As String) As Integer

' communication function
Public Declare Function FEUSB_Transceive Lib "FEUSB.DLL" (ByVal iDevHnd As Integer, ByVal cInterface As String, ByVal iDir As Integer, ByVal cSendData As String, ByVal iSendLen As Integer, ByVal cRecData As String, ByVal iRecLen As Integer) As Integer
Public Declare Function FEUSB_Transmit Lib "FEUSB.DLL" (ByVal iDevHnd As Integer, ByVal cInterface As String, ByVal cSendData As String, ByVal iSendLen As Integer) As Integer
Public Declare Function FEUSB_Receive Lib "FEUSB.DLL" (ByVal iDevHnd As Integer, ByVal cInterface As String, ByVal cRecData As String, ByVal iRecLen As Integer) As Integer


Public Declare Function FEISC_NewReader Lib "FEISC.DLL" (ByVal iPortHnd As Integer) As Integer

End Class


بعد هم براي اتصال اين كد

'--- global variable to manage FEUSB handle
Public glngFEUSBhandle As Integer
'--- global variable to manage FEISC handle
Public lngAttachedDeviceHandle() As Integer
Dim FEUSB_ERR_NO_DEVICE_FOUND As Integer = -1112
Private _lngDeviceHnd As Integer

Private Property lngDeviceHnd(ByVal i As Integer) As Integer
Get
Return _lngDeviceHnd
End Get
Set(ByVal value As Integer)
_lngDeviceHnd = value
End Set
End Property

'--- Detect FEIG USB readers (detected=true, non-detected=false) ---
Private Function detect_USB_FEIG_reader(s As String) As Boolean
Dim Back As Integer
Dim i As Integer
Dim Cnt As Integer
Dim Char1 As String
Dim CharCnt As Integer
Dim oSearch As FeusbScansearch
Dim lngReaderNumber As Integer
Dim error1 As Integer
Dim DeviceHnd As Long
Dim lngDeviceId(0 To 15) As Integer
Dim strFamilyName(0 To 15) As String
Dim strDeviceName(0 To 15) As String
Dim lngPresent(0 To 15) As Integer
Dim strDeviceHnd(0 To 15) As String

Dim strPresent(0 To 15) As String
Dim strDeviceID(0 To 15) As String
Dim dwHandle As Integer
Dim iHandle As Integer
'init display
'txtDetectResult.Text = ""
oSearch.iMask = 0


'--- Clear Scan List (dll function)
FEUSB_ClearScanList() ' should be called before every scan process
'--- scan and open in one process (dll function)
DeviceHnd = FEUSB_Scan(FEUSB_SCAN_ALL, oSearch)

If (DeviceHnd = FEUSB_ERR_NO_DEVICE_FOUND) Then
'--- txtScannedReaders.Text = "NO READER DETECTED"
Else
'---Number of USB device connected
lngReaderNumber = FEUSB_GetScanListSize
For i = 1 To lngReaderNumber
'--- Get System parameters of all detected USB devices
error1 = FEUSB_GetScanListPara(0, "DeviceHnd", strDeviceHnd(i))
error1 = FEUSB_GetScanListPara(0, "FamilyName", strFamilyName(i))
error1 = FEUSB_GetScanListPara(0, "DeviceName", strDeviceName(i))
error1 = FEUSB_GetScanListPara(0, "Present", strPresent(i))
error1 = FEUSB_GetScanListPara(0, "Device-ID", strDeviceID(i))
'--- decode lngDeviceHnd(i) value
CharCnt = 0
lngDeviceHnd(i) = 0
For Cnt = 1 To 8
Char1 = UCase(Mid(strDeviceHnd(i), 9 - Cnt, 1))
If ((Char1 >= "0") And (Char1 <= "9")) Then
lngDeviceHnd(i) = lngDeviceHnd(i) + (Asc(Char1(0)) - 48) * _
(16 ^ CharCnt)
CharCnt = CharCnt + 1

End If
If ((Char1 >= "A") And (Char1 <= "F")) Then
lngDeviceHnd(i) = lngDeviceHnd(i) + (Asc(Char1(0)) - 55) * _
(16 ^ CharCnt)
CharCnt = CharCnt + 1
End If
Next Cnt
'--- decode strFamilyName(i) value
strFamilyName(i) = ""
For Cnt = 1 To 25
Char1 = UCase(Mid(strFamilyName(i), Cnt, 1))
If (((Char1 >= "0") And (Char1 <= "9")) Or _
((Char1 >= "A") And (Char1 <= "Z")) Or _
(Char1 = "-") Or (Char1 = ".") Or (Char1 = " ")) Then
strFamilyName(i) = strFamilyName(i) & Char1
End If
Next Cnt
'--- decode strDeviceName(i) value
strDeviceName(i) = ""
For Cnt = 1 To 25
Char1 = UCase(Mid(strDeviceName(i), Cnt, 1))
If (((Char1 >= "0") And (Char1 <= "9")) Or ((Char1 >= "A") _
And (Char1 <= "Z")) Or (Char1 = "-") Or (Char1 = ".") Or _
(Char1 = " ")) Then
strDeviceName(i) = strDeviceName(i) & Char1
End If
Next Cnt
'-- decode strDeviceID value
CharCnt = 0
lngDeviceId(i) = 0
For Cnt = 1 To 8
Char1 = UCase(Mid(strDeviceID(i), 9 - Cnt, 1))
If ((Char1 >= "0") And (Char1 <= "9")) Then
lngDeviceId(i) = lngDeviceId(i) + (Asc(Char1(0)) - 48) * _
(16 ^ CharCnt)
CharCnt = CharCnt + 1
End If
If ((Char1 >= "A") And (Char1 <= "F")) Then
lngDeviceId(i) = lngDeviceId(i) + (Asc(Char1(0)) - 55) * _
(16 ^ CharCnt)
CharCnt = CharCnt + 1
End If
Next Cnt
'-- decode strPresent value
CharCnt = 0
lngPresent(i) = 0
For Cnt = 1 To 8
Char1 = UCase(Mid(strPresent(i), 9 - Cnt, 1))
If ((Char1 >= "0") And (Char1 <= "9")) Then
lngPresent(i) = lngPresent(i) + (Asc(Char1(0)) - 48) * _
(16 ^ CharCnt)
CharCnt = CharCnt + 1
End If
If ((Char1 >= "A") And (Char1 <= "F")) Then
lngPresent(i) = lngPresent(i) + (Asc(Char1(0)) - 55) * _
(16 ^ CharCnt)
CharCnt = CharCnt + 1
End If
Next Cnt
'--- summary of Detected Device parameters for One USB device
'- txtDeviceHandle.Text = "DeviceHnd : " & lngDeviceHnd(i)
'- txtFamilyName.Text = "FamilyName : " & strFamilyName(i)
'- txtDeviceName.Text = "DeviceName : " & strDeviceName(i)
'- txtPresent.Text = "Present : " & CLng("&h" & lngPresent(i))
'- txtDeviceID.Text = "Device-ID : " & lngDeviceId(i)
Next i
End If
'--- analysis if FEIG USB readers are connected and how much
If (lngReaderNumber = 0) Then
'--- NO FEIG USB device detected
'txtDetectResult.Text = "No FEIG USB Reader detected"
detect_USB_FEIG_reader = False
ElseIf (lngReaderNumber > 1) Then
'--- TOO MUCH DETECTED FEIG USB READERs
'txtDetectResult.Text = "Too much FEIG USB Reader detected"
detect_USB_FEIG_reader = False
ElseIf (lngReaderNumber = 1) Then
'--- only One FEIG USB device detected OK
glngFEUSBhandle = FEUSB_OpenDevice(lngDeviceId(1))
If (glngFEUSBhandle < 0) Then
error1 = FEUSB_CloseDevice(glngFEUSBhandle)
detect_USB_FEIG_reader = False
Else
lngAttachedDeviceHandle(0) = FEISC_NewReader(glngFEUSBhandle)
detect_USB_FEIG_reader = True
End If
End If
End Function

بعد هم فراخواني
detect_USB_FEIG_reader()
من خطي كه
FEUSB_Scan(FEUSB_SCAN_ALL, oSearch)
خطا مي ده
PInvokeStackImbalance was detected Message
مي ده كه جستجو كردم علت نوع long
كه گفته بودن به integerبشه
من اين تغيير را هم دادم
باز خطا مي گيره لطفا كمك كنيد.

samira3
چهارشنبه 04 بهمن 1391, 14:10 عصر
كسي نيست جواب بده