|
-
June 8th, 2012, 06:34 AM
#16
Re: Parse file in vc++
Implement the Parser for bin files which is in the .sx file. Please kindly help me ASAP.
Motorola S-records
The general format of an S-record follows:
+-------------------//------------------//-----------------------+
| type | count | address | data | checksum |
+-------------------//------------------//-----------------------+
-----------------------please below is file need to parse.
S011000000486578766965772056312E3035D4
S244008000A500000000008150FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD
S2440080400000800000008000000000080000804000008040000000C800008108000081080000020C0001000000010000000001000001010000010100000000A800011000CB
S244008080000110000000E4B00001F4B00001F4B0000000840001F5340001F534000000080001F53C0001F53C000000080001F5440001F544000005800001FAC40001FAC409
S2440080C00000087000020800400013400000030800020B0840001648000000340000000000000000000000004000000000001340400016800000058440001C0800000424F6
like this several S-Rec...
-
June 8th, 2012, 06:48 AM
#17
Re: Parse file in vc++
 Originally Posted by Rajendramaraveni
The general format of an S-record follows:
+-------------------//------------------//-----------------------+
| type | count | address | data | checksum |
+-------------------//------------------//-----------------------+
-----------------------please below is file need to parse.
How are these fields delimited?
Victor Nijegorodov
-
June 8th, 2012, 07:17 AM
#18
Re: Parse file in vc++
 Originally Posted by VictorN
How are these fields delimited?
They aren't. They have fixed sizes.
-
June 8th, 2012, 07:28 AM
#19
Re: Parse file in vc++
 Originally Posted by Skizmo
They aren't. They have fixed sizes.
Well, that makes the task for OP easier!
Dear Rajendramaraveni,
did you read the post from GCDEF:
Look at CStdioFile and CString::Tokenize().
Did you look at these classes (CStdioFile and CString) description in MSDN?
Victor Nijegorodov
-
June 8th, 2012, 11:01 AM
#20
-
June 11th, 2012, 02:08 AM
#21
Re: Parse file in vc++
S011000000486578766965772056312E3035D4
I defined the structure Srec based on S-Record and using CMap(KEY,Srec).
Please kindly how to Implement CMap.
-
June 11th, 2012, 02:13 AM
#22
Re: Parse file in vc++
What CMap do you mean? For example, the MFC CMap template requires 4 "arguments" and is written like
Code:
template< class KEY, class ARG_KEY, class VALUE, class ARG_VALUE >class CMap : public CObject
What about "your" CMap?
cmap mfc example
Last edited by VictorN; June 11th, 2012 at 02:17 AM.
Victor Nijegorodov
-
June 11th, 2012, 03:31 AM
#23
Re: Parse file in vc++
struct Srec{
Startcode char;
Record type unsigned short int;
Bytecount unsigned short int;
Address unsigned long;
Data Cstring;
Checksum unsigned short int;
}
CMap <KEY,Srec>
In my CMap what should be the key value?
Basede the key will get the data... I am new to vc++ please...
-
June 11th, 2012, 03:41 AM
#24
Re: Parse file in vc++
 Originally Posted by Rajendramaraveni
struct Srec{
Startcode char;
Record type unsigned short int;
Bytecount unsigned short int;
Address unsigned long;
Data Cstring;
Checksum unsigned short int;
}
CMap <KEY,Srec>
In my CMap what should be the key value?
Please, stop posting such a "pseudo"-code snippets. If you have no idea what CMap is - read about it in MSDN first.
If you"d like to post some code snippet - use Code tags. And, please, read Announcement: Before you post....
 Originally Posted by Rajendramaraveni
Basede the key will get the data... I am new to vc++ please...
Then you have first learn the C++/VC++ and then start with something like "Hello World!" application.
Victor Nijegorodov
-
June 11th, 2012, 07:07 AM
#25
Re: Parse file in vc++
Why a CMap? If you know you need a map, you'd know what the key should be. If you don't know what to use for the key, you probably don't want a map.
-
June 11th, 2012, 10:17 AM
#26
Re: Parse file in vc++
That link I posted was to source code that handles Motorola S-records...
Did you read it?
-
June 11th, 2012, 10:53 PM
#27
Re: Parse file in vc++
Please How to read line by character by character or line by line...
-
June 12th, 2012, 12:08 AM
#28
Re: Parse file in vc++
 Originally Posted by Rajendramaraveni
Please How to read line by character by character or line by line...
Well, why don't you find a good book on C++ basics?
Last edited by Igor Vartanov; June 12th, 2012 at 12:21 AM.
Best regards,
Igor
-
June 12th, 2012, 08:38 AM
#29
Re: Parse file in vc++
 Originally Posted by Igor Vartanov
Well, why don't you find a good book on C++ basics?
I created CMap and how to map various fields according my .sx file Motorola
S-record format.S00600004844521B
Please kindly help me.
-
June 12th, 2012, 08:50 AM
#30
Re: Parse file in vc++
 Originally Posted by Rajendramaraveni
I created CMap and how to map various fields according my .sx file Motorola
S-record format.S00600004844521B
Please kindly help me.
This is getting silly. You're repeating yourself endlessly and ignoring everything people are telling you. Your question still isn't even making sense. If you have no C++ experience at all, a forum can't help you. It doesn't work that way. If you don't understand what people are saying, ask for clarification, or better yet, at least get familiar with the fundamentals of the language, but be prepared to spend some time on it. I, and I think others asked what you need to parse and why you need a map and you didn't respond.
Repeating yourself endlessly isn't working for you. Try something different.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|