The instruction system of FQM1 is a software manifestation of its powerful functionality. The manual systematically categorizes instructions by function, forming a large and organized instruction set. The following is a deep analysis of several types of core instructions:
Core commands for motion control (high-speed counter and pulse output):
This is the core value of FQM1 as a motion controller. The instruction set provides fine control over high-speed counting and pulse output:
INI (880) (Mode Control): As the "main switch" for motion control, it can start/stop comparison, change the current value (PV) and ring count value of high-speed counter/pulse output, and even immediately stop pulse output.
PRV (881) (High Speed Counter PV Reading): Used to read the current value of the high-speed counter, latch value, or pulse output counter in real time, and is the basis for position feedback and closed-loop control.
CTBL (882) (Comparison Table Login): Allow users to register a target value or range comparison table. When the PV value output by the high-speed counter or pulse matches the value in the table, an interrupt task can be triggered. This is the key to achieving complex synchronous control such as electronic cam and flying shear.
SPED (885) (speed output) and PULS (886) (pulse setting): These two instructions are used in combination to form the basic framework of positioning control. PULS (886) sets the number of pulses to be output (target position), while SPED (885) sets the output frequency (target speed), achieving fast positioning without acceleration or deceleration.
ACC (888) (acceleration/deceleration control) and PLS2 (887) (pulse output): These two commands are used for applications that require smooth motion. ACC (888) provides the same acceleration and deceleration rates, while PLS2 (887) allows for separate acceleration and deceleration rates, enabling more complex trapezoidal or S-shaped velocity curves.
Data processing and operation instructions:
In addition to motion control, FQM1 also has powerful data processing capabilities to meet complex process calculation requirements.
Arithmetic operation instructions: Provides rich mathematical operations, including signed/unsigned binary, BCD code addition (+,+L), subtraction (-, - L), multiplication (*, * L), division (/,/L) operations, and all support carry (+C, - C) operations, capable of handling high-precision, large-scale numerical calculations.
Floating point operation instructions: In order to handle more complex engineering calculations such as trigonometric functions, exponents, logarithms, etc., the instruction set includes two sets of floating-point operation instructions: single precision (+F, - F, SIN, COS, etc.) and double precision (+D, - D, SIND, COSD, etc.). This provides a mathematical foundation for advanced applications such as robot kinematics and CNC interpolation.
Data conversion instructions: BIN (023), BCD (024), ASC (086), HEX (162) and other instructions, which achieve flexible conversion between different data formats (BCD, binary, ASCII), ensuring compatibility between data and external devices (such as touch screens, barcode scanners) during interaction.
Program flow and organizational instructions:
Efficient programming cannot be achieved without a clear organizational structure.
Subroutines and macroinstructions: SBS (091) (subroutine calls) and MCRO (099) (macroinstructions) are used to modularize reusable program segments and improve code reuse. MCRO (099) implements a calling method similar to high-level language "functions" by fixing input/output parameters (A540-A549), making the program structure clearer.
Block program instructions: BPRG (096) and BEND (801) define block program regions. Combined with branch instructions such as IF (802), ELSE (803), IEND (804), etc., a series of internal instructions can be unconditionally executed and conditionally branched under one input condition, simplifying the programming of complex logic.
Step instructions: STEP (008) and SNXT (009) provide powerful tools for building sequential control programs. It allows for the decomposition of complex processes into multiple steps, with each step advancing to the next after meeting certain conditions, making it highly suitable for automated equipment with clear procedures such as assembly and processing.
Performance optimization and debugging
In order to ensure the stable operation of the system under high-performance requirements, FQM1 provides various instructions and functions for optimization and debugging.
Execution time and steps: The manual provides a detailed list of the execution time and number of program steps for each instruction in Chapter 4. For example, the execution time of basic LD and AND instructions is only 0.10 microseconds, while the execution time of complex EXP (467) (exponential) instructions is about 18 microseconds. These data are crucial for engineers to accurately estimate program scanning cycles, optimize key program segments, and achieve high-speed control. Especially when dealing with high-speed counter interrupts and pulse outputs, it is necessary to ensure that the program execution time meets real-time requirements.