Welcome to the Industrial Automation website!

NameDescriptionContent
XING-Automation
E-mail  
Password  
  
Forgot password?
  Register
当前位置:

Deep Analysis and Industrial Control Application of Reliance DCS 5000 Enhanced BASIC Language

F: | Au:FAN | DA:2026-02-05 | 696 Br: | 🔊 点击朗读正文 ❚❚ ▶ | Share:

1. Configuration Task

This is the 'blueprint' of the system, which must be loaded before any application task to define global resources and hardware mappings, and it does not execute itself. The key statements include:

TASK: Define the names, types, CPU slots, and priorities (4-11) of all tasks (BASIC, PC, or control block tasks) in the system.

MEMDEF/NVMEMDEF: Define global variables (COMMON variables) that can be accessed by all tasks inside the chassis. The variables defined by NVMEMDEF can maintain their values after power failure and restart, and are suitable for process parameters that require persistence.

IODEF/NETDEF/RIODEF/MODDEF/RNETDEF/ABDEF: This series of "DEF" statements is used to map physical I/O addresses (local, remote, network, Modbus, AutoMate, Allen Bradley, etc.) to symbolic variable names, achieving software and hardware decoupling.

2. Application Task

This is the main body of the program that implements specific control logic. All variables must be defined before use:

LOCAL: Define local variables that are only used within this task, including simple variables, arrays, and adjustable variables. Adjustable variables allow operators to adjust parameters (such as PID gain) within a preset range (HIGH/LOW) at a specified step size (STEP) through the terminal during runtime, but the program can only read its value, enhancing the flexibility and safety of the system.

COMMON: Declare the global variables defined in the configuration task that will be used for this task.

3. Process control and subroutines

GOTO/ON GOTO: Implement unconditional or integer expression based conditional jumps.

GOSUB/ON GOSUB/RETURN: Used to call subroutines, supports nesting.

IF-THEN: Conditional judgment and execution based on Boolean expressions.

FOR-NEXT: Build a counting loop that supports nesting and stride (STEP) settings.

4. Program documentation

Support REM (compile time discard) and! Two formats of comment statements are available for easy code maintenance, which can be downloaded with the task and uploaded for viewing.


Advanced enhancements: multitasking, real-time, and I/O

1. Multi task enhancement

The system decomposes different control functions into independent tasks and achieves "concurrent" execution through priority scheduling. The key synchronization mechanisms include:

EVENT: Define software or hardware events. Hardware events can be associated with the interrupt status register of a specific I/O card and timeout protection can be set.

SET/WAIT: One task triggers an event with SET, and another or more tasks wait for the event with WAIT ON to achieve synchronization and communication between tasks.

OPEN CHANNEL: Establish a typed (I-integer, D-double integer, R-real, S-string, B-boolean) data channel between two tasks. The task reads and writes data to the channel through PRINCT # and INPUT #. If the channel is full/empty, the task is suspended, naturally achieving synchronization in the producer consumer mode.

2. Real time enhancement

DELAY: Suspend the task for a specified time (unit: TICKS [5.5 milliseconds] SECONDS、MINUTES、HOURS)。

START EVERY: Set the periodic execution of tasks. After the task is executed to the END statement, it sleeps and is reactivated by the operating system after the specified cycle. It starts executing from the START statement and is suitable for implementing a fixed speed control scan loop.

3. Powerful I/O capability

OPEN/CLOSE: Allocate and release logical devices (such as serial port PORTA).

INPUT/PRIMT: Read data from or output data to a device. PRIMT USING supports rich formatted outputs (left/right/center alignment, leading zeros, decimal control).

GET/PUT: Perform single character input/output.

Read/DATA/STORE: Read preset values from the internal data area of the program, which is more efficient than INPUT.

IOWRITE statement and IOREAD% function: designed specifically for accessing "peripheral" I/O cards that do not comply with DCS standards (such as byte only access or write only), allowing direct read and write operations to specific hexadecimal addresses, providing maximum hardware access flexibility.


Rich built-in function library

The function library covers mathematical operations, string processing, bit operations, BCD code conversion, screen control (VT100 terminal), and system level operations:

Mathematical functions: SIN, COS, TAN, ATN, LN, EXP, SQRT, ABS, etc.

String functions: CHR $, ASC%, LEN%, STR $, LEFT $, RIGHT $, MID $, VAL%, VAL, etc.

Bit and logic functions: BIT_SET @, BIT_CR @, BITVNet @, SHIFTL%, SHIFTR%, ROTATEL%, ROTATER%.

