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.)
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.