Secondary Development Guide for ComXim Programmable Turntables


Introduction

ComXim programmable turntables are built with developers and system integrators in mind. Unlike consumer-grade turntables that offer only remote or app-based control, ComXim turntables expose a unified, text-based command interface that allows you to control every aspect of the device programmatically.

Whether you are building a custom 360° photography automation system, integrating a turntable into an industrial inspection line, or developing a mobile app for a specific vertical market, the CT (ComXim Turntable) command system gives you complete control over rotation, positioning, shutter triggering, lighting, and more.

This guide covers everything you need to get started with secondary development – from understanding the command structure to writing your first control program.


What Makes ComXim Turntables Developer-Friendly?

ComXim turntables stand out in the market for their commitment to open programmability. Key features include:

Feature Benefit
Unified CT command set Same commands work across USB, Wi-Fi, and Bluetooth – no need to rewrite code for different connection methods
Plain text commands No proprietary binaries, DLLs, or SDKs required – just simple ASCII strings
Real-time feedback Acknowledgment (ACK), event notifications, and error codes provide full visibility into turntable status
Heartbeat mechanism Built-in connection monitoring ensures reliable communication
Cross-platform compatibility Works with Windows, Linux, macOS, Android, and any platform that supports serial or socket communication
Multiple interfaces USB (virtual COM port), Wi-Fi (TCP/IP), and Bluetooth (BLE) – choose what fits your architecture

Two Paths to Secondary Development

Depending on your comfort level and requirements, you can approach secondary development in two ways:

Path 1: Learn from TurntableX (Windows Software)

The easiest way to learn CT commands is to use TurntableX – ComXim’s Windows control software. Every action you perform in the software – clicking a button, adjusting a slider, starting a rotation – generates a CT command that is displayed in the debug window.

How to use this method:

  1. Connect your turntable via USB or Wi-Fi
  2. Open TurntableX and establish a connection
  3. Perform actions (e.g., set angle, start step rotation, enable shutter)
  4. Watch the command display window to see the corresponding CT commands
  5. Copy and paste these commands into your own code

This is the most intuitive way to learn the command set without reading through pages of documentation.

Path 2: Direct CT Command Programming

For developers who prefer to work directly with the command set, ComXim provides a complete CT Command List that documents every available command, its parameters, and expected responses.

Typical workflow:

  1. Download the CT Command List from the ComXim website
  2. Test commands using a serial terminal tool (e.g., SSCOM, PuTTY, SecureCRT)
  3. Integrate commands into your application code

CT Command Fundamentals

Command Format

All CT commands follow a strict, consistent format:

CT+COMMAND(parameter1, parameter2, ...);

Components:

  • CT – Command prefix (identifies the string as a turntable command)
  • + – Separator between prefix and command name
  • COMMAND – The specific command name (e.g., START, SETMODE, TURNSINGLE)
  • (parameter1, parameter2, ...) – Parameters enclosed in parentheses
  • ; – Terminating semicolon (marks the end of the command)

Example:

CT+START(0,1,1,15,2,24);

Response Types

When the turntable receives a command, it provides feedback through three response mechanisms:

Response Type Format Description
Acknowledgment (ACK) CR+OK; Command was received and accepted
Event Notification CR+EVENT=TB_END; An action has completed (e.g., rotation finished)
Error Code CR+ERR=XX; An error occurred (see error code table)

Heartbeat Mechanism

The turntable and control device maintain a heartbeat to monitor connection status:

  • The turntable sends a # character every 1 second when connected
  • If no # or command is received for 3 seconds, the turntable enters heartbeat-loss state
  • In heartbeat-loss state, the turntable sends ## every 1 second until communication is restored
  • The control device should implement a similar monitoring mechanism

Note: Heartbeat can be enabled or disabled using the CT+HEARTBEAT(onOff); command.


Core CT Command Categories

1. System Commands

Command Parameters Description
CT+ACK(onOff) 0=off, 1=on Enable/disable command acknowledgment
CT+EVENT(onOff) 0=off, 1=on Enable/disable event notifications
CT+HEARTBEAT(onOff) 0=off, 1=on Enable/disable heartbeat
CT+SAVECONF() None Save current settings to flash memory

2. Query Commands

Command Parameters Description
CT+GETPN() None Get product model name
CT+GETEBC() None Get unique electronic birth code (for software licensing)
CT+GETFWV() None Get firmware version
CT+GETOFFSETANGLE() None Get current position relative to origin
CT+GETTBCONFIG() None Get all saved configuration parameters

3. Motion Control Commands

Command Parameters Description
CT+START(dir,mode,shutter,angle,pause,times) 6 parameters Start a multi-step rotation sequence
CT+TURNSINGLE(dir,angle) 2 parameters Rotate by a single specified angle
CT+SETMODE(mode) 0=continuous, 1=step, 2=pendulum Set rotation mode
CT+SETDIR(direction) 0=clockwise, 1=counter-clockwise Set rotation direction
CT+SETANGLE(angle) Positive float (degrees) Set step angle
CT+SETPAUSETIME(seconds) Positive integer Set pause time between steps
CT+SETREPEATTIMES(times) Positive integer Set number of repeats
CT+SETSTOP() None Stop rotation immediately
CT+RUN() None Start rotation with current settings

4. Position Management Commands

Command Parameters Description
CT+SETZERO() None Set current position as origin
CT+TOZERO() None Return to origin via shortest path
CT+TOZEROBYDIR(direction) 0=clockwise, 1=counter-clockwise Return to origin in specified direction

5. Shutter Control Commands (Shutter-Enabled Models)

Command Parameters Description
CT+SETAUTOSHUTTER(onOff) 0=off, 1=on Enable/disable auto shutter
CT+CAMERACTRL(focus,capture) 0=off, 1=on Manual camera control (focus + shutter)
CT+PHONECAMCTRL(time) Milliseconds (250-500) Trigger smartphone Bluetooth shutter

6. Lighting Control Commands (LED-Enabled Models)

Command Parameters Description
CT+SETRGBCOLOR(R,G,B) 0-255 each Set RGB LED color
CT+POWERLED(ledNum,grade) LED number, brightness grade Set power LED brightness
CT+COLORLED(led1,led2,led3) 0=off, 1=on Control individual color LEDs

Getting Started: Step-by-Step

Step 1: Choose Your Connection Method

Interface How to Connect Development Approach
USB Virtual COM port via CH340 driver Serial port programming
Wi-Fi TCP/IP socket (IP: 192.168.181.181, port: 8181) Socket programming
Bluetooth BLE GATT connection (BLE 4.0) BLE programming

Step 2: Set Up Your Development Environment

