• Home
    • Creativity
    • Engineering
    • Manufacturing
  • Store
  • Dev Blog
  • QCM System
  • About
  • Contact
Specialized Solutions LLC
  • Home
    • Creativity
    • Engineering
    • Manufacturing
  • Store
  • Dev Blog
  • QCM System
  • About
  • Contact

Using PAWN

For our products that support PAWN, this document will guide you through the process of creating your own scripts and running them.

Overview

There are basically four steps in the process:

1. Write your script
2. Compile your script
3. Load your script
4. Run and debug your script, going back to step #1 as needed
​

1. Writing Scripts

Pawn scripts end with the .p extension and can be created with any text editor (notepad, vi, emacs, etc.).  The creators of PAWN have excellent documentation of the language here (it is also included in the SDK for your product).  You will find that it is very similar to the C language, with a few deviations.

For our products, we have extended PAWN to include many functions that provide access to the unit functionality.  All of these functions can be found in the "include" directory of the SDK.  In particular, the file that starts with "qcm" is the most important.  It contains all of the extensions we have made.

The routines in this particular file will be called by your script to do stuff.  See the examples in the "test" and "examples" SDK directories for how these functions are used.  Your SDK may also have a "default" directory.  This directory contains the script that is loaded by default on your unit.  This file can also serve as a valuable example.

2. Compiling Scripts

Once you have your script created, it needs to be compiled with the PAWN compiler to be loaded onto the unit.  Currently this is accomplished using a command line interface.  To compile your script, call the program named "pawncc.exe" (resides in the "bin" directory of the SDK) passing it your script name as the first argument.  

If there are no errors during compilation, the compiler will create a file ending with a .amx extension.  This is the file that will be loaded onto your unit.
​
Picture

3. Loading Scripts

To load the .amx file produced in step #2, run the program named "QCM.exe" in the "bin" directory of the SDK with your device connected via USB.

You should see something similar to this:

​
Picture
To load, click on the "Load Script" button, point it to your .amx file, and watch it load.  Once done, your script will be running.
​

4. Run and Debug

Once the script is loaded, it is running.  Repeat steps #1 through #3 to continue development and debugging.  If at anytime you want to force the unit to not run the loaded script at startup, hold the button until it changes to the second color on the LED(s).  As soon as it changes color, release the button.  The unit should now behave as if no script has been loaded.  Note that this state is only temporary - the script is not erased and as soon as the unit starts up again (power cycle) it will run the currently loaded script.
Copyright © 2019 Specialized Solutions LLC - (260) 440-7161 - Contact
  • Home
    • Creativity
    • Engineering
    • Manufacturing
  • Store
  • Dev Blog
  • QCM System
  • About
  • Contact