HI from another new UK user: MERG RPC support

New users can introduce themself here

HI from another new UK user: MERG RPC support

Postby Dagworth » 03.11.2017, 00:21

HI,

My name is Andi, I've been a modeller for most of my life.
I was introduced to Rocrail by my Brother-In-Law who has used it on one of his layouts.
I have various layouts, all UK outline OO and DCC, some small and some rather large.
I want to make the largest layout rather more automated and Rocrail looks the easiest option BUT it doesn't seem to support the current point/signal/track circuit hardware. I'm using a Lenz system for driving trains but for control of accessories I use the MERG RPC system, I really don't want to change the hardware as there is significant investment not only financial but time as well. How difficult is it to add new interface options into Rocrail? How would I go about doing so?

This is a friend's video of the layout a couple of years back https://www.youtube.com/watch?v=boiIcPWZz3c&t=8s

Sorry if these are questions I need to put in specific forums, a quick look round didn't show anywhere obvious.

Andi
Dagworth
 

Re: HI from another new UK user

Postby rjversluis » 03.11.2017, 07:22

Hi Andy,

is the PC protocol documented for the MERG RPC system?
If yes, I could implement a Rocrail library to support it.
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBus - CAN-GCA ] - [ 0: RocNetNode - GCA-Pi ]
rjversluis
Site Admin
 

Re: HI from another new UK user

Postby Dagworth » 10.11.2017, 01:18

rjversluis wrote:Hi Andy,

is the PC protocol documented for the MERG RPC system?
If yes, I could implement a Rocrail library to support it.


Hi Rob,

Yes, it is documented and I now have permission from the author to pass it on to you, how is best to send it to you?

Andi
Dagworth
 

Re: HI from another new UK user: MERG RPC support

Postby rjversluis » 10.11.2017, 08:03

Hi Andi,

use the Email found on this page if you are not allowed to publish it here in the Forum.
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBus - CAN-GCA ] - [ 0: RocNetNode - GCA-Pi ]
rjversluis
Site Admin
 

Re: HI from another new UK user: MERG RPC support

Postby rjversluis » 17.11.2017, 11:59

Hi Andi,

I received the protocol, and I did make a start of the implementation.
The Rocrail library is "rpic", and the following is implemented:

Set/Clear Single Output Bit value

The checksum calculation is not explained in the protocol.

Just test and report.
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBus - CAN-GCA ] - [ 0: RocNetNode - GCA-Pi ]
rjversluis
Site Admin
 

Re: HI from another new UK user: MERG RPC support

Postby Dagworth » 18.11.2017, 17:10

rjversluis wrote:Hi Andi,

I received the protocol, and I did make a start of the implementation.
The Rocrail library is "rpic", and the following is implemented:

Set/Clear Single Output Bit value

The checksum calculation is not explained in the protocol.

Just test and report.


Hi Rob,

glad you got it ok.

Where should I find this library?

edit: found it, trying to get my computer to talk to it now, crashing into issues of my USB-serial adaptor not liking windows 10... argh.
*fires up windows 7 machine* :)

Andi
Dagworth
 

Re: HI from another new UK user: MERG RPC support

Postby rjversluis » 18.11.2017, 17:28

Hi Andi,

sorry, but I did forgot to include the changed makefile, so a Windows build including this library(rpic.dll) will first be available tomorrow.
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBus - CAN-GCA ] - [ 0: RocNetNode - GCA-Pi ]
rjversluis
Site Admin
 

Re: HI from another new UK user: MERG RPC support

Postby Dagworth » 19.11.2017, 17:13

I've got the latest (32bit) build but Rocrail is not talking to the RPIC.

Normally the RPIC flashes two LEDS constantly while the computer is connected to it, but neither LED are doing anything.

Andi
Dagworth
 

Re: HI from another new UK user: MERG RPC support

Postby rjversluis » 19.11.2017, 17:16

Andi,

in the document you send me there is no communication flow described which explains sending packets to the RPIC in case of idle.
Also the checksum generation is not documented.
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBus - CAN-GCA ] - [ 0: RocNetNode - GCA-Pi ]
rjversluis
Site Admin
 

Re: HI from another new UK user: MERG RPC support

Postby Dagworth » 19.11.2017, 17:27

I have asked for more information from the RPC developer.

Andi
Dagworth
 

Re: HI from another new UK user: MERG RPC support

Postby Dagworth » 20.11.2017, 16:51

I've had a reply from the developer:
There are no 'idle' communications as such unless you are using continuous Message Type 0's, rather than individual bit and byte messages.
For a Message Type 0 only arrangement, you simply repeat the previous output message - even if nothing has changed - to get back the latest input states.
Checksum generation is most definitely mentioned throughout the document.
It is an exclusive-or of all the data bytes, i.e. excluding the header, message type and message length values.
Generally speaking, the two main approaches for using the system are:
1. Always use Message Type 0 (All data in, All data out, every time) as quickly as possible.
2. A single Message Type 0 at the start, followed by individual bit and byte reads and writes as things require changing or reading.


this makes sense to me, I would stick with just type 0 messages sending the full layout data outputs repeatedly as often as possible, and reading back the full layout data inputs each time.

For my needs I have 256 outputs and 256 inputs (16 of each to every one of 16 boards that make up the layout) so the message length will be the same every time, outputs consist of signal aspects and relay feeds for point control, inputs are track circuit sensors and push buttons for operator input to the system. Inputs therefore need to be constantly checked by the computer.

I think I understand from the document the ExclusiveOr method by which the checksum is calculated but this is all new to me!

For connection I am using a USB to serial adaptor to get to the RS232 input of the RPIC, the connection runs at 9600 baud. As per previous post I am using a Windows 7 (64bit) machine, although I've not gone to the 64 bit version of Rocrail yet.

Andi
Dagworth
 

Re: HI from another new UK user: MERG RPC support

Postby rjversluis » 20.11.2017, 17:18

OK,

what about "DCC Operation"? The documentation has messages for Locos and CV Programming...

The data coming back from the RPC to the PC do not have a header, and therefor shifting of data is a potential risk...

The exclusive or is clear, but some implementations start with 0xFF and other with 0x00.

The 1. approach is like the selectrix bus.
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBus - CAN-GCA ] - [ 0: RocNetNode - GCA-Pi ]
rjversluis
Site Admin
 

Re: HI from another new UK user: MERG RPC support

Postby Dagworth » 20.11.2017, 18:01

I am not using RPIC for DCC use at all, the DCC connection from the computer is to a Lenz LI-usb and Expressnet

Andi
Dagworth
 

Re: HI from another new UK user: MERG RPC support

Postby Dagworth » 20.11.2017, 18:05

The data coming back from the RPIC should only ever be 32 bytes of layout input information, there is nothing else connected to the other end of the RPIC that can generate any other data. I've kept my implementation of the RPC system very simple.

Andi
Dagworth
 

Re: HI from another new UK user: MERG RPC support

Postby rjversluis » 20.11.2017, 18:14

how to distinguish between Input and Output?
The first 16 are input and the rest output?
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBus - CAN-GCA ] - [ 0: RocNetNode - GCA-Pi ]
rjversluis
Site Admin
 

Next

Return to Introduction