|
-
March 11th, 2012, 10:23 AM
#9
Re: How to find specific characters(items) in string array(or list) and then merge th
Well, it is very difficult to try and figure out across the web However, yes, I think it might be in the ASCII conversion or how the COMM port is set up. No programmer in their right mind would output text in the format you have right now. I have connected to a PBX before and once you get the comm setup properly, it should send the data to you in a nice format like you wanted to see it in your first post. Now it might not come through all at once like that. So for example, you might get a sequence like this.
"Comm Event Fires"
3/7/12 3:50PM 108 02 60600
"Comm Event Fires"
01108 00:00'48" ....
3/7/12 3:5
"Comm Event Fires"
1PM 102 01 00491734973369
"Comm Event Fires"
00:00'33" ....
3/7/12 3:51PM 102 02
"Comm Event Fires"
00491734973369 00:00'43" ....
3/7/12 3:5
"Comm Event Fires"
4PM 102 02 00491734
"Comm Event Fires"
973369 00:00'21" ....
3/7/12 3:55PM 102 02
"Comm Event Fires"
044659912 00:00'24" ....
However, once you put it all together (as long as your don't do any thing to the data) it will look like this...
3/7/12 3:50PM 108 02 6060001108 00:00'48" ....
3/7/12 3:51PM 102 01 00491734973369 00:00'33" ....
3/7/12 3:51PM 102 02 00491734973369 00:00'43" ....
3/7/12 3:54PM 102 02 00491734973369 00:00'21" ....
3/7/12 3:55PM 102 02 044659912 00:00'24" ....
When I was doing my checking, I would build the string out, check if I had a complete line, then process that complete line. I didn't do any processing until I had the complete line, and a lot of the time, there were left over characters that I had to wait for the next comm event to get the rest of the line. I think you may be in the same situation.
Tags for this Thread
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
|