SCAL4 Custom Cut Plugin

If you want to make your own plugin to custom support a particular cutting machine model, you can create your own plugin as defined here.

You will need to create a dynamic library (Windows DLL or Mac dylib) that follows our specification. The dynamic library will be loaded and be sent the design coordinates in inches. Your library will need to translate those coordinates to commands the cutting machine supports. You wlil also need to create a XML files that specifies certain settings abou the cutting machine.

Both the dynamic library and XML file must be located in a folder called SCALCutPlugins located in the users Documents path

Example:
Windows: C:\Users\ME\Documents\SCALCutPlugins
Mac: /Users/ME/Documents/SCALCutPlugins

Dynamic Library
The following are required C functions in the dynamic library.

Example C++ Source file
Example C++ Header file

1. void *SCP_AllocatePlugin( void)
This is the first function called to allocate the object that will need to be passed as a parameter to all other functions.
Parameters: none
Result: pointer to an allocated class object you have created to manage the device

2. void SCP_DeallocatePlugin( void *pluginPtr)
Frees the memory of the pointer
Parameters:
pluginPtr: pointer to the object created from the SCP_AllocatePlugin function
Result: none

3. long SCP_GetCapabilities( void *pluginPtr)
Returns the capabilities of the cutting machine
Parameters:
pluginPtr: pointer to the object created from the SCP_AllocatePlugin function
Result: the capabilities the cutting machine supports. Return a combination of any of the following values.
#define kSCALCP_CAPABILITIES_LOAD_MAT 0x0001
#define kSCALCP_CAPABILITIES_UNLOAD_MAT 0x0002
#define kSCALCP_CAPABILITIES_MAT_IS_LOADED 0x0004
#define kSCALCP_CAPABILITIES_USE_SOFTWARE_SPEED_UP 0x0008
#define kSCALCP_CAPABILITIES_USE_SOFTWARE_SPEED_DOWN 0x0010
#define kSCALCP_CAPABILITIES_USE_SOFTWARE_PRESSURE 0x0020

4. bool SCP_FindDevice( void *pluginPtr)
Checks if the cutting machine is connected to the computer. You will need to store the device COM port/path so it can be used when the SCP_OpenDevice is called.
Parameters:
pluginPtr: pointer to the object created from the SCP_AllocatePlugin function
Result: true if device is found, otherwise false

5. bool SCP_OpenDevice( void *pluginPtr)
Opens the connection to the cutting machine.
Parameters:
pluginPtr: pointer to the object created from the SCP_AllocatePlugin function
Result: true if connection is open, otherwise false

6. bool SCP_CloseDevice( void *pluginPtr)
Closes the connection to the cutting machine.
Parameters:
pluginPtr: pointer to the object created from the SCP_AllocatePlugin function
Result: true if succeeded, otherwise false

7. bool SCP_Cutting_SetSpeed( void *pluginPtr, int speedUp, int speedDown)
Send the speed settings
Parameters:
pluginPtr: pointer to the object created from the SCP_AllocatePlugin function
speedUp: speed setting while the blade is moving in the up position (not cutting)
speedDown: speed setting while the blade is moving in the down position (cutting)
Result: true if succeeded, otherwise false

8. bool SCP_Cutting_SetPressure( void *pluginPtr, int pressure)
Send the pressure settings
Parameters:
pluginPtr: pointer to the object created from the SCP_AllocatePlugin function
pressure: pressure value set from the user interface.
Result: true if succeeded, otherwise false

9 . bool SCP_Cutting_SetMatSize( void *pluginPtr, double widthInch, double heightInch)
Dimensions of the mat in inches
Parameters:
pluginPtr: pointer to the object created from the SCP_AllocatePlugin function
widthInch: width of the mat in inches
heightInch: heigh to the mat in inches
Result: true if succeeded, otherwise false

10. bool SCP_Cutting_Begin( void *pluginPtr)
This will be called before any cutting coordaintes are sent so you can send any initalizing commands needed.
Parameters:
pluginPtr: pointer to the object created from the SCP_AllocatePlugin function
Result: true if succeeded, otherwise false

11. bool SCP_Cutting_End( void *pluginPtr)
This will be called after all the cutting coordinates are sent so you can send any needed commands at the end.
Parameters:
pluginPtr: pointer to the object created from the SCP_AllocatePlugin function
Result: true if succeeded, otherwise false

12. bool SCP_Cutting_MoveTo( void *pluginPtr,double xInch, double yInch)
Sends absolute coordinates in inches to move to.
Parameters:
pluginPtr: pointer to the object created from the SCP_AllocatePlugin function
xInch: horizontal coordinate
yInch: vertical coordinate
Result: true if succeeded, otherwise false

13. bool SCP_Cutting_LineTo( void *pluginPtr,double xInch, double yInch)
Sends absolute coordinates in inches to move to.
Parameters:
pluginPtr: pointer to the object created from the SCP_AllocatePlugin function
xInch: horizontal coordinate
yInch: vertical coordinate
Result: true if succeeded, otherwise false

14. bool SCP_Cutting_CurveTo( void *pluginPtr,double cx1Inch, double cy1Inch, double cx2Inch, double cy2Inch, double xInch, double yInch)
Sends absolute coordinates in inches to move to.
Parameters:
pluginPtr: pointer to the object created from the SCP_AllocatePlugin function
xInch: horizontal coordinate
yInch: vertical coordinate
Result: true if succeeded, otherwise false


XML File
The following is an example XML file

<xml version="1.0" encoding="UTF-8">
<scal_cut_plugin name="the company" model="the model" dll="cutterplugin.dylib" origin="TL">
<connection type="usb"/>
<connection type="serial"/>
</scal_cut_plugin>
</xml>

name: The company name of the cutting machine. This will be displayed in SCAL in the Manage Cutters and Cut settings window.

model: The model name of the cutting machine. This will be displayed in SCAL in the Manage Cutters and Cut settings window.

dll: The filename of the dynamic ilbrary you created. The XML and dynamic library must be both located in the same folder.

origin: The corner your cutting machine uses as the (0,0) location. TL (top,left), TR (top,right), BL (bottom,left), BR (bottom, right)

connection type: the types of connection the cutting machine support