RPC Message Order through RS-232

Hi, I just got a new project in my office recently, about RPC. But I have a zero experience in RPC.
May I ask some help to the masters in this forum, please? :slight_smile:

**I used to edit some HTML5 code on my website and make some long excel macro based on VBA. I hope I can understand faster :smiley: **

My project is enabling a public port in a control unit of a vehicle to get the real time parameter inside of that mentioned control unit. I actually had the guidelines but I think that the guidelines were for people who knew much about RPC, RS-232 and Arduino.

Progress So Far
Well by the way, here are of some progresses that I made:

  1. Public port permission is granted and serial configuration [RS-232] is configured/opened
  2. Hard wiring were already setup refer to official schematic.
  3. I made a connection from RS-232 TX RX and GND into my Laptop (using serial adapter converter and install the driver until my laptop read it clearly).
    3.1 By using software Com Operatol PAL to check the ping --> Ping Check Success
    3.2 By using software Com Operatol PAL to check the real time parameter --> OUTSTANDING

It is mainly about to make sure that Real Time Parameters are exist through RS-232.
As I mentioned before, I had zero experience about RPC. All I want to ask is how to make an RPC in the right way to call out the real time parameters using Com Operator Pal.

Here some resources.

  1. As I told above, that I successfully doing ping check.
    image
    Result: Success, Just the way as how guidelines instructed

  2. I want to check for another parameters call but I dont know how. Here's some example of RPC Messages on how to call out Real Time Parameters.
    3 hosted at ImgBB — ImgBB

  3. Here the RPC message order references.
    RPC Number [2 bytes] -- Sequence Number [2 bytes] -- RPC Message Data [0 to multiple bytes] -- CRC [2 bytes]

  4. Here's how to make Real Time Parameter calling code, with UID MID below [see Yellow Box refer to number 3].
    5 hosted at ImgBB — ImgBB
    or, Here's one example UID MID: 002400000040

  5. Here's reference about making Sequence Number
    "The Sequence Number identifies a specific instance of the remote procedure call or its
    results. The sequence number increments from 1 to 65535 and then wraps back to 1.
    The special sequence number 0 indicates a message which the receiver should not
    acknowledge. Thus, for normal message packets, the sequence number should not be
    zero. The Sequence Number is communicated using MSB byte ordering."

  6. Quite confuse that UID MID are 6 bytes, but in the RPC it only showing that is only 2 bytes

Questions

  1. How to make RPC Sequence Number?
  2. How to make RPC Parameter Call refer to UID/MID

Any help for my questions?
Thank you in advance ~

You might have to define what RPC means in this context. I know it as Remote Procedure Call, a common UNIX feature used in the old Sun days primarily and know particularly of being used by NFS.

As you're using RS-232 (instead of the network) to do your RPC it must be something completely different but unfortunately you didn't provide a link to what you mean.

Don't post pictures to temporary storage. Post them to this forum so they are still there if someone finds this thread later on.

This is the easy one. it is a 16 bit number from 1 to 65535. You increment it every time you make a call. When you get a response, you check that the returned sequence number matches what you send so you know the response received is associated with the request you sent. You also state that the most significant byte (MSB) comes first so something like this

uint16_t seq_num = 1;  // start with 1
byte buffer[100]; // some buffer to hold the complete message you will send
...
// sequence number goes into byte 2 and 3, MSB first
buffer[2] = (seq_num >> 8) & 0xFF; // put upper byte
buffer[3] = seq_num & 0xFF; // put lower byte
... // fill buffer with other needes things, like parameter id, CRC, etc

That is the parameter you pass after the RPC number and seq number - you will have to know that info for whatever parameter you are trying to receive

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.