Go to Post Who says engineers can't be poets? - Wayne TenBrink [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 06-03-2004, 13:28
Ian W. Ian W. is offline
College? What?
no team (Gompei and the Herd)
Team Role: College Student
 
Join Date: Jan 2002
Rookie Year: 2002
Location: Worcester, MA | Smithtown, NY
Posts: 1,464
Ian W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to all
Send a message via AIM to Ian W.
Weird Output from Dashboard Port

OK, this has me confused now.

I'm trying to modify a Dashboard program I made last year to work with this year's new packet structure. It's pretty much the same, still 26 bytes, just have to add in a part to decode which packet is which based on the two control bytes, right?

Well, when I run my Dashboard program, the data from the serial port makes no sense. Random numbers, sometimes each number is one greater than the one before it, etc. The IFI Dashboard works fine, so I would think that mine should be ok too, but it seems not.

Last year I had no trouble reading in each packet and manipulating it, unless I tried to multiplex the data, for some reason that never worked. I'm thinking I might be having a similar problem, but I have no idea how to tell. If anyone has any ideas, or would like for me to upload the code to test themselves and maybe find a problem I'll do that (it's currently on my other computer, not a huge problem, just can't do it right at the moment).
__________________
AIM --> Woloi
Email --> ian@woloschin.com
  #2   Spotlight this post!  
Unread 06-03-2004, 16:24
Ian W. Ian W. is offline
College? What?
no team (Gompei and the Herd)
Team Role: College Student
 
Join Date: Jan 2002
Rookie Year: 2002
Location: Worcester, MA | Smithtown, NY
Posts: 1,464
Ian W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to all
Send a message via AIM to Ian W.
Re: Weird Output from Dashboard Port

A bit of an update...

After playing around with the program a bit, I managed to get it to read in correct streams. There's some weird glitches though.

1) It doesn't seem to read in every packet, it likes to just completely ignore the third packet, like it never existed. According to my Dashboard (which I hope is reporting incorrectly), the first packet is received almost three times as much as the second, and the third is only received 79 times before it just stops coming up. Another test resulted in similar figures for the first two packets, but only 9 hits on the third.

2) The dashboard program does not read in the packets correctly until after I hit the "Pause/Break" button on the computer, and then the carriage return key. After pressing that, it usually seems to work fine, but there's no logic behind when it fails.

3) This is the part that makes me think the packets are not being read correctly, which should help solve problem #1. I tried to read individual bytes, and output their data, but it makes no sense and it's simply garbage.

I wish I had the 2003 controls so I could test and see what was wrong, but I have no idea as this same program worked perfectly fine last year .
__________________
AIM --> Woloi
Email --> ian@woloschin.com
  #3   Spotlight this post!  
Unread 06-03-2004, 20:19
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: Weird Output from Dashboard Port

DID YOU READ THE DOC? The bytes aren't ASCII, That's for the Prog port on the bot. I would try outputting the bytes (Translate to Hex string) as which # in the packet. That may solve problems. And what language are you using?
  #4   Spotlight this post!  
Unread 06-03-2004, 20:38
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: Weird Output from Dashboard Port

Something else: How do we know OI packets from RC packets? Or the beggining from 2 high user bytes? (Frame 2)
And I belive that you only get frame 3 20 times a second; the info is unlikely to change that quickly (Except pwm 15 & 16, but those are covered by frame 2).
  #5   Spotlight this post!  
Unread 06-03-2004, 20:40
Ian W. Ian W. is offline
College? What?
no team (Gompei and the Herd)
Team Role: College Student
 
Join Date: Jan 2002
Rookie Year: 2002
Location: Worcester, MA | Smithtown, NY
Posts: 1,464
Ian W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to all
Send a message via AIM to Ian W.
Re: Weird Output from Dashboard Port

Quote:
Originally Posted by Astronouth7303
DID YOU READ THE DOC? The bytes aren't ASCII, That's for the Prog port on the bot. I would try outputting the bytes (Translate to Hex string) as which # in the packet. That may solve problems. And what language are you using?
Yes, I've read the documents, I've read all of them, actually, from 2000 to 2004, in hopes of finding answers. In fact, none of the ports on the OI or RC talk in ASCII, they all talk in hex. It'd make no sense for computers to talk using ASCII, as ASCII was made for displaying characters and such for humans to understand, not microprocessors.

