Welcome to the Industrial Automation website!

NameDescriptionContent
HONG  KANG
E-mail  
Password  
  
Forgot password?
  Register
当前位置:

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

来源: | 作者:FAN | 发布时间 :2026-02-05 | 386 次浏览: | 🔊 Click to read aloud ❚❚ | 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.

  • Fanuc A16B-2201-0320 CPU MAIN Board
  • Pilz 475650 PNOZ 1 Safety Gate Relay
  • Omron NSH5-AL001 HMI Interface Unit
  • Allen-Bradley 1756-OF8 Analog Output Module
  • Siemens 6SL3210-1SE31-0AA0 Power Module 45kW
  • PMA TB45-110-00000-000 Temperature Limiter
  • PSR-SCP-24DC-ESD-5x1-1x2-300 Safety Relay
  • Pilz 774140 PZE 9 Safety Relay
  • Telemecanique TSXRKN82F PLC Rack Chassis
  • Mitsubishi R16CPU PLC CPU Module
  • OMRON C500-PS223-E Power Supply Module
  • Siemens 3VL4731-1DC36-0AA0 Circuit Breaker
  • Siemens 7ML5201-0EA0 Ultrasonic Level Transmitter
  • OMRON NQ3 NQ5 Touch Panel HMI
  • OMRON CJ1W-AD081-V1 Analog Input Module
  • OMRON NJ301-1100 Machine Automation Controller
  • B&R X20BC00G3 EtherCAT Bus Controller
  • Schneider ATV212HD22N4S Variable Speed Drive
  • B&R 8B0C0320HW00.002-1 Power Supply Module
  • Mitsubishi OSA105S2A Incremental Rotary Encoder
  • Pilz 777514 PNOZ XV3P Safety Relay
  • Gould AS-884A-111 Modicon 884 Controller
  • Siemens 6SC6130-0FE00 SIMODRIVE Control Card
  • Omron CV500-PS221 PLC Power Supply Module
  • ABB CM577-ETH AC500 PLC Ethernet Module
  • Omron NX-SIH400 Safety Input Unit NX Series
  • Omron NJ501-1300 Machine Automation Controller
  • Siemens 3VT8563-2AA03-2KA2 Molded Case Breaker
  • Pilz PNOZ m1p ETH 773103 Safety Controller
  • Omron CJ1H-CPU66H-R CJ1 Series CPU Module
  • ASI ASI533-S00 PLC Module S1
  • Mitsubishi AJ71C21-S1 Serial Module
  • Keyence IX-1000 Laser Sensor Amplifier
  • Siemens 6SN1145-1AA01-0AA1 Power Module
  • Siemens 3VA2340-5HL32-0AA0 MCCB 400A
  • Mitsubishi OSA104S Absolute Encoder
  • Siemens 6ES7350-1AH03-0AE0 FM 350-1 Counter
  • Siemens 6SE7038-6EK84-1JC2 IGD8 Gate Driver
  • Eaton EASY819-AC-RC Programmable Relay
  • Omron CPM1A-40CDT-D PLC 24V DC
  • Omron NA5-12W101B-V1 12-inch Programmable Terminal
  • Siemens 6ES7331-7KF02-0AB0 Analog Input SM 331
  • Moxa PTC-101-S-SC-HV Photoelectric Converter
  • Fanuc A20B-3300-0031 CNC Control Circuit Board
  • OMRON NA5-7W001B-V1 Programmable Terminal HMI
  • Parker AH385851U002 590C DC Drive Power Board
  • ABB 3BSE040662R1 AI830A Analog Input Module
  • DOLD BF9250.01/001 Solid State Relay
  • Siemens 6ES7331-7KF02-0AB0 SIMATIC S7-300 SM 331
  • ABB 07AC91 I6 GJR5252300R3101 Advant Controller 31
  • Schneider HMIST6500 Touch Screen HMI
  • Phoenix IL PN BK DI8 DO4 2TX-PAC Bus Coupler
  • NLTECH NL8060AC21-21D 8.4 inch LCD Display
  • Mitsubishi A2NCPU-P21 CPU Module A2NCPUP21
  • 1841-PL1-B-LH-ES Pressure Controller
  • Mitsubishi GT2512-STBA GT2512-STBD HMI
  • Cosel PJA600F-24 24V 600W Power Supply
  • B&R X67DM1321 Digital Mixed Module
  • Fanuc A16B-1310-0010 Power Supply Unit
  • Festo VABF-S4-1-V2B1-C-VH-20 Vacuum Generator
  • Mitsubishi A3ACPUP21 A3ACPU-P21 CPU
  • Mitsubishi Mazak PD14B-1 Power Supply
  • Siemens 6SY7000-0AC80 Module
  • PILZ 774400 PDZ Safety Relay
  • Mitsubishi A1SX81 Digital Input Module
  • Asyst Gasonics R94-1163 Controller 112671
  • Cincinnati Milacron 3 545 1000A Card
  • Siemens 6DD1607-0AA2 UPS Module
  • Square D 8536SCG3V02S Motor Starter
  • Siemens 6SL3100-1DE22-0AA1 Control Supply
  • Beckhoff EL9400 EtherCAT Power Terminal
  • Fanuc A16B-2202-0421 Power Supply Board
  • Turck TBEN-LG-8DIP-8DOP I/O Block
  • Euchner MGB-L1B-PNA-L-121861 Safety Switch
  • Pilz 772170 PNOZ M EF 1MM Safety Expansion
  • Mitsubishi AY51 MELSEC-A Output Module
  • Advantech AMAX-5056-A 8-Channel Digital Output
  • NXP MC912D60ACPV8 16-Bit MCU 60KB Flash
  • Omron C500-PS223-E SYSMAC PLC Power Supply Unit
  • Balluff BNI0047 BNI PBS-302-101-Z001 Profibus Module
  • Siemens 6SN1118-0DM31-0AA0 Regulation Card
  • Bently Nevada 9200-02-01-10-00 Sensor
  • Omron C500-PS223-E Power Supply Unit
  • Cognex COG-VC5-120-000 Vision Controller
  • ABB P-HC-BRC-40000000 Bridge Controller
  • Mitsubishi AJ71E71N-B5T PLC Module
  • Phoenix PSI-REP-PROFIBUS/12MB 2708863
  • Siemens 6SL3210-5BE31-8UV0 Converter
  • ABB CI868K01-eA 3BSE048845R2 Module
  • Honeywell S7999D1006 Touch Screen
  • Keyence CA-CHX10U Repeater Unit
  • Keyence VT5-W07 Touch Screen HMI
  • Keyence KV-8000 PLC CPU
  • Siemens 7MH4900-3AA01 Weighing Module
  • Omron C200HS-CPU01-E Programmable Controller
  • CD22-35AM12 Inductive Sensor
  • Mitsubishi A2NCPUR21-S1 PLC CPU
  • Siemens 6ES7331-7FK02-0AB0 Analog Input
  • Schneider HMIST6500 Touch Screen HMI
  • 0970 PSL109 Module Industrial Control
  • Schneider LC1F500P7 Contactor 500A
  • Mitsubishi GT2512-STBA GT2512-STBD HMI
  • Omron NJ1019000 Machine Automation Controller
  • Siemens 6SN1112-1AC01-0AA1 Power Module
  • Eaton AE16KNS0AB Bimetallic Overload Relay
  • ABB 3bse036456r1 Ai825 Analog Input 4 Ch
  • Fuji Electric 7MBR50SB120-50 IGBT Module
  • Schneider XPSMC32ZP Safety Relay
  • Siemens 3VL4740-2AA36-0AA0 Circuit Breaker
  • ABB PharpSFan03000 Mpsiii Fan System Monitor
  • Honeywell DPCB21010002 IRTP131 PCB
  • Siemens 6ES7214-1HG40-0XB0 CPU 1214C
  • Siemens 6ES7350-1AH03-0AE0 FM 350-1
  • PILZ PNOZ mm0.1p 772001 Safety Relay
  • E2V EVX12DS130AGC 12DS130 Module
  • Siemens 3RT5066-6AB36 Contactor
  • HIRSCHMANN RS20-0800T1T1SDAEHC09.1.00 Switch
  • Q4XTILAF500-Q8 Laser Range Sensor
  • OMRON CVM1-BC103 Base Unit 145752
  • CAREL RITC400001 Card
  • Eaton LZMN3-AE400 Molded Case Circuit Breaker
  • Fanuc A20B-3300-0031 Control Circuit Board
  • Siemens 6ES7450-1AP01-0AE0 S7-400 FM 450-1
  • Fanuc A90L-0001-0317/F Spindle Fan Motor
  • Schneider TM262L10MESE8T Logic Controller
  • 8.4-inch NL8060BC21-06 Industrial Display
  • B&R X20CP0411 Compact CPU Control Unit
  • Schneider TSX P572634 M Modicon Premium CPU