Knowledge Base

SimpleHMI: Getting connected with SPLat/PC

The first step in programming your SPLat controller to control SimpleHMI is to get a real SPLat connected to the SimpleHMI function inside SPLat/PC.

Here are the steps (I assume you are already familiar with using SPLat/PC, connecting to SPLat boards, etc. That means you have the right programming cable, that you know which comms port to use, etc.)

  1. Make sure you are running the latest SPLat/PC Build.
  2. Run SPLat/PC and get it connected to your controller. Acid test: Interact with the board via the SPLat/PC I/O window.
  3. Translate and run the program listed below in your controller. After 10 seconds output 0 should start flashing (if you have a LED connected to it!);
  4. On the module window, click SIO.
  5. On the Terminal window, which should appear, click the Settings tab.
  6. Make sure the settings are 7:38400 for Baud and 0:8,N,1 for Character.
  7. Click the SimpleHMI tab.
  8. (Nearly there!) Click the Connect button on the SimpleHMI tab.
  9. Confirm that you get a Hello World message on the SimpleHMI display.

You need to get the required end result of this test before continuing … this is the proof that everything is working.

Here’s the test program.

(Click here for some tips for working around problems with copy and paste out of Internet Explorer and HTML-help (.chm) files)

;Simple test of SimpleHMI. Intended just to show it's working in the PC
HMIPort EQU 251
# Open_Serial Port(HMIPort) User(38400,8,N) ;Initialise the serial port
# HMI Port(HMIPort) ConnectEvent(HMI_Connect) ;Where to GoSub when the SimpleHMI connects
LaunchTask HeartBeat ;Show we are alive
RunTasksForever

;----- HeartBeat task -----
HeartBeat:
On 0
Pause 2
Off 0
Pause 50
GoTo HeartBeat

;---- Event handler for the HMI Connected event -------
HMI_Connect:
# HMI Cursor(5,10) Print("Hello World") ;Display a message at row 5, column 10
Return

Note: HMIPort (251) is the address of the controller’s programming port when used by your application. In the EC1 and future 32-bit products there can be more than one program-accessible serial port, which will have other addresses. The references here to HMIPort are redundant – if omitted the default is still port 251.