I'm using C/C++ with VS.net.

As for the problems I was having, I actually found the solution by accident.

Apparently I had done something bad with the serial port, forgot to close it, I think, or closed the program incorrectly so it didn't get a chance to close. Due to this, I was unable to correctly reopen it, and that created garbage data. A simple reboot, while 5 minutes long (I'm using an old PII laptop trying to run Win2k), fixed the problem.

If anyone knows how to close an opened serial port after the program that opened it has aborted, can you please share? That would save me, and probably plenty of others, a bunch of time in the pits .

And, as a message of help to everyone, if you ever have strange problems with your serial port, just reboot, don't waste an entire day on it .
__________________
AIM --> Woloi
Email --> ian@woloschin.com
  #6   Spotlight this post!  
Unread 06-03-2004, 20:50
Ian W. Ian W. is offline
College? What?
no team (Gompei and the Herd)
Team Role: College Student
 
Join Date: Jan 2002
Rookie Year: 2002
Location: Worcester, MA | Smithtown, NY
Posts: 1,464
Ian W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to all
Send a message via AIM to Ian W.
Re: Weird Output from Dashboard Port

Quote:
Originally Posted by Astronouth7303
Something else: How do we know OI packets from RC packets? Or the beggining from 2 high user bytes? (Frame 2)
And I belive that you only get frame 3 20 times a second; the info is unlikely to change that quickly (Except pwm 15 & 16, but those are covered by frame 2).
Did you read the documentation?

Page 2, under notes...

"1. The IFI Dashboard Viewer now interprets the incoming data and changes the display window depending on the OI/RC jumper setting (located on the OI)."

Says right there how you know what packet (or packets) you're receiving, I'm sure you can find something in the packet stream to do it in software, but why bother when you can see it with your own eyes right on the OI?

You can tell the start of each frame by the two "flag" bytes. The first two bytes of each packet is 0xff,0xff while no where else in a packet can two consecutive bytes reach 0xff. That makes it very simple to find the beginning of a packet and keep yourself synchronized.

Infomation in Frame 3 is very important, actually. Two PWMs, the User Byte, the Battery Voltages (main and backup), and all the error codes (mostly in the Aux_Byte). Those are all pretty important, even if some is redundant. Plus, if I did infact create a bug that didn't display Frame 3 as much as the others, there'd be a problem, because what if next year Frame 3 was important? Just because something works now, doesn't mean you should leave it, make it work right. Also, if you get about 40 packets a second from the OI, it'd be more around 13 times a second to receive Frame 3, but that's a minor technical detail. Although, you receive Frame 3 just as many times as you receive the other frames in the stream, which I'm not sure you understood from the documentation that you obviously read.
__________________
AIM --> Woloi
Email --> ian@woloschin.com
  #7   Spotlight this post!  
Unread 06-03-2004, 20:50
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: Weird Output from Dashboard Port

Oh, I use the MSCOMM control with VB6. Very, very useful. And I know comps don't use ASCII. That's why IO asked (If you were outputting like it was, it would be garbage)

Do have answers to my other questions?
  #8   Spotlight this post!  
Unread 06-03-2004, 21:05
Ian W. Ian W. is offline
College? What?
no team (Gompei and the Herd)
Team Role: College Student
 
Join Date: Jan 2002
Rookie Year: 2002
Location: Worcester, MA | Smithtown, NY
Posts: 1,464
Ian W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to all
Send a message via AIM to Ian W.
Re: Weird Output from Dashboard Port

Quote:
Originally Posted by Astronouth7303
Oh, I use the MSCOMM control with VB6. Very, very useful. And I know comps don't use ASCII. That's why IO asked (If you were outputting like it was, it would be garbage)

Do have answers to my other questions?
Quote:
Originally Posted by Ian W.
Quote:
Originally Posted by Astronouth7303
DID YOU READ THE DOC? The bytes aren't ASCII, That's for the Prog port on the bot. I would try outputting the bytes (Translate to Hex string) as which # in the packet. That may solve problems. And what language are you using?
Yes, I've read the documents, I've read all of them, actually, from 2000 to 2004, in hopes of finding answers. In fact, none of the ports on the OI or RC talk in ASCII, they all talk in hex. It'd make no sense for computers to talk using ASCII, as ASCII was made for displaying characters and such for humans to understand, not microprocessors.

