Personal tools

The Command Set

The set of commands that can be interpreted by the controller software.

/*
Commands.h

Commands accepted by the parser. Commands are case sensitive

Version: 1.2
Revision: 3.0

This code is free software; you can redistribute it and/or
modify it under the terms of the Creative Commons GNU license

This software is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the Creative Commons - GNU Public License for more details.
http://www.creativecommons.org

This software is part of the project XYZ-DC Motor Controller.

You can find more informations, documentations and updates
at http://www.contesti.eu/knowledge-base/xyz-dc-motor-controller-software-application-notes
The hardware project page for the controller can be found at
http://www.contesti.eu/opensource/xyz-dc-motor-controller

(c) 2010 enrico.miglino@ovi.com - contesti.eu electronics
license Creative Commons 3.3 BY-NC-SA and CC GNU license
*/

// Command separator '@'
// This string permit the creation of strings with more than one commands.
// Example: m x@r 200@s l y 3000 5500
// set x axis as current stepper motor; set current axis to
// 200 rpm speed; set y axis limits to 3000 - 5500 steps
#define CMD_SEPARATOR '@'

// =============================================================
// command: motor axis
// description: select current motor
// name: m
// parameters: (char) axis {x|y|z}
#define CMD_MOTOR 'm'

// =============================================================
// command: status [[parameter] value]
// description: display current machine status
// name: s
#define CMD_STATUS 's'

// =============================================================
// status subcommands - Read/Set internal variables
// =============================================================

// substring
// description: set the value for one of the program strings
// usage: s (int) stringNum (string) value
// example: s(tatus) s(ubstring) 8 Alarm
//              set substring 7 S_ALARM with the value "Alarm"
#define S_SUBSTRING 's'

// limit
// description: set lowest and highest limits (in steps) for one of the axes
// usage:       l (char) axis (int) low (int) high
// example:     s l x 127 6540
//              set x axis limits to 127 steps left and 6540 steps right
// note:        settable limits refers to the step values retrieved by the
//              limit switches.
#define S_LIMIT     'l'

// factor
// description: set scale factor applied to all xyz translations
// (in measure units)
// usage:       f (float) percentage factor
// example:     s f 0.8
//              set factor scale to 0.8: 1 unit = 0.8 units
// note:        can't be used a scale factor value smaller thant 1 step unit
// (phisycal resolution
#define S_FACTOR     'f'

// unit
// description: set the number of steps that define a unit
// usage:       u (char) mode (int) steps
// example:     s u m 200
//              set metric unit (millimeters). 1mm = 200 steps
// note:        mode can be m = millimeters or i = 1/10 inches
#define S_UNIT      'u'

// =============================================================
// command:     rpm speed
// description: set speed in rpm units (revolutions-per-minute)
// name:        r
// parameters:  (int) speed
//              accepted: an integer value between min_Rpm and max_Rpm
// example:     r 60
//              set current axis speed to 60 rpm
#define CMD_RPM      'r'

// =============================================================
// command:     go axis steps
// description: axis movement command
// parameters:  (char) axis {x | y | z} (int) steps
// name:        g
// note:        abs(steps) <= max_limit - current_position (if positive value)
//              abs(steps) >= current_position - min_limit (if negative value)
//              this command adopt the curren axis speed
#define CMD_GO      'g'

// =============================================================
// command:     write name command(s)
// description: write a macro command on EEProm
// parameters:  (char[16]) name {macro name string}
// name:        (char[80]) command {command sequence string}
// note:        A set of macro commands is called a library.
//              A library can store up to 150 macros on the internal
//              controller storage space.
#define CMD_WRITE   'w'

// =============================================================
// command:     dump
// description: dump the current stored library
// note:        all the current stored library is dumped via serial usb
#define CMD_DUMP   'd'

// =============================================================
// command:     upload
// description: upload a library on storage area.
// note:        save a library from serial to the storage area.
#define CMD_UPLOAD  'u'

// =============================================================
// command:     exec macro
// description: execute a macro command saved in storage space.
// parameters:  (char[16]) macro {macro name string}
#define CMD_EXEC   'x'

 

Copyright 2009, by the Contributing Authors. Cite/attribute Resource. enrico. (2010, August 10). The Command Set. Retrieved May 21, 2012, from conTESTI.eu Web site: http://www.contesti.eu/knowledge-base/mill-machine-controller-software/xyz-dc-motor-controller-software-application-notes/the-controller-macro-commands/the-command-set. This work is licensed under a Creative Commons License Creative Commons License
Log in


Forgot your password?
New user?

Make a free donation

Help us to support and maintain the open source projects, so we can update and share the knowledge on this site.

Thanks to all for the appreciations.