PScript Interpreter – Part 7 – easyIPC

Part 6 introduces an easy way of communicating where one module raise an event and another receive it. But, for this to work I need some infrastructure that easyIPC provides for me. easyIPC uses a device address where device 0 is NMT (Network Master) on the local network. At this point I don’t care if this is CAN, RS485, SPI, Ethernet or Wifi – the device will have a primary, default network supporting easyIPC or a similar scheme.

This simple drawing illustrate what needs to happen. (1) as myDevice start it register TempMessage and myDevice as a resource to NMT. As myPC start it request that resource from NMT. NMT can be located anywhere in the system, but it is actually on the PC in this case. One challenge is that myPC might request myDevice.TempMessage before it is declared and resources might fall in/out of service. It’s NMT’s responsibility to keep track of this and send a new request answer once a resource becomes available. I want NMT to remember and notify rather based on requests to minimize messaging during start-up. This requires that NMT have a bit of memory – which should be ok.

The second challenge is that I might want two or more myDevice – lets say one for in-house temperature and one for outside temperature – how do I differ the two? The solution is that myPC can extend the resource name with an unique name. And that we in config say what device is what. myDevice and/or NMT need to store this. Once configured we get NMT to re-initialize the network with correct names.

 

Leave a Reply