I'm using C/C++ with VS.net.

As for the problems I was having, I actually found the solution by accident.

Apparently I had done something bad with the serial port, forgot to close it, I think, or closed the program incorrectly so it didn't get a chance to close. Due to this, I was unable to correctly reopen it, and that created garbage data. A simple reboot, while 5 minutes long (I'm using an old PII laptop trying to run Win2k), fixed the problem.

If anyone knows how to close an opened serial port after the program that opened it has aborted, can you please share? That would save me, and probably plenty of others, a bunch of time in the pits .

And, as a message of help to everyone, if you ever have strange problems with your serial port, just reboot, don't waste an entire day on it .
Yes.
__________________
AIM --> Woloi
Email --> ian@woloschin.com
  #9   Spotlight this post!  
Unread 06-03-2004, 21:16
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: Weird Output from Dashboard Port

Quote:
Originally Posted by Ian W.
Yes.
Quote:
Originally Posted by Astronouth7303
How do we know OI packets from RC packets? Or the beggining from 2 high user bytes? (Frame 2)
1. If you look in the doc, there does not appear to be a 'signature' in the OI packet or any of the 3 RC packets. I think all 4 are transmitted (Switch the jumper). But how does the software know this?

2. If you set user bytes 2 and 3 to 0xFF, some software might confuse this with a beggining of a new packet.

So quoting yourself did not answer my questions/concerns. Again, I am suggesting posibilities which may (Or may not) need to be acounted for.
  #10   Spotlight this post!  
Unread 06-03-2004, 21:33
Ian W. Ian W. is offline
College? What?
no team (Gompei and the Herd)
Team Role: College Student
 
Join Date: Jan 2002
Rookie Year: 2002
Location: Worcester, MA | Smithtown, NY
Posts: 1,464
Ian W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to all
Send a message via AIM to Ian W.
Re: Weird Output from Dashboard Port

Quote:
Originally Posted by Astronouth7303
1. If you look in the doc, there does not appear to be a 'signature' in the OI packet or any of the 3 RC packets. I think all 4 are transmitted (Switch the jumper). But how does the software know this?

2. If you set user bytes 2 and 3 to 0xFF, some software might confuse this with a beggining of a new packet.

So quoting yourself did not answer my questions/concerns. Again, I am suggesting posibilities which may (Or may not) need to be acounted for.
No, I didn't answer these, as they are in a different thread, look in the hybrid or threaded view, you'll understand why I haven't been talking about your other questions. I answered your questions in your original post, twice now, but since you've asked for answers to questions in the other thread you made, here you go.

For the first, I already answered, there's the jumper on the OI, use that, manually switch the program to reflect the jumper being switched, it's not that hard. Otherwise, you can do what I suspect IFI has done and try to reverse engineer their Checksum Bytes, but seeing as I have no need to see what I'm sending to the RC, and if I did I'd do it the easy way, I can't answer this question with any more detail. Try contacting IFI if you feel you absolutely need to do that automatically in software, but don't expect a response, they don't have the manpower.

Two I already alluded to this answer as well, although I'll now make myself as clear as I can. To do this, you have two choices. The smart way, don't let the bytes both be 0xff. There is a reason they're called user bytes, the user controls them, IFI has taken the assumption that the user is smart enough to read the documentation and read between the lines and realize that they cannot use those two user bytes for 0xff as well as have a working dashboard. The stupid way is to let the two user bytes be 255 at some points, and hope you designed you dashboard to skip that "flag" (as it has now become a flag). If you take the stupid way, please don't come crying to anyone on CD that your RC/OI/dashboard program exploded.
__________________
AIM --> Woloi
Email --> ian@woloschin.com
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
New dashboard packet spec Ameya Programming 2 08-01-2004 19:59
Dashreader.dll: A Visual Basic .NET user control to read the dashboard port Ameya Programming 4 12-01-2003 23:40
Change to Initializing Inputs and Outputs Jferrante Programming 4 07-01-2003 11:36
Dashboard Protocol Library archiver 2000 9 23-06-2002 22:24
New Innovation FIRST control system and the dashboard archiver 2000 0 23-06-2002 22:15


All times are GMT -5. The time now is 19:10.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi