Hello. I'm new to this forum. Hope that I don't make mistakes in here but if I do, please correct me if there is. Thanks.
I also wanted to ask you guys regarding about the following following source codes I'm going to post it here as I did a search here and did not find any question related to mine.
I'm doing an automatic inventory control system using RFID project and I'm instructed to extract the RFID transponder's ID and CRC and display it onto the form I've created using Visual Basic 6.0 before I touch up on the database portion which I need not need to worry much about. I managed to get the program to extract the transponder's ID and display it onto the textbox but I'm having problems extracting the CRC Hex value I'm not sure which part of the code I'm suppose to addon (See below). - Public Sub Display_Msg(sMsg As String)
-
-
frmMain.txtDisplay.Text = frmMain.txtDisplay.Text + sMsg
-
-
End Sub
-
-
Public Function Hex2Str(Hex_String As String) As String
-
Dim iPos As Integer
-
Dim iTemp As Integer
-
Dim sMsg As String
-
Dim b As String
-
Dim gPos As Integer
-
Dim g As String
-
-
-
For iPos = 8 To Len(Hex_String) - 2
-
iTemp = Asc(Mid$(Hex_String, iPos, 2))
-
-
If iTemp < 17 Then sMsg = sMsg + "0"
-
g = iTemp
-
b = b & Chr$(g)
-
sMsg = sMsg + Hex(iTemp) + " "
-
-
Next iPos
-
-
-
frmMain.txtDisplay.Text = frmMain.txtDisplay.Text & _
-
"PC -> Reader: 07 FF B0 01 00 1C 56" & vbCrLf
-
-
frmMain.txtDisplay.Text = frmMain.txtDisplay.Text & _
-
"PC <- Reader: " & sMsg & vbCrLf
-
taginput_crc = frmMain.txtDisplay.Text
-
-
frmMain.txtDisplay.Text = taginput_crc & _
-
"PC <- Reader: 11 FF B0 23 01 " & sMsg & "00 01 " & vbCrLf & vbCrLf
-
-
frmMain.MSComm1.Output = Chr$(&H11) + Chr$(&HFF) + Chr$(&HB0) & _
-
Chr$(&H23) + Chr$(&H1) + sMsg + Chr$(&H0) + Chr$(&H1) & _
-
frmMain.Text2.Text
-
-
frmMain.txtDisplay.Text = taginput_crc & _
-
"PC -> Reader: 11 FF B0 23 01 " & sMsg & "00 01 " & frmMain.Text2.Text & vbCrLf & vbCrLf
-
-
-
frmShoes.txtShoeTag.Text = "11 FF B0 23 01" & sMsg + "00 01"
-
frmShirt.txtShirtTag.Text = "11 FF B0 23 01" & sMsg + "00 01"
-
-
-
sbuffer = Chr$(&H11) + Chr$(&HFF) + Chr$(&HB0) + Chr$(&H23) + Chr$(&H1) + b + Chr$(&H0) + Chr$(&H1)
-
-
crc_output = CalcCRC16CheckSum(sbuffer, Len(sbuffer))
-
-
buflen = Len(sbuffer)
-
frmMain.Text1.Text = Len(sbuffer)
-
-
End Function
And also for example, if my CRC value is "D1B8" which isn't correct as the program calculates D1 as MSB and B8 as LSB, what must be edited to obtain the CRC value "B8D1" as this is actually the correct value (see below)? - Public Function CalcCRC16CheckSum(sbuffer As String, buflen As Byte) As Integer
-
-
Dim i, j As Byte
-
Dim wCrc As Integer
-
Initialise_mPower
-
wCrc = CRC16_PRESET
-
-
For i = 1 To buflen
-
-
wCrc = wCrc Xor Asc(Mid$(sbuffer, i, 1))
-
For j = 1 To 8
-
If (wCrc And &H1) Then
-
wCrc = LShift(wCrc, 1) Xor POLYNOM
-
Else
-
wCrc = LShift(wCrc, 1)
-
End If
-
Next j
-
Next i
-
-
crc_output = wCrc
-
-
frmMain.crcdisplay.Text = crc_output
-
a = Hex(crc_output)
-
frmMain.Text2.Text = a
-
-
End Function
-
-
Public Function LShift(ivalue As Integer, iBits As Integer) As Integer
-
-
If (ivalue And mPower2(15)) = mPower2(15) Then
-
LShift = (ivalue And &H7FFF) \ mPower2(iBits) Or mPower2(15 - iBits)
-
Else
-
LShift = ivalue \ mPower2(iBits)
-
End If
-
-
End Function
-
-
Public Function RShift(ivalue As Integer, iBits As Integer) As Integer
-
-
If (ivalue And mPower2(15 - iBits)) = mPower2(15 - iBits) Then
-
RShift = (ivalue And (mPower2(15 - iBits) - 1)) * mPower2(iBits) Or mPower2(15)
-
Else
-
RShift = (ivalue And (mPower2(15 - iBits) - 1)) * mPower2(iBits)
-
End If
-
-
End Function
Sorry if I posted a big chunk of code in here as I'm unsure of which portion of the code I'm suppose to look into.
Thanks for the help.
2 4158
I assuming that nobody could answer this? I have been waiting for a reply on this since last week. Thanks again.
Can't anyone help? If can't please let me know. Thank you.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Porthos |
last post by:
Hi All,
I've been working on mining data from a schema file (all attribute
data so far) and have come to the point where I need to get information
that is contained in tags. For instance, <tag>My Data Here</tag>.
I've tried using the <xsl:value-of select="tag"/> element, but it does
not appear to work in schema files. Is this correct? Is there another
way to get at this data?
-James
|
by: kies |
last post by:
Hi all, I'm currently trying to create an application that make use of the
RFID technology and i'm not too sure how to get about using the RFID. I was
wondering if any of you guys know of any good reasources about using RFID,
like how do i capture the tag ID using the reader and passing it into my
application. Thanks.
|
by: broadbandera |
last post by:
RFID Technology and Architecture, RFID Standards,RFID Applications,
RFID Security, Impact of RFID Tags on Recycling, Environmental
Challenges of RFID, RFID Tags: Advantages and Limitations,
http://flying-rugs.com/rfid-tutorial/
|
by: Peter Hansen |
last post by:
Im on a RFID application, in have a lot of problems, which I hope you kan
help me with.
Sourcefiles:
http://www.ti.com/rfid/docs/manuals/softwares/DLL.zip
Documentation
http://www.ti.com/rfid/docs/manuals/refmanuals/S6000ProgramLibraryFECOM.pdf
og
http://www.ti.com/rfid/docs/manuals/refmanuals/S6000ProgramLibraryFEISC.pdf
|
by: rsaikamesh |
last post by:
Hi,
I have connected RFID printer(Zebra R2844-Z) to serial port(dev/ttyS0). My OS is linux(ubuntu). I am using minicom for communication. I need to print some data using the RFID printer.
the following is the program which is written in ZPL language:
^XA
^LH30,30
^F020,10^AD^FDZEBRA^FS
^F020,60^B3^FDSMITHA NARENDRA^FS
^XZ
| |
by: rsaikamesh |
last post by:
Hi,
I have connected RFID printer(Zebra R2844-Z) to the serial port(dev/ttyS0).
My OS is linux(ubuntu). I need to read the RFID tag using a c++ program.I don't know anything about how to read RFID tags.I don't even have a clue. so please help me.If possible send me an example code, otherwise please atleast give me some clues.
|
by: rsaikamesh |
last post by:
Hi,
I have connected RFID printer(Zebra R2844-Z) to the serial port(/dev/ttyS0).My OS is linux(ubuntu).
The following is a program which is written in ZPL:
^XA
^RI0,,5^FS
^FO20,120^A0N,60^FN0^FS
^HV0,,Tag ID:^FS
|
by: BLUE |
last post by:
Psion WorkAbout Pro with Windows CE .NET 4.2
Dealer gave me PowerAPIOn.exe and PowerAPIOff.exe to turn on/off tag reader,
but I want to do it programmatically and do the same with WiFi and Bluetooth
as I can do from Control Panel ("Network and dialup connections" and
"Power").
Googling I've found that I should:
|
by: amgold |
last post by:
i am a beginner
i would like to know how to write a programme that will transfer information from an RFID tag to a MS access database
and also is it possible to intergrate ms access to ms project?
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |