beautypg.com

Example code 11.1 – Wavetronix Click 500 (programmable controller) (CLK-500) - Developer Guide User Manual

Page 120

background image

CHAPTER 11 • CLICK SUPERVISOR SUPPORT 119

You cannot have two custom applications with the same number, because their unique driv-

ers must reside in different directories.

Note

The placeholder file is reserved for future use as a firmware upgrade file. howeer, the
Click 500 currently supports upgrades using the Rabbit field Utility (not with Click
Supervisor). An example .txt file is included in the 599 example code. The placeholder
file name should match the 13-charaters of the ClickSupervisorDefaultSerialNumber
text string and should end in “.txt”.

Example Code 11.1

The Example Code 11.1 implements a simple application via a state machine. When in the

inactive state, press the push-button to generate virtual vehicle speed detection. The speed

and a timestamp for the virtual detection will be sent out the RS-232 TOP port. If the speed

falls between specified minimum and maximum speed thresholds, a red LED will light up

and digital output 1 will be asserted for a specified duration.

While the output is timing, the state machine is in the active state. If message alerts are

enabled, a customizable 32-character text string will also be sent out the RS-232 TOP port

when the device enters the active state. If virtual detection does not fall between the thresh-

olds, then the yellow LED will turn on for a short period of time.

The Example Code 11.1 consists of the following two files:

˽

ExampleCode11.1.C

˽

Click599config.lib

The Click599config.lib file is a library file used by the main code file (ExampleCode11.1.C).

The library contains two modules; one that allows customization of Click Supervisor system

variables and another that allows for customization of application-specific OEM variables.

You will notice in the ExampleCode11.1.C file that the ClickSupervisorMsgPortInit() func-

tion is called after you have removed all receive tasks. The parameter passed to this function

indicates which virtual port will support Click Supervisor communication messages.

The last function in the preceding example code called ClickSupervisorOemResetToFacto-