View previous topic :: View next topic |
Author |
Message |
mutthunaveen
Joined: 08 Apr 2009 Posts: 100 Location: Chennai, India
|
VB6.0 code for CRC16 (RTU protocal) |
Posted: Wed Aug 11, 2010 5:33 am |
|
|
dear forum
can any one please give me the code (or links) for calculating CRC16 code in VB6.0.... i studeid a lot in the VB6.0 (actually Googled) i found some but they are not that perfect then what i expect.... even i tried to write the algo but i have problems with Right rotate accumulator (that is variable in the VB) and also problem with defining the 16 bit register... ( for 8 bit(1byte) it is "easy dim x as BYTE" but for 2 bytes )
please some one help me ......... |
|
|
collink
Joined: 08 Jan 2010 Posts: 137 Location: Michigan
|
Re: VB6.0 code for CRC16 (RTU protocal) |
Posted: Wed Aug 11, 2010 5:37 am |
|
|
mutthunaveen wrote: | dear forum
can any one please give me the code (or links) for calculating CRC16 code in VB6.0.... i studeid a lot in the VB6.0 (actually Googled) i found some but they are not that perfect then what i expect.... even i tried to write the algo but i have problems with Right rotate accumulator (that is variable in the VB) and also problem with defining the 16 bit register... ( for 8 bit(1byte) it is "easy dim x as BYTE" but for 2 bytes )
please some one help me ......... |
This is a forum dedicated to discussing PIC programming with the CCS compiler. VB6 on a PC is neither. Keep searching google. VB6 is ancient, I'm sure someone has done exactly what you want. |
|
|
mutthunaveen
Joined: 08 Apr 2009 Posts: 100 Location: Chennai, India
|
|
Posted: Wed Aug 11, 2010 9:20 am |
|
|
thanks collink.... yes this is a ccs forum....
but some one who are using this forum may used this VB6.0 for MODBUS protocol.... between PC and PIC... they might help me in giving the code.... thanks |
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Wed Aug 11, 2010 9:55 am |
|
|
May be you would like to know this regarding the CRC16 for MODBUS protocol, CCS uses the same CRC16
table as defined in the Modbus Standard, it is plain table assignment, not a complex algoritm.
Humberto |
|
|
mutthunaveen
Joined: 08 Apr 2009 Posts: 100 Location: Chennai, India
|
|
Posted: Wed Aug 11, 2010 9:57 am |
|
|
Humberto wrote: | May be you would like to know this regarding the CRC16 for MODBUS protocol, CCS uses the same CRC16
table as defined in the Modbus Standard, it is plain table assignment, not a complex algoritm.
Humberto |
hi bro can u please explain me in detail.... how can i use this and implement MODBUS between PC and PIC... |
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Wed Aug 11, 2010 10:16 am |
|
|
Quote: |
even i tried to write the algo but i have problems with Right rotate accumulator (that is variable in the VB) and
also problem with defining the 16 bit register... ( for 8 bit(1byte) it is "easy dim x as BYTE" but for 2 bytes
|
This is a C forum, my intention was just to give you a clue regarding how to get the CRC16, I assume that if you
could write it in VB a mathematical algoritm approach to calculate it, you can do it applying the table assignement
method, that is used by CCS.
Humberto |
|
|
|