Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/07/07 14:51
Modified:
  06/07/07 16:22

Read: times


 
#140375 - Are we making this too difficult?
Responding to: ???'s previous message
Bob said:
The adapter sends a confirmation message to the micro upon receiving a message to be transmitted to the J1850 network. When I send messages through the adapter to the network, that message has to be handled; I do this by simply waiting for the confirmation message to be received before doing anything else. That clears the message out of the buffer and ensures that the connection to the adapter is still good simultaneously.


Hi Bob,

I don't fully understand what you're doing yet, but I have a nagging feeling that you may be making the problem more difficult than it really is. I have a couple of questions about the above paragraph thay may help clarify things, at least for me:
  • When you say "I do this by simply waiting ...", what is "this"? What, exactly, do you accomplish by waiting for the confirmation message?
  • When you say that you wait for the confirmation message "before doing anything else", what do you really mean? Clearly you must still be doing something, i.e. receiving messages and checking for the confirmation message. Exactly what activities are you postponing until after the confirmation message arrives?
  • In the last sentence, what message are you talking about clearing from what buffer? Are you talking about the outgoing message and its buffer?
Again, without fully understanding the problem yet, the whole "cache" thing seems like a kludge to me. Also, your statement that you sometimes wait "before doing anything else" bothers me because it reminds me of your original problem (missing incoming messages) that was also due to a delay in the program.

Is there any fundamental reason that would prevent your processing of each incoming message as soon as it arrives? Would it be possible to decouple the message receiving part of your program from the message sending part, so that the receiving part could run continuously, with only the sending part having to wait (for the 250 ms delay and the arrival of the confirmation messages)? I think the whole thing might get a lot simpler if you could think in those terms.

-- Russ


List of 20 messages in thread
TopicAuthorDate
Software design problem            01/01/70 00:00      
   Something like this, maybe?            01/01/70 00:00      
      Well, yes, actually...            01/01/70 00:00      
      Duhr and a question            01/01/70 00:00      
         Which ones did you look at ?            01/01/70 00:00      
         Duhr and an answer            01/01/70 00:00      
   Is it not possible to            01/01/70 00:00      
      Horses for courses            01/01/70 00:00      
         have fun            01/01/70 00:00      
   A Queue?            01/01/70 00:00      
      I used what I called a \'cache\'            01/01/70 00:00      
         Gah, code repost            01/01/70 00:00      
            you need to read it all, THEN process            01/01/70 00:00      
            Your approach is much more general...            01/01/70 00:00      
               Prioritizing?            01/01/70 00:00      
            Some suggestions Bob            01/01/70 00:00      
               Thank you, sir!            01/01/70 00:00      
                  Division / modulus not always slow            01/01/70 00:00      
         Are we making this too difficult?            01/01/70 00:00      
            I don't think so, it seems to work pretty well...            01/01/70 00:00      

Back to Subject List