To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.nqcOpen lugnet.robotics.rcx.nqc in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / NQC / 1143
1142  |  1144
Subject: 
Re: NQC vs Spirit communication speed
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Fri, 11 May 2001 23:20:26 GMT
Viewed: 
2320 times
  
In lugnet.robotics.rcx.nqc, Dave Baum writes:
I went through all of the RCX/CM/Scout bytecodes and believe the
following function is accurate for all current bytecodes:

int PredictReplyLength(const UByte *data, int length)
{
  switch(data[0] & 0xf7)
  {
     case 0x25:  // __task
     case 0x35:
     case 0x45:  // __dl
     case 0x75:
        return 1;
     case 0x30:  // pollb
     case 0x12:  // poll
        return 2;
     case 0x15:
        return 8;
     case 0xa5:
        return 25;
     case 0x20:
        return 188;
     case 0x63:  // pollm
        if (length != 4) return 0;
        return data[3];
     case 0xa4:  // upload datalog
        if (length != 5) return 0;
        return (data[3] + ((int)data[4] << 8)) * 3;
     default:
        return 0;
  }
}

I made PredictReplyLength a member of the RCXLink class so it can return a
different value for case 0x20 (it returns 20 if the Target is Cybermaster
and 0 if it is Scout - since the Scout doesn't support that opcode).  Of
course, in Object Pascal the code isn't quite as pretty. :-)

RcxCC using my Spirit replacement class is much faster now than it was
without the predictive reply.  It feels like it is pretty close to the speed
of Spirit.  I still have a few kinks to iron out.  Something is not working
right in the Direct Control dialog with the sensor type and mode controls,
for example.  And Scout support in the watch window and the memory map is
not done yet.

I've uploaded a new zip to my webpage

http://members.aol.com/johnbinder/rcxcc.zip

In this version you no longer need the Spirit OCX at all.  As a result I
removed a few menu items (Tools/Close communication, Tools/Open
Communication, Tools/Retransmission Stats).  Everything uses the FakeSpirit
class except for compiling and downloading an NQC program.  So there were a
couple minor changes to the Preferences dialog.

I slightly augmented the Diagnostics dialog and the Direct Control dialog to
allow you to use other sources besides constants for a) setting the RCX
display (on the diagnostics dialog) and b) setting variables (on the direct
control dialog).

Soon to come will be a new RcxCC Remote dialog which will be sort of like
the Joystick form but modelled after the Lego Remote.  I'm thinking about
adding the ability to write simple direct command scripts.

LMKWYT,

John Hansen



Message has 1 Reply:
  Re: NQC vs Spirit communication speed
 
(...) I knew Scout didn't support the opcode, but overlooked the Cybermaster case. I'll fix it for NQC as well. The return value for an unsupported opcode doesn't really matter since nothing is going to come back anyway, so predictive will fail no (...) (23 years ago, 12-May-01, to lugnet.robotics.rcx.nqc)

Message is in Reply To:
  Re: NQC vs Spirit communication speed
 
(...) Correct - dynamic timing is turned off when predictive is being used (which is the default). Predictive is relatively new, and I wasn't sure which code you started with (or how you ported/used it), so that's why I explained the dynamic timing. (...) (23 years ago, 11-May-01, to lugnet.robotics.rcx.nqc)

8 Messages in This Thread:



Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR