Summary of Contents for Servotronix softMC Compact 302
Page 2
If you need assistance with the installation and configuration of the SC302 motion controller, contact Servotronix technical support. Tel: 400-111-8669 Customer Service Servotronix is committed to delivering quality customer service and support for all our products. Our goal is to provide our customers with the information and resources so...
Page 3
If you are unable to contact your local sales representative for any reason, please use the most relevant of the contact details below: For all other inquiries regarding SC302 motion controller or other Servotronix products, contact: m.servotronix.com.cn Unpacking Upon arrival, please open the package and remove all packaging materials.
1. Safety Precautions 1. Safety Precautions 1.1 Safety statement 1) This chapter explains the safety matters that need to be paid attention to when using this product. Before using this product, please read the instruction manual and correctly understand the relevant information of safety precautions. Failure to comply with the agreed items in safety matters may lead to death, serious injury or equipment damage.
Page 8
1. Safety Precautions 1) In the illustrations in this manual, sometimes the product is in the state of removing the cover or safety cover in order to show the details of the product. When using, please be sure to install the cover or protective cover according to the requirements, and operate according to the fixed principles.
Page 9
1. Safety Precautions ⚫ When lifting the product with wire rope, please lift it smoothly and evenly, so as to avoid the product from vibration and shock. Don’t flip the product, and don’t let it hang for a long time, otherwise there will be a risk of personal injury or product damage! ⚫...
Page 10
1. Safety Precautions Installation ⚫ Do not twist the fixing bolts of product parts and components and the bolts marked in red! ⚫ When this product is installed in a cabinet or terminal equipment, the cabinet or terminal equipment should be equipped with corresponding protective devices such as fire-proof enclosure, electrical protective enclosure and mechanical protective enclosure, and the protection class should meet the requirements of relevant IEC standards and local laws and regulations.
Page 11
1. Safety Precautions equipment or products, otherwise it will cause equipment damage and even fire. ⚫ When the driving equipment is connected to the motor, please ensure that the sequence of the product and the motor terminal is accurate and consistent, so as to avoid the reverse rotation of the motor.
Page 12
1. Safety Precautions ⚫ Non-professionals are strictly forbidden from running the product, otherwise it will lead to personal injury or death! ⚫ It is forbidden to touch any terminal of the equipment and remove any device or parts of the equipment and products during operation, otherwise there is a danger of electric shock! ⚫...
2. Introduction 2.1 SC302 Overview 2.1.1 Product overview The SC302 motion controller from SERVOTRONIX provides users with intelligent automation solutions. SC302 adopts IEC61131-3 programming language system and supports PLCopen programming language. SC302 uses expandable structure and supports 16 local ET series IO modules through the internal bus protocol; besides, other devices can be connected through various industrial field buses such as EtherCAT and CANopen.
2. Introduction Figure 2-2 Front View of SC302 Motion Controller + ET Series IO Module 2.1.2 Controller features 1) A variety of motion control, such as point-to-point motion, gear, linear interpolation, electronic cam; 2) Support up to 10000+ I/Os; 3) Adequate program capacity and data storage area; 4) Fast instruction execution;...
2. Introduction Note: All models of bus EtherCAT, CANOpen, and OPCUA are supported. 2.2 CODESYS Overview 2.2.1 Introduction of CODESYS CODESYS stands for controller development system. It is a development environment for programming controller applications developed by 3S Company. The version currently used by our company is CODESYS V3.5 SP17 Patch4 platform, which provides a complete set of configuration, programming, debugging and monitoring environment for programming controllers.
2. Introduction 2.2.2 Connecting CODESYS to hardware Programming devices can use CODESYS software to write user programs via Ethernet (which can go through hubs, switches, etc.). Download the program to PLC, then monitor the program and control PLC. Ethernet cable Figure 2-3 Controller and PC Connected via Network Cable When downloading CODESYS application using PORT2 EtherNet port, please modify the IP of the computer network port, which must be located in the same network segment as...
Page 18
IP address of the connected network port. Open CODESYS IDE and install the device description XML file of the controller (get it from SERVOTRONIX sales staff), then you can scan the controller and download the application program.
V3.5SP17 Patch 4 from CODESYS official website. CODESYS official website:https://store.codesys.com/codesys.html#product.attributes.wrapper; or you can contact the sales staff of Midea SERVOTRONIX to obtain it. The desktop PC or laptop PC on which the software is installed requires the following: Window10 operating system, 64bit operating system is recommended;...
Page 20
2. Introduction When installing CODESYS for the first time, please check the free space on the computer hard disk, and ensure that the target disk to be installed has more than 20 GB of free space, and then you can install directly. If you are upgrading and installing CODESYS, please back up your existing working files, and then uninstall the old version of CODESYS, and restart your computer before starting to install the new version of the software.
3. Introduction to Hardware Parameters Name Function SD card interface 1. Users can insert the SD card by themselves and store the CODESYS application when the SD is inserted. (Note: The factory default does not come with an SD card) Dip switch Control the start and stop of CODESYS application RESET button...
3. Introduction to Hardware Parameters Special 10000 Save Special Special register Words register Program power EMMC holding (if power down occurs when the power-on time is less than 30s, down mode the power down holding will not be performed.) 3.1.4 External dimensions Figure 3-2 SC302 External Dimensions 3.2 Hardware interface details 3.2.1 Digital input...
3. Introduction to Hardware Parameters ON voltage >15V DC >15V DC OFF voltage < 5V DC < 5V DC Port filter time Software configurable 10ms Input impedance — 4.3K ohms Input signal form Support NPN and PNP input Support NPN and PNP input Isolation mode Optocoupler isolation Optocoupler isolation...
3. Introduction to Hardware Parameters Item Specifications ON→OFF response time 1 us (hardware response time) OFF→ON response time 2 us (hardware response time) Resistance load 0.5A/ point Maximum load Inductive load 7.2W/point Lamp load 5W/point Isolation mode Digital isolation Output display When outputting, the input indicator light is on Preventing short-circuit output Restore short circuit protection...
3. Introduction to Hardware Parameters CANL CANL CAN_L CGND CGND Grounded Internal circuit: 120Ω terminal resistance CAN bus connection topology is as follows. For CAN bus, it is recommended to use shielded twisted pair cable, and two 120Ω terminal matching resistors are connected at both ends of the bus to prevent signal reflection.
Page 28
3. Introduction to Hardware Parameters Program port COM4 Baud rate 9600-115200 Data bit Check bit None Stop bit Supported protocols Free protocol, Modbus RTU Slave, Modbus RTU Master Table 3-10 RS485 Interface Definitions RS485 interface pin definition Signal name Function RS485+ RS485 differential to positive signal...
3. Introduction to Hardware Parameters short as possible, and it is recommended not to exceed 3m. Put an end to star connection. The common bus structure is shown below: Recommended RS485 bus Slave Slave Slave Slave Master Figure 3-7 Daisy Chain Connection Structure Recommended RS485 bus Slave...
3. Introduction to Hardware Parameters must also be connected to the CGND terminal. In any node or midway position, the shielding layer is forbidden to be connected to any other place (including the field casing and equipment grounding terminal, etc.) except the CGND of the node. Due to the attenuation of cables, it is recommended to use AGW26 or thicker cables for cables with connection length greater than 3m, and it is recommended to use twisted pair cables for 485+ and 485- connection cables at any time.
3. Introduction to Hardware Parameters RTU Master Table 3-24 RS232 Interface Definitions RS232 interface pin definition Signal name Function Receiving data Sending data Power ground 3.2.6 24V DC Power Supply Table 3-11 24V DC Interface Definition DC24V interface pin definition Signal name Function 24 DC positive...
3. Introduction to Hardware Parameters /udisk directory. (2) Insert USB to serial port module When the USB is converted to a serial port module, it will be automatically mapped to the COM6 and COM7 ports. The first inserted module port is COM6 and the second inserted module port is COM7.
3. Introduction to Hardware Parameters ⚫ Wirings How to make network cable Network port connector - crystal head- 8P8C-3 fork type Network port connector - crystal head- 8P8C-3 fork type 26AWG Cat 5e shielded twisted pair cable Figure 3-11 Requirements for Making EtherCat Network Cable Table 3-15 Signal Lead Distribution Signal Signal direction...
3. Introduction to Hardware Parameters Operation description Remarks Descriptio unexpected power-off operation during operation. Before CODESYS starts normally, long press the RESET key If you encounter Force until the green light of RUN flashes, and the CODESYS a serious deletion application will be deleted.
Page 36
3. Introduction to Hardware Parameters Indicator Colour Status Function Remarks light name (1) When the PLC stops, the red light of RUN is Norma normally on lly on (2) Normally on when the data is saved during power down (3) During system startup (hardware default control) (2-color Flash 5 (1) When the system is started normally, short press...
3. Introduction to Hardware Parameters Indicator Colour Status Function Remarks light name Flashin (such as unplug the network cable) Green CPU module power indicator light Norma When the 232Tx/RX sends and receives data for normal lly on communication, the green light is always on. Green 232 Tx or RX is abnormal Flashin...
3. Introduction to Hardware Parameters Note: This network port is recommended to be used as the download and debugging port for CODESYS application. 3.2.15 RTC Clock Hardware supports RTC power down saving, and the service life of button cell is 3 years.
4. Configuring EtherCAT Servo Figure 4-2 Adding EtherCAT Master Softmotion (2) 4.3. Configuring EtherCAT Master Double-click EtherCAT_Master_Softmotion in the device tree; in the general options, select Select Network by Name, and fill in eth2 for the network name. eth2 is the EtherCAT...
4. Configuring EtherCAT Servo network port for connecting EtherCAT devices. Set the EtherCAT bus cycle. Bus cycle: SC302 controller supports various scanning cycles. Users can choose the appropriate bus cycle according to the number of connected slaves. Figure 4-3 Configuring EtherCAT Network Port 4.4 Scanning devices Before scanning devices, you need to log in the software first, then right click EtherCAT Master Softmotion in the device tree, and select Scan:...
Page 44
4. Configuring EtherCAT Servo Figure 5-4 Automatic Scanning In the pop-up interface, select all modules. Click Copy All Devices to Project, and the corresponding modules will appear under therCAT MasterSoftmotion after adding successfully.
4. Configuring EtherCAT Servo 4.5 Adding 402 Axis Right click the servo, then Add SoftMotion CiA402 Axis Figure 4-5 Adding 402 Axis 4.6 Configuring axis parameters Configure the motor resolution according to the actual motor parameters, and configure the reduction ratio according to the actual needs.
5.IO Module 5. IO Module 5.1 Input/output Introduction The IO hardware of the controller body comes with 8 high-speed inputs, 4 low-speed inputs, and 8 high-speed outputs. All IOs on the controller can be used as ordinary IO. In high-speed input and output pulse control mode, it supports a maximum pulse frequency of 200K.
Page 48
5.IO Module Figure 5-1-1 Appearance Diagram of Main Body IO ⚫ Main Body IO channel definition Table 5-1-2 Definition of Input Terminals on the Main Body Definition IN0 terminal Definition IN1 terminal High speed input IN0-1 High speed input IN1.1 High speed input IN0-2 High speed input...
5.IO Module Figure 5-1-6 Output Port Mode Configuration [Example] If Axis0 is set to pulse + direction, the controller OUT0-1-Mode should be set to pulse + direction. The OUT0-2-Mode configuration is invalid (occupied by the direction of OUT0-1-Mode) and does not need to be configured. The external physical wiring mode: OUT0-1 terminal should be connected to the external pulse signal;...
Page 52
5.IO Module Figure 5-2-1 Adding High Speed IO External Library Figure 5-2-2 Adding High Speed IO External Library...
5.IO Module Figure 5-2-3 Adding High Speed IO External Library 5.3 Adding LocalHSIO Device Right click and select Device (Servotronix-ARM-Linux SM EtherCAT) in the device tree; select Add Device, select LocalHSIO, and select Add Device.
5.IO Module Figure 5-3-2 Adding LocalHSIO Device (2) 5.4 Configuring LocalHSIO Device Double-click LocalHSIO in the device tree to configure HSIO Parameters. The parameters include input port filter time, input interrupt type configuration, output port configuration, counter configuration, and axis parameter configuration.
Page 56
5.IO Module Figure 5-4-1 Configuring LocalHSIO device ⚫ PortInFilter input port filtering time configuration Figure 5-4-2 Input Port Filtering Time Configuration The filter time configuration of the 12 input ports IN0~IN1 of the main body can be set by entering the value in the 'Value' item on the page. The filter time supports a maximum of 64000us.
Page 57
5.IO Module The interrupt trigger type configuration page for high speed input ports does not support the interrupt type configuration for low speed input ports. When the input port is occupied by the counter function, the interrupt type configuration is invalid. The interrupt type configuration of the corresponding port will only take effect when the corresponding counter is inactive or set to level sampling.
Page 58
5.IO Module Cnt0CmpOut Comparison output port of counter 0 Cnt1CmpOut Comparison output port of counter 1 Cnt2CmpOut Comparison output port of counter 2 Cnt3CmpOut Comparison output port of counter 3 Cnt4CmpOut Comparison output port of counter 4 Cnt5CmpOut Comparison output port of counter 5 Cnt6CmpOut Comparison output port of counter 6 Cnt7CmpOut...
5.IO Module counting counting method Phase AB double frequency Two-phase AB double frequency counting counting method Phase AB quadruple frequency Two-phase AB quadruple frequency counting counting method Pulse+direction count Pulse signal and direction signal counting method The counting method supports two methods: circular counting and linear counting. a) Loop counting method: The counting range set by the function block is [-2147483648, 2147483647], which can include -2147483648 and 2147483647.
5.IO Module rotation direction also needs to refer to the internal motor parameter settings of the servo drive. b) HomeMode: Home mode, currently supports three home modes: Home Mode 1, Home Mode 2, and Home Mode 3. Please refer to Chapter 5.5.7 HSMC_Home for details.
5.IO Module bError Fault flag BOOL TRUE,FALSE eErrorID Error code HSMC_ERROR_CODE ⚫ Function block description It sets the enabled state of the pulse axis, valid at high level. When bEnable is set to TRUE, the axis enters the enabled state, the Status signal of the command is valid, and then the axis operation related function blocks can be executed.
Page 62
5.IO Module Axis absolute HSMC_MoveAbsoulte position motion ⚫ Input variables Name Description Type Range Initial value Axis Pulse axis index BYTE 0 - 7 bExecute Execution switch, edge BOOL TRUE,FALSE FALSE triggered dPosition Axis target position DINT Follow data Unit: Pulse type dVelocity Axis velocity, maximum 200K...
5.IO Module 3. dAcceleration is the acceleration of the axis motion, and dDeceleration is the deceleration of the axis motion. It is recommended that dAcceleration and dDeceleration be set consistent. 5.5.4.HSMC_MoveRelative Pulse axis relative position motion function block. ⚫ Command format Commands Name LD performance...
5.IO Module This function block supports the relative position motion of the high-speed pulse axis. bExecute is the rising edge trigger function block and dDistance is the relative motion distance of the pulse axis. 1. The relative motion trajectory is T-shaped routing, and the maximum position of dDistance is 2147483647.
5.IO Module direction ⚫ Output variable Name Description Type Range Initial value bDone Done flag BOOL TRUE,FALSE bBusy Execution flag BOOL TRUE,FALSE bCommandAborted Abort flag BOOL TRUE,FALSE bError Fault flag BOOL TRUE,FALSE eErrorID Error code HSMC_ERROR_CODE ⚫ Function block description This function block supports the relative position motion of the high-speed pulse axis.
5.IO Module bJogForward Jog runs forward, level BOOL TRUE,FALSE FALSE triggered bJogBackward Jog runs backward, level BOOL TRUE,FALSE FALSE triggered dVelocity Axis velocity, maximum 200K UDINT Follow data Unit: Pulse/s type dAcceleration Axial acceleration Follow data UDINT Unit: Pulse/s^2 type dDeceleration Axial deceleration Follow data...
Page 67
5.IO Module Pulse axis homing motion function block. ⚫ Command format Commands Name LD performance Axis homing HSMC_MoveHome motion ⚫ Input variables Name Description Type Range Initial value Axis Pulse axis index BYTE 0 - 7 bExecute Execution switch, edge BOOL TRUE,FALSE FALSE...
Page 68
5.IO Module ➢ Homing mode 0: Mode0 homign immediately After the function block performs the homing operation, the current position is used as the zero position. The function has the same effect as HSMC_SetPosition. ➢ Homing mode 1: Mode1 homing in the positive direction, and the origin is the home switch.
5.IO Module Homing mode 2: Mode2 homing in the negative direction, and the origin is the home switch. When the starting position is to the left of the origin, the homing process cannot be performed. Axis negative direction Rotation Mechanical equipment Motor Motor Home switch...
5.IO Module ⚫ Input variables Name Description Type Range Initial value Axis Pulse axis index BYTE 0 - 7 bExecute Execution switch, edge BOOL TRUE,FALSE FALSE triggered dPosition Axis target position DINT Follow data Unit: Pulse type ⚫ Output variable Name Description Type...
5.IO Module bBusy Execution flag BOOL TRUE,FALSE bCommandAbort Abort state BOOL TRUE,FALSE bError Fault flag BOOL TRUE,FALSE eErrorID Error code HSMC_ERROR_CODE ⚫ Function block description This function block is used to periodically set the coordinate position fSetPosition of the pulse axis. 1.
5.IO Module Name Description Type Range Initial value bBusy Execution flag BOOL TRUE,FALSE bCommandAborted Abort state BOOL TRUE,FALSE bError Fault flag BOOL TRUE,FALSE eErrorID Error code HSMC_ERROR_CODE ⚫ Function block description This function block is used to periodically set the running velocity of the pulse axis fSetVelocity.
5.IO Module bError Fault flag BOOL TRUE,FALSE eErrorID Error code HSMC_ERROR_CODE ⚫ Function block description This function block performs the deceleration and stop process of the pulse axis under normal operation conditions. In the function block, bExecute is the edge triggered. When bExecute is set to TRUE, the pulse axis decelerates according to the set deceleration dDeceleration.
5.IO Module Name Description Type Range Initial value bInVelocity Frequency reaches BOOL TRUE,FALSE setting mark bBusy Execution flag BOOL TRUE,FALSE bError Fault flag BOOL TRUE,FALSE eErrorID Error code HSMC_ERROR_CODE ⚫ Function block description This function block is used for PWM pulse output control. 1.
Page 75
5.IO Module Set pulse HSMC_WriteParameter axis parameters ⚫ Input variables Name Description Type Range Initial value Axis Pulse axis index BYTE 0 - 7 bExecute Execution switch, edge BOOL TRUE,FALSE FALSE triggered fFactor Output command scaling LREAL bTurnDir Motor rotational direction BOOL Follow data FALSE...
5.IO Module The function block bExecute is edge triggered. When bExecute is a rising edge, the function performs the pulse axis parameter writing operation. After the function block parameter writing is completed, the output status of bDone changes to TRUE. The function block command scaling ratio fFactor is used to set the position command ratio and velocity ratio received by the pulse axis.
Page 77
5.IO Module Pulse axis reading parameter function block. ⚫ Command format Commands Name LD performance Reading HSMC_ReadParameter pulse axis parameters ⚫ Input variables Name Description Type Range Initial value Axis Pulse axis index BYTE 0 - 7 bEnable Level control BOOL TRUE,FALSE FALSE...
5.IO Module bActive Function block BOOL TRUE,FALSE valid flag bError Fault flag BOOL TRUE,FALSE eErrorID Error code HSMC_ERROR_CODE ⚫ Function block description This function block is used to read pulse axis parameter values periodically. When the bEnable value in the function block is TRUE, it means starting to read the pulse axis parameter value periodically, and the bActive output state will also change to TRUE;...
Page 79
5.IO Module Figure 5-6-1-1 Pulse Output Configuration and Axis Configuration Diagram 2. Hardware wiring If the controller output needs to be connected to a real pulse axis device, the controller output port OUT0-1 is the pulse signal output and is connected to the pulse signal input signal bit of the pulse axis;...
Page 80
5.IO Module Figure 5-6-1-2 Function Block Execution Display Figure 5-6-1-3 Periodic Reading of Axis Status...
5.IO Module 5.6.2. Jog motion [Example] The pulse axis Axis0 performs Jog motion. For example, if the output control is in pulse+direction mode, the following steps need to be performed: 1. Pulse output type and Axis configuration Please refer to the configuration in 5.6.1 Absolute positioning motion example; 2.
Page 82
5.IO Module Figure 5-6-2-1 Function Block Execution Display Figure 5-6-2-2 Periodic Reading of Axis Status...
5.IO Module 5.6.3. Follow velocity motion [Example] The pulse axis Axis2 follows the velocity of the pulse axis Axis0. Axis0 performs Jog forward motion. The output control of Axis0 and Axis2 is pulse + direction mode. For example, the following steps need to be performed: 1.
Page 85
5.IO Module The pulse port OUT1-4 output ports perform PWM output. The PWM period is 1000us and the duty cycle is 50% (dPulseWidth high level width is 500us). The following steps need to be performed: 1.Pulse output type configuration Double-click to select the LocalHSIO device, enter the HSIO parameter page, set OUT1-4-Mode in PortOutMode to PWM, then the output of the corresponding controller hardware output OUT1-4 ports is set to PWM output mode, as shown in the following figure:...
5.IO Module Figure 5-6-4-2 Function Block Execution Display 5.7. Introduction to high-speed input function block 5.7.1. HS_Counter Counter counting start and end function block. ⚫ Command format Commands Name LD performance Counter counting HS_Counter start and ⚫ Input variables Name Description Type Range...
Page 87
5.IO Module bResetFlag Counter overflow reset BOOL TRUE,FALSE FALSE ⚫ Output variable Name Description Type Range Initial value bActive Function block BOOL TRUE,FALSE valid flag bBusy Execution flag BOOL TRUE,FALSE dCountValue Follow data Count value DINT type bOverUpperRang Count exceeding the BOOL TRUE,FALSE maximum value...
Page 88
5.IO Module phase B phase B phase B phase B CW/CCW IN0.1 IN0.3 IN1.1 IN1.3 IN0.2 IN0.4 IN1.2 IN1.4 Counter 1, Counter 3, Counter 5, and Counter 7 only support single-phase counting mode. [Example] If Counter 2 is set to pulse + direction, the IN0.3 terminal of the controller should be connected to the external pulse signal, and the IN0.4 terminal should be connected to the external direction signal, and Counter 3 will not be enabled at this time;...
Page 89
5.IO Module when the counting range is set to [-9999, 9999], if the counter reaches 9999 in the positive direction and continues to receive positive pulses, it will become 9998, 9997, and 9996 in the next moment and decrease in reverse order; when the negative count of the counter reaches -9999, if the negative pulse continues to be received, it will be -9998, -9997 and -9996, which will decrease in reverse order.
5.IO Module configuration shall be based on the HS_WriteParameter function block configuration and no longer based on the HSIO parameter page. 5.7.2. HS_PresetValue Counter count value preset function block. ⚫ Command format Commands Name LD performance Counter count HS_PresetValue preset ⚫...
5.IO Module [Note] The counter preset value should be a value between the minimum and maximum count value set by the counter HS_Counter function block, otherwise the counter counting will fail. 5.7.3. HS_SetCompare Counter comparison output function block. ⚫ Command format Commands Name LD performance...
Page 92
5.IO Module dPulseFrequency Pulse output frequency, effective UDINT Follow data only when byOutputType is 1. type ⚫ Output variable Name Description Type Range Initial value bBusy Execution flag BOOL TRUE,FALSE bDone Done flag BOOL TRUE,FALSE bError Fault flag BOOL TRUE,FALSE eErrorID Error code HSMC_ERROR_CODE...
5.IO Module Name Description Type Range Initial value bInterruptFlag Consistency BOOL TRUE,FALSE comparison interrupt generation flag. When the value is TRUE, it indicates that the comparison output consistency interrupt is generated. bActive Function block valid BOOL TRUE,FALSE flag bBusy Execution flag BOOL TRUE,FALSE bError...
5.IO Module value Counter Pulse axis index BYTE 0 - 7 bEnable Level control BOOL TRUE,FALSE FALSE ⚫ Output variable Name Description Type Range Initial value bPulseWidth Full square wave BOOL TRUE,FALSE period Unit: us bActive Function block valid BOOL TRUE,FALSE flag bBusy...
Page 96
5.IO Module Commands Name LD performance Counter value HS_Latch latch ⚫ Input variables Name Description Type Range Initial value Counter Pulse axis index BYTE 0 - 7 bEnable Level control BOOL TRUE,FALSE FALSE bResetFlag After the latch is successful, reset BOOL TRUE,FALSE FALSE...
5.IO Module 1. Counter in the function block is the counter index number. See the correspondence between the counter index number and the high-speed input port in the details of the HS_Counter function block. 2. After the counter latch is completed, the bLatchFlag output status changes to TRUE; when the latch port performs multiple latch operations, the latest latch value shall prevail;...
Page 98
5.IO Module Counter writing HS_WriteParameter parameters ⚫ Input variables Name Description Type Range Initial value Counter Pulse axis index BYTE 0 - 7 bExecute Execution switch, edge BOOL TRUE,FALSE FALSE triggered byCntMode Counter counting mode BOOL TRUE,FALSE FALSE 0: Not used as a counter, level sampling;...
5.IO Module This function block is used to configure high-speed counter parameters. The counter parameter setting is executed at the rising edge of the function block bExecute. When HS_WriteParameter is not enabled, the high-speed counter configuration is based on the HSIO parameter page value in the LocalHSIO device. 5.8.
5.IO Module 3. Function block execution Set the preset value of the HS_PresetValue function block of Counter 0 to 10000. The minimum value of dCountMinValue in the HS_Counter function block is set to -9999999, and the maximum value of dCountMaxValue is 9999999. The counting mode is FALSE, which means that when the positive pulse inputs, the counter value is positive accumulation.
Page 101
5.IO Module Set the comparison output port of Counter 6 to OUT1-4. After the comparison, the port output is pulse output. The number of output pulses is 100000, the pulse frequency is 10000, and the Counter 6 is in phase AB counting mode. The minimum value of the counter is -999999, and the maximum value is 999999.
Page 102
5.IO Module output mode is set to pulse output after the comparison. The corresponding byOutputType value is set to 1, the number of output pulses dOutputValue is set to 100000, and the pulse frequency dPulseFrequency is set to 10000 Pulse/s. The comparison output configuration is executed when bExecute performs rising edge.
5.IO Module Figure 5-8-1-2 Function Block Execution Display 5.9.HSIO_ERROR_CODE error code Currently, the error code types generated within the high-speed input and output function blocks are as follows. Users can solve the error message based on the error content and recommended processing methods. Figure 5-9-1 HSIO_ERROR_CODE Error Code and Details...
6.Use USB disk to update applications 6. Use USB disk to update applications 6.1 Operating procedure (1) Step 1: Compile the CODESYS project on the PC, create a startup application, and generate files Then choose the save path:...
Page 105
6.Use USB disk to update applications The finally generated Application.app and Application.crc are the final files used. (2) Step 2: Copy the update file to /updatefile/ in the specified root directory of the USB disk ➢ Create a new updatefile directory in the root directory of the U disk, and copy the application files Application.app and Application.crc of codesys to the /updatefile directory of the U disk;...
Need help?
Do you have a question about the softMC Compact 302 and is the answer not in the manual?
Questions and answers