Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
4
Answers
Splitting the data received from serial port
Samuel Vaesy
16y
8.6k
1
Reply
Hello,
I'm having a problem trying to solve how to split data received from serial port. The basic idea is to receive measurement data from serial port and then save it to .xml file.
So far I have other "modules" in my software working but I haven't yet figured how to split the data and save it to the .xml file properly. The data I receive is a list of measurement values separated by comma and with start and stop letters. length and form of the received data will be always same, only measurement values change...
So it'll look like this: &,24,21,53,54,33,24,36,37,54,33,33,22,33,23,$
How should this be splitted so that it would be easiest to save to .xml file?
form of the .xml file is something like:
<sensor1>
<name>temp1</name>
<value>"first received value"</value>
</sensor1>
I'm quite new to C#, previously I have coded only C-language and some HTML stuff, so my ideas might have been a bit too "conservative" ;)
- Vertti
Post
Reset
Cancel
Answers (
4
)
Next Recommended Forum
how to get IIS web site directory
Problem with C# (VS2008) while report to Report Viewer