The ConnectWare repo includes software simulators that are highly recommended for developing OKE ports of the CWL. The simulations can be used for debugging a new CWL port since they minimize the number of "moving parts" required to exercise an OKE system.
There are three independent simulators that can be run out of the box or modified to suit the needs of the developer. The compiled simulators are text-based Windows programs and are run from a command prompt. All three simulators can be run on different terminals on the same computer.
The Simulators
OKC (Open Kitchen Cloud) Simulator
okc.exe is a software simulation of the cloud server that runs on a local computer using a terminal. This simulator provides a means of monitoring OKM traffic, sending commands and data back to the OKE through the CWM simulator.
The simulated CWM and OKC communicate to each other via inter-process communication that simulates a network connection between them. The OKC simulator can only interface with the CWM simulator.
CWM (ConnectWare Module) Simulator
cwm.exe is a software simulation of the physical ConnectWare Module that runs on a local computer using a terminal. The CWM sits in between the OKC simulator and the OKE or OKE Simulator. The simulated CWM and OKC communicate to each other via inter-process communication that simulates a network connection between them.
The CWM simulation opens a serial comport on the Windows PC. This serial comport is used to connect to the developer’s equipment in the same manner that the physical CWM would connect.
OKE (Open Kitchen Equipment) Simulator
This is a software simulation of a Kitchen appliance. The purpose of this from a developer point of view is for demonstration purposes. To show how the OKE should be communicating with the rest of the simulators.
There are two typical simulation scenarios:
Developer Scenario
Run the OKC and CWM simulators on a PC and connect the PC with a serial connection to a controller board. Use the setup instructions below for each simulator.
Demonstration Scenario
Run the OKC, CWM, and OKE simulators all on the same PC. The PC requires two serial ports connected with a NULL modem cable. Use the setup instructions below for each simulator.
CWM Simulation Instructions
OKC Simulation Instructions
OKE Simulation Instructions
Building Custom Simulators on Windows
The simulators were built using Microsoft Visual Studio Community 2019 with the C/C++ tools. At the top level ConnectWare directory there is a solution file called ConnectWare.sln that contains projects for the three simulators.
Normally implementors will not need to rebuild the OKC or CWM simulators since precompiled versions are included in the sim directory. However, some implementors may find it useful to use and extend the OKE simulator as a way to prototype and debug parts of their application code.
To build the OKE simulator right click on the _OpenKitchenEquipment_OKE project in the Solution Explorer pane and click Set as StartUp Project. To change the default command line parameters, go to Project->Properties->Debugging and modify the Command Arguments field. On the toolbar you can launch the debugger by clicking the Local Windows Debugger option.