Industrial application functions: BCD_OUT%, BCD_IN% are used for data conversion of digital tubes or dip switches; BLOCKVNet @ is used for batch data transfer between variables and network I/O; GATEWAY_CMD-OK @ with VARPTR! Implement batch reading and writing of registers through gateways such as Modbus.


Error handling and system robustness

ON ERROR GOTO/RESUME: Allow programs to define runtime error handling routines. The predefined variables ERR% and ERL% provide error codes and error line numbers, respectively.

Error log: All non fatal errors are recorded in the task error log for easy diagnosis.

  • Sigmatek MDD111-1 DIAS Drive Axis Module
  • Sigmatek DKL042 05-024-042 Terminal Module
  • Sigmatek DM822 Control Module
  • Sigmatek CDM167 12-008-167-O Module
  • Sigmatek TAE151 Touch Display Unit
  • Sigmatek DCC041 SLIDES Module 05-700-041-D
  • Sigmatek AKM65M-ANC2GBB0 PM Servo Motor
  • Sigmatek ETT221 01-230-221 Operator Terminal
  • Sigmatek SLIDES DAM 124 Analog Module
  • Sigmatek AKM31C-ANCNGBB0 Servo Motor
  • Mannesmann Demag Sigmatek CP626 Central Unit
  • SIGMATEK 0332.554.03 Board 371071000154
  • SIGMATEK 12-250-021 Base Plate Back Panel CM5V020
  • SIGMATEK DM162 S-DIAS Digital Mix Module
  • DEMAG ERGOTECH 061 381 66 Sigmatek 9842.243.02 Circuit Board
  • SIGMATEK CP313-1 PLC Module
  • Sigmatek ETV0551-2 VARAN Touch Terminal
  • Sigmatek SDM 081 FS S-Dias Safety Module
  • DEMAG 05-250-023 Ergotech Motherboard with Sigmatek TMS012
  • Sigmatek CM5V020 12-250-023-K Wiring Base
  • Sigma Tek 5000B-37 Attitude Gyro Indicator
  • Sigmatek SDD120-2 DIAS Drive
  • Sigmatek CME221 Memory Module
  • Sigmatek DCP640 DIAS Central Unit
  • Sigmatek STO040 Safety Output Module
  • Sigmatek CET281 Control Panel
  • Sigmatek CIPC LX800 Demag NC5 CPU
  • Sigmatek DKL093 05-024-093 Terminal Module
  • Sigmatek AI088 20-009-088 Analog Input Module
  • Sigmatek CAI888 Analog Input Module
  • SIGMATEK CCA021 12-025-021 Analog Output Module
  • SIGMATEK 1104.579.05 Control Module
  • SIGMATEK SDI100 Digital Input Module
  • SIGMATEK C-IPC 256MB LX800 Compact Dias
  • SIGMATEK 9423.090.02 Control Module
  • SIGMATEK C-IPC 256 Power Supply 148498
  • SIGMATEK CAI025 Analog Input Module
  • SIGMATEK CTO166 Digital Output Module
  • SIGMATEK CP112 20-004-112 Processor Module
  • SIGMATEK CAI887 12-009-887 Safety Module
  • Sigma-Tek 4000B-31 Directional Gyro 1U262-002-42
  • Sigmatek C-IPC 256MB LX800 IPC Controller
  • Sigmatek C-IPC 01-450-031 Industrial PC LX800
  • Sigmatek C-IPC 256 Industrial PC Controller
  • Sigmatek CCP-531 PLC Processor Module
  • Sigmatek CDI163 Digital Input Module
  • Sigmatek ETV0501 VARAN Terminal 12-230-0501
  • Sigmatek CTMS020 C-DIAS Technology Module
  • Sigmatek CIV512 VARAN Switch Module
  • Sigmatek HU011 20-080-011 Interface Module
  • SIGMATEK SLIDES DAM 124 Module
  • SIGMATEK C-IPC 161 01-450-161L Industrial PC
  • SIGMATEK C-IPC 128MB VIA 733MHz 01-450-024-K
  • SIGMATEK 12-780-012 R8-IPC Geode LX800 Module
  • SIGMATEK CAM124 Analog Module
  • SIGMATEK S1 032-8AF61-R4 EZ Servo Motor
  • SIGMATEK CTO163 Digital Output Module
  • SIGMATEK CCP082 12-004-082 Processor Module
  • SIGMATEK CRCH081 C-DIAS Temperature Module
  • SIGMATEK PC322-K 01-310-322-K Industrial PC
  • SIGMATEK SDD310-2 Servo Drive
  • SIGMATEK AI084 Analog Input Module
  • SIGMATEK CRCH081 12-752-081 Temperature Module
  • Sigma-Tek 5000L-4 Attitude Gyro 1U284-001-3
  • SIGMATEK CM5V020 12-250-023-K Wiring Module
  • Sigma-Tek 4000H-6 Directional Gyro IU262-035-7
  • SIGMATEK Dias DCP160 05-004-160 Processor Module
  • SIGMATEK 0147.395.02 Control Module
  • SIGMATEK A1084 Control Module
  • SIGMATEK DI200 20-006-2000 Digital Input Module
  • Sigmatek DNC115 Encoder Module
  • Sigmatek DAM122 05-017-122 Analog Module
  • Sigmatek 9802.289.01 Control Board TA71 Display
  • Sigmatek TO127 20-007-127 Digital Output Module
  • Sigmatek DNC031 05-011-031 Digital Module
  • Sigmatek VI022 20-003-022 Interface Module
  • Sigmatek CAI085 Analog Input Module
  • Sigmatek CP111 S-DIAS CPU Module
  • Sigmatek CTMS030 Krauss Maffei Module
  • Sigmatek CAM123 Control Module
  • Sigmatek TAE732-P 01-240-732-P Touch Display Unit
  • Sigmatek MDM021 Digital Mixed Module
  • Sigmatek DCP642 DIAS Central Unit
  • Sigmatek CST022 12-014-022 C-DIAS Module
  • Sigmatek SRO021 20-893-021 Safety Relay Output
  • Krauss Maffei MC5 Control System Sigmatek
  • Sigmatek DC061 Module 18-24VDC 300mA
  • Herrmann EVT0855 Ultrasonic Welder Touch Panel
  • Sigmatek CIV521 Control Module 1.4A 2W
  • Sigmatek DDI61 05-006-161 Digital Input Module
  • SIGMATEK ETT312-E Touch Terminal 01-230-312
  • Cessna S3326-1 Sigma Tek 5000B-67 Gyro 1U149-015-9
  • SIGMATEK PS101 Power Supply Module
  • SIGMATEK 0332.554.03 Control Module 371071000154
  • SIGMATEK ETT312-E Touch Terminal 01-230-312
  • SIGMATEK CDM163 Control Module
  • SIGMATEK VSV046 16-023-046 Module
  • SIGMATEK AM221 20-017-221 Analog Module
  • SIGMATEK CTS051 12-053-051 Control Module
  • SIGMATEK AM221 20-017-221 Analog Module
  • Sigmatek CSDI161 12-891-161 Safety Input Module
  • Sigma Tek 4000C-1 Directional Gyro Indicator
  • Sigmatek ETV0501 12-230-0501 VARAN Terminal
  • Sigmatek DDM165 SLIDES Module
  • Sigmatek N100 20-011-100 Control Module
  • Sigmatek AKM54K-ANC2R-B0 PM Servo Motor
  • Sigmatek CTO166 Digital Output Module
  • Sigmatek CP212-K 20-004-212-K CPU Module
  • Sigmatek CDI161 Digital Input Module
  • Sigmatek DCC080 05-700-080-2 Control Module
  • SIGMATEK SCP011 S-DIAS Safety CPU
  • SIGMATEK SCP011 S-DIAS Safety CPU
  • SIGMATEK SRO022 Relay Output Module
  • SIGMATEK MDD 121 Drive Axis Module
  • SIGMATEK DSI021 SLIDES Siemens Interface
  • SIGMATEK DIAS DCP161 Module 05-004-161
  • Sigmatek ETT312 Built-in Touch Terminal
  • SIGMATEK DCP 643 DIAS Controller System
  • SIGMATEK CIO021 Multi I/O Module
  • SIGMATEK CTMS020 Control Module
  • Sigmatek CME 221 Memory Module
  • Sigmatek 0420.615.01 Control Board
  • Sigmatek CP111 20-004-111 CPU Module
  • Sigmatek 9405.065.03 Control Board
  • Sigmatek ETEK 01-450-032-K C-IPC 256MB Industrial PC
  • Sigmatek CTO163 12-007-163 Safety Output Module
  • Sigmatek TO081 20-007-081 Digital Output Module
  • Sigmatek SI021 20-022-021 Safety Input Module