For USB (Windows/C# example):

// Create and configure serial port
SerialPort serialPort1 = new SerialPort();
serialPort1.PortName = "COM3";        // Your COM port
serialPort1.BaudRate = 115200;        // Fixed baud rate
serialPort1.Open();

// Send a command
string cmd = "CT+TURNSINGLE(0,45.0);";
serialPort1.Write(cmd);

For Wi-Fi (Python example):

import socket

# Connect to turntable
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(("192.168.181.181", 8181))

# Send a command
cmd = "CT+TURNSINGLE(0,45.0);"
sock.send(cmd.encode())

Step 3: Test with Basic Commands

Start with simple commands to verify connectivity:

CT+GETPN();          // Should return product name
CT+GETEBC();         // Should return unique device ID
CT+TURNSINGLE(0,45.0); // Rotate 45° clockwise

Step 4: Build Your Application

Once basic commands work, you can build more complex sequences:

// 360° product photography: 24 shots, 15° per step, 2-second pause
CT+START(0,1,1,15,2,24);

Practical Examples

Example 1: Single-Step Positioning

Requirement: Rotate 90° clockwise and stop.

Command:

CT+TURNSINGLE(0,90.0);

Expected Response:

CR+OK;
CR+EVENT=TB_END;

Example 2: Automated 360° Photography

Requirement: Capture 24 images around a full circle, with a 2-second pause between shots for the camera to process.

Command:

CT+START(0,1,1,15,2,24);

Parameter breakdown:

  • 0 = Clockwise direction
  • 1 = Step mode
  • 1 = Auto shutter enabled
  • 15 = 15° per step (360° ÷ 24)
  • 2 = 2-second pause
  • 24 = 24 repeats

Expected Behavior:

  1. Turntable triggers shutter for first photo
  2. Rotates 15° clockwise
  3. Pauses for 2 seconds
  4. Triggers shutter at pause midpoint (~1 second)
  5. Repeats steps 2-4 for a total of 24 steps

Example 3: Pendulum (Swing) Mode

Requirement: Swing 45° back and forth with auto shutter at each extreme.

Command:

CT+START(0,2,1,45,4,0);

Parameter breakdown:

  • 0 = Clockwise (starting direction)
  • 2 = Pendulum mode
  • 1 = Auto shutter enabled
  • 45 = 45° swing range
  • 4 = 4-second pause at each extreme
  • 0 = Infinite repeats (until stopped)

Example 4: Query Current Position

Requirement: Check current angle relative to origin.

Command:

CT+GETOFFSETANGLE();

Expected Response:

OffsetAngle=+16.12°    // 16.12° clockwise from origin

Example 5: Manual Camera Trigger

Requirement: Manually trigger camera focus and shutter.

Command:

CT+CAMERACTRL(1,1);

Expected Response:

CR+OK;

Error Handling

When the turntable receives an invalid command, it returns an error code:

Error Code Meaning
CR+ERR=31 Command receive timeout
CR+ERR=40 Device does not support this function
CR+ERR=41 Command too short (< 5 characters)
CR+ERR=42 Invalid command prefix (not “CT”)
CR+ERR=43 Invalid separator (not “+”)
CR+ERR=45 Invalid parameter start (not “(“)
CR+ERR=46 Invalid parameter end (not “)”)
CR+ERR=48 Invalid command terminator (not “;”)
CR+ERR=51 Command name too long
CR+ERR=52 Invalid command name
CR+ERR=61 Empty parameter
CR+ERR=62 Parameter too long
CR+ERR=63 Too many parameters
CR+ERR=64 Parameter count mismatch
CR+ERR=70 Parameter is not numeric
CR+ERR=80 Parameter value out of valid range

Best Practices for Secondary Development

1. Implement Heartbeat Monitoring

Always implement heartbeat monitoring in your application. If the turntable stops receiving heartbeats, it may enter an unknown state.

2. Use Acknowledgment and Events

Enable CT+ACK(1) and CT+EVENT(1) to receive confirmation and completion notifications. This ensures your application knows when commands have been executed.

3. Save Configuration

Use CT+SAVECONF() to save settings to flash memory. The turntable will use these settings after power cycling.

4. Handle Errors Gracefully

Implement error handling for all commands. The turntable may reject commands due to invalid parameters or unsupported features.

5. Test with TurntableX First

Before writing code, use TurntableX to test commands interactively. The software displays every command it sends – use this as a reference for your own implementation.

6. Consider Connection Priority

When both USB and other control methods are active, USB commands take priority. This prevents conflicts in multi-control environments.

7. Use the Unique EBC for Licensing

The CT+GETEBC() command returns a unique Electronic Birth Code for each turntable. Use this to implement software licensing or device authentication in your applications.


Command Quick Reference

Category Command Example
System CT+HEARTBEAT(1); Enable heartbeat
System CT+SAVECONF(); Save settings to flash
Query CT+GETPN(); Get product name
Query CT+GETOFFSETANGLE(); Get current position
Motion CT+TURNSINGLE(0,45.0); Rotate 45° clockwise
Motion CT+START(0,1,1,15,2,24); 24-step 360° rotation
Motion CT+SETSTOP(); Stop rotation
Position CT+SETZERO(); Set current position as origin
Position CT+TOZERO(); Return to origin
Shutter CT+SETAUTOSHUTTER(1); Enable auto shutter
Shutter CT+CAMERACTRL(1,1); Trigger focus + shutter
Lighting CT+SETRGBCOLOR(255,0,0); Set LED to red

Conclusion

ComXim programmable turntables offer one of the most accessible and flexible secondary development platforms in the motorized turntable market. The unified CT command system works identically across USB, Wi-Fi, and Bluetooth connections, and the plain-text command format means you can integrate turntable control into virtually any programming environment.

Key takeaways for developers:

  • Start simple – Use TurntableX to learn commands interactively
  • Use the CT Command List – The complete documentation is your reference guide
  • Implement heartbeat monitoring – Ensures reliable communication
  • Handle errors – The turntable provides detailed error codes
  • Save configuration – Settings persist across power cycles
  • Test thoroughly – Verify commands with the turntable before deploying to production

Whether you are building a custom photography automation system, integrating a turntable into an industrial workflow, or developing a commercial application, the ComXim CT command system provides the control, flexibility, and reliability you need.


Additional Resources

Resource Link
Official Website comxim.com
User Manual & Documentation comxim.com/user-guide
Software & Apps Download comxim.com/softwareapps-demo
USB Driver comxim.com/download-usb-driver
Developer Tools comxim.com/development-kit
Latest CT Command List comxim.com/the-new-command-list
Developer Help Center comxim.com/developer-help-center
Video: SDK Command Tutorial comxim.com/turntable-sdk-command-video-tutorial

Leave a Reply

Your email address will not be published. Required fields are marked *


类似文章

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注