1. Coordinate SCL/SCLD/SCLF/SCL2/SCL2D/SCL2F
1. Coordinate SCL/SCLD/SCLF/SCL2/SCL2D/SCL2F
1.1. Instruction Description
Single Character Coordinate Setting (SCL) is an instruction that coordinates the input value (IN) based on a specified data table and outputs (OUT).
Double Character Coordinate Setting (SCLD) and Floating Point Coordinate Setting (SCLF) correspond to the types of double characters and floating points, respectively.
SCL2, SCL2D, and SCL2F are the corresponding versions of SCL, SCLD, and SCLF, respectively. The table structures of all coordinate commands have their own differences.
1.2. Single word coordinate SCL
Based on the specified conversion characteristics, perform coordinate calibration on the input value (IN) and save it to the output (OUT).
The transformation used for fixed coordinates is performed based on the data table saved at the beginning of the software component specified in (T).
However, when the output data is not an integer value, it is rounded to the first decimal place and output.
For example, SCL D200 D100 D201, find the output value corresponding to the input value D200 from the table starting with D100, and save it to D201.
| Set project | Allocate software components based on data table (taking D100 as an example) | |
|---|---|---|
| Coordinate point count (becomes' 5 'when on the right) | D100 | |
| Point 1 | X coordinate | D101 |
| Y coordinate | D102 | |
| Point 2 | X coordinate | D103 |
| Y coordinate | D104 | |
| Point 3 | X coordinate | D105 |
| Y coordinate | D106 | |
| Point 4 | X coordinate | D107 |
| Y coordinate | D108 | |
| Point 5 | X coordinate | D109 |
| Y coordinate | D110 |
图1 Single word Coordinate Setting
1.3. Double word coordinateSCLD
In the double word coordinate SCLD instruction, each parameter and item in the table are double word integers connected by two registers.
For example, SCLD D200 D100 D202, find the output value corresponding to the input value D200D201 from the table starting with D100D101, and save it to D202D203.
| Set project | Allocate software components based on data table (taking D100 as an example) | |
|---|---|---|
| Coordinate point count (becomes' 5 'when on the right) | D100D101 | |
| Point 1 | X coordinate | D102D103 |
| Y coordinate | D104D105 | |
| Point 2 | X coordinate | D106D107 |
| Y coordinate | D108D109 | |
| Point 3 | X coordinate | D110D111 |
| Y coordinate | D112D113 | |
| Point 4 | X coordinate | D11D415 |
| Y coordinate | D116D117 | |
| Point 5 | X coordinate | D118D119 |
| Y coordinate | D120D121 |
图2 Double word Coordinate Setting
1.4. Floating point coordinate SCLF
In the floating-point coordinate SCLF instruction, each parameter and item in the table is a double word floating-point connected by two registers.
For example, SCLF D200 D100 D202, find the output value corresponding to the input value D200D201 from the table starting with D100D101, and save it to D202D203.
| Set project | Allocate software components based on data table (taking D100 as an example) | |
|---|---|---|
| Coordinate point count (becomes' 5 'when on the right) | D100D101 (double word floating point) | |
| Point 1 | X coordinate | D102D103 (floating point) |
| Y coordinate | D104D105 (floating point) | |
| Point 2 | X coordinate | D106D107 (floating point) |
| Y coordinate | D108D109 (floating point) | |
| Point 3 | X coordinate | D110D111 (floating point) |
| Y coordinate | D112D113 (floating point) | |
| Point 4 | X coordinate | D114:115 (floating point) |
| Y coordinate | D116D117 (floating point) | |
| Point 5 | X coordinate | D118D119 (floating point) |
| Y coordinate | D120D121 (floating point) |
图3 Floating point fixed coordinates
1.5. Single word coordinate SCL2(X,Y coordinate separate)
Unlike SCL, the data table of SCL2 first places the X coordinates of each point continuously together, and then the Y coordinates are continuously placed together.
| Set project | Allocate software components based on data table (taking D100 as an example) | |
|---|---|---|
| Coordinate point count (becomes' 5 'when on the right) | D100 | |
| X coordinate | Point 1 | D101 |
| Point 2 | D102 | |
| Point 3 | D103 | |
| Point 4 | D104 | |
| Point 5 | D105 | |
| Y coordinate | Point 1 | D106 |
| Point 2 | D107 | |
| Point 3 | D108 | |
| Point 4 | D109 | |
| Point 5 | D110 |
图4 Single word coordinates set(X,Y coordinate separate
1.6. Double coordinate SCL2D(X,Y coordinate separate)
Unlike SCLD, the data table of SCL2D first places the X coordinates of each point continuously together, and then the Y coordinates are continuously placed together.
| Set project | Allocate software components based on data table (taking D100 as an example) | |
|---|---|---|
| Coordinate point count (becomes' 5 'when on the right) | D100D101 | |
| X coordinate | Point 1 | D102D103 |
| Point 2 | D104D105 | |
| Point 3 | D106D107 | |
| Point 4 | D108D109 | |
| Point 5 | D110D111 | |
| Y coordinate | Point 1 | D112D113 |
| Point 2 | D11D415 | |
| Point 3 | D116D117 | |
| Point 4 | D118D119 | |
| Point 5 | D120D121 |
图5 Double word coordinate setting(X,Y coordinate separate)
1.7. Float coordinate setting SCL2F(X,Y coordinate separate)
Unlike SCLF, the data table of SCL2F first places the X coordinates of each point continuously together, and then the Y coordinates are continuously placed together.
| Set project | Allocate software components based on data table (taking D100 as an example) | |
|---|---|---|
| Coordinate point count (becomes' 5 'when on the right) | D100D101 (double word floating point) | |
| X coordinate | Point 1 | D102D103 (floating point) |
| Point 2 | D104D105 (floating point) | |
| Point 3 | D106D107 (floating point) | |
| Point 4 | D108D109 (floating point) | |
| Point 5 | D110D111 (floating point) | |
| Y coordinate | Point 1 | D112D113 (floating point) |
| Point 2 | D11D415 (floating point) | |
| Point 3 | D116D117 (floating point) | |
| Point 4 | D118D119 (floating point) | |
| Point 5 | D120D121 (floating point) |
图6 Float coordinate setting(X,Y coordinate separate)
1.8. Example of Setting Conversion Tables for Fixed Coordinates
In the example of setting a conversion table for fixed coordinates, a 16 bit operation is given. When performing a 32-bit operation, please use 32-bit data to set the data in each setting item.
When using conversion characteristics for the fixed coordinates shown in the following figure, please set it to the data table shown below
图7 Transfer image
| Setting Project | D specifies D100 | Setting Content | Remarks | ||
|---|---|---|---|---|---|
| Coordinate points | D | D100 | K10 | ||
| Point 1 | X coordinate | D+1 | D101 | K5 | |
| Y coordinate | D+2 | D102 | K7 | ||
| Point 2 | X coordinate | D+3 | D103 | K20 | |
| Y coordinate | D+4 | D104 | K30 | ||
| Point 3 | X coordinate | D+5 | D105 | K50 | |
| Y coordinate | D+6 | D106 | K100 | ||
| Point 4 | X coordinate | D+7 | D107 | K200 | If the coordinates of 3 points are specified like this, the output value is the middle value. In this example, the Y coordinate of point 5 is specified as the output value (intermediate value). In addition, even if the X coordinates of 3 or more points are the same, the value of the second point is output. |
| Y coordinate | D+8 | D108 | K25 | ||
| Point 5 | X coordinate | D+9 | D109 | K200 | |
| Y coordinate | D+10 | D110 | K75 | ||
| Point 6 | X coordinate | D+11 | D111 | K200 | |
| Y coordinate | D+12 | D112 | K250 | ||
| Point 7 | X coordinate | D+13 | D113 | K250 | |
| Y coordinate | D+14 | D114 | K90 | ||
| Point 8 | X coordinate | D+15 | D115 | K350 | If the coordinates of two points are specified like this, the output value will take the Y coordinate value of the next point. In this example, the Y coordinate of point 9 is specified as the output value. |
| Y coordinate | D+16 | D116 | K90 | ||
| Point 9 | X coordinate | D+17 | D117 | K350 | |
| Y coordinate | D+18 | D118 | K300 | ||
| Point 10 | X coordinate | D+19 | D119 | K400 | |
| Y coordinate | D+20 | D120 | K7 |
1.9. The valid operands of the instruction
1.9.1. Single word coordinateSCL
| Input/Output | Data Type | operand | Description |
|---|---|---|---|
| IN | 16 bit integer | D/CV/TV/AI/AO/K/H/V/Z/FD, bit composite word (X/Y/M/C/T/S), local variable (LW) | Input |
| DATA | 16 bit integer | D/CV/TV/AI/AO/K/H/V/Z/FD, bit composite word (X/Y/M/C/T/S), local variable (LW) | Data |
| OUT | 16 bit integer | D/CV/TV/AO/V/Z, bit composite word (Y/M/C/T/S), local variable (LW) | output |
1.9.2. Double word coordinate SCLD
| Input/Output | Data Type | operand | Description |
|---|---|---|---|
| IN | 32-bit integer | D/CV/K/H/FD, bit composite word (X/Y/M/C/T/S), local variable (LD) | input |
| DATA | 32-bit integer | D/CV/K/H/FD, bit composite word (X/Y/M/C/T/S), local variable (LD) | Data |
| OUT | 32-bit integer | D/CV, bit composite word (Y/M/C/T/S), local variable (LD) | output |
1.9.3. Float coordinate SCLF
| Input/Output | Data Type | operand | Description |
|---|---|---|---|
| IN | 32-bit integer | D/CV/K/H/FD, bit composite word (X/Y/M/C/T/S), local variable (LD) | input |
| DATA | 32-bit integer | D/CV/K/H/FD, bit composite word (X/Y/M/C/T/S), local variable (LD) | Data |
| OUT | 32-bit integer | D/CV, bit composite word (Y/M/C/T/S), local variable (LD) | output |
1.10. Example
Command table:
NETWORK 000
LD M8151
SCL D200 D100 D201 // Based on the input value D200 and table D100, calibrate and control the output D201
图8 SCL