ISPSoft User Manual
ISPSoft User Manual ISPSoft User Manual
Chapter 11 Structured Text 11.4 Example of a Structured Text 11.4.1 Explanation The example is about the control of a tower light. A tricolor light and a buzzer are used. The control mechanisms for various device statuses are listed below. If more than one device status appears, the device status which is given precedence over the others is displayed. Light State code Device status Red light Yellow light Green light Buzzer Precedence 4 The device is malfunctions. ON OFF OFF Flash Highest 3 The device malfunctions. (The buzzer is turned off.) Flash OFF OFF OFF 2 The device is operating. OFF OFF ON OFF 1 The work is done. OFF Flash OFF OFF 0 The device is idling. OFF ON OFF OFF Lowest 11.4.2 Planning Hardware In this example, the AH500 series CPU module AHCPU530-EN, the digital I/O module AH16AP11R-5A, and the four-slot main backplane AHBP04M1-5A are used. The table below is an I/O allocation table. Type ID Description Digital output Y0.0 Red light Digital output Y0.1 Yellow light Digital output Y0.2 Green light Digital output Y0.3 Buzzer 11.4.3 Planning a Program (1) If the flag ERROR is ON, and the flag BUZZER_OFF is OFF, the state code will be 4. (2) If the flag ERROR is ON, and the flag BUZZER_OFF is ON, the state code will be 3. (3) If the flag ERROR is OFF, and the flag RUNNING is ON, the state code will be 2. (4) If the flags ERROR and RUNNING are OFF, and the flag COMPLETE is ON, the state code will be 1. (5) If the flags ERROR, RUNNING, and COMPLETE are OFF, the state code will be 0. (6) Every state code corresponds to a light. The control of the tricolor light has many practical applications, and the tricolor light can be displayed in various ways. Considering that a program can be expanded and reused, a function block is created. 11.4.4 Creating a Program Start ISPSoft, and then create a new project. The hardware configuration in this example is the same as the hardware configuration in chapter 4. 11-25
ISPSoft User Manual Please refer to chapter 4, and complete the hardware configuration. Create a POU of the program type and a POU of the function block type in the project management area. The programming language used to create the POU of the program type and the POU of the function block type are structured texts. 11-26
- Page 316 and 317: Chapter 9 Function Block Diagram fu
- Page 318 and 319: Chapter 9 Function Block Diagram Ex
- Page 320 and 321: Chapter 9 Function Block Diagram Ex
- Page 322 and 323: Chapter 9 Function Block Diagram an
- Page 324 and 325: Chapter 9 Function Block Diagram
- Page 326 and 327: Chapter 9 Function Block Diagram If
- Page 328 and 329: Chapter 9 Function Block Diagram Ri
- Page 330 and 331: Chapter 10 Instruction List Table o
- Page 332 and 333: Chapter 10 Instruction List The ope
- Page 334 and 335: Chapter 10 Instruction List • As
- Page 336 and 337: Chapter 10 Instruction List If user
- Page 338 and 339: Chapter 10 Instruction List Users
- Page 340 and 341: Chapter 10 Instruction List 10.2.4.
- Page 342 and 343: Chapter 11 Structured Text Table of
- Page 344 and 345: Chapter 11 Structured Text A comple
- Page 346 and 347: Chapter 11 Structured Text Data for
- Page 348 and 349: Chapter 11 Structured Text However,
- Page 350 and 351: Chapter 11 Structured Text Example
- Page 352 and 353: Chapter 11 Structured Text Example
- Page 354 and 355: Chapter 11 Structured Text Example
- Page 356 and 357: Chapter 11 Structured Text 11.2.5 L
- Page 358 and 359: Chapter 11 Structured Text 11.2.7 A
- Page 360 and 361: Chapter 11 Structured Text Example
- Page 362 and 363: Chapter 11 Structured Text larger t
- Page 364 and 365: Chapter 11 Structured Text 11.3.3 I
- Page 368 and 369: Chapter 11 Structured Text Create t
- Page 370 and 371: Chapter 11 Structured Text which is
- Page 372 and 373: Chapter 12 Sequential Function Char
- Page 374 and 375: Chapter 12 Sequential Function Char
- Page 376 and 377: Chapter 12 Sequential Function Char
- Page 378 and 379: Chapter 12 Sequential Function Char
- Page 380 and 381: Chapter 12 Sequential Function Char
- Page 382 and 383: Chapter 12 Sequential Function Char
- Page 384 and 385: Chapter 12 Sequential Function Char
- Page 386 and 387: Chapter 12 Sequential Function Char
- Page 388 and 389: Chapter 12 Sequential Function Char
- Page 390 and 391: Chapter 12 Sequential Function Char
- Page 392 and 393: Chapter 12 Sequential Function Char
- Page 394 and 395: Chapter 12 Sequential Function Char
- Page 396 and 397: Chapter 12 Sequential Function Char
- Page 398 and 399: Chapter 12 Sequential Function Char
- Page 400 and 401: Chapter 12 Sequential Function Char
- Page 402 and 403: Chapter 12 Sequential Function Char
- Page 404 and 405: Chapter 12 Sequential Function Char
- Page 406 and 407: Chapter 12 Sequential Function Char
- Page 408 and 409: Chapter 12 Sequential Function Char
- Page 410 and 411: Chapter 12 Sequential Function Char
- Page 412 and 413: Chapter 13 Auxiliary Editing Tools
- Page 414 and 415: Chapter 13 Auxiliary Editing Tools
Chapter 11 Structured Text<br />
11.4 Example of a Structured Text<br />
11.4.1 Explanation<br />
The example is about the control of a tower light. A tricolor light and a buzzer are used. The control<br />
mechanisms for various device statuses are listed below. If more than one device status appears,<br />
the device status which is given precedence over the others is displayed.<br />
Light<br />
State<br />
code<br />
Device status<br />
Red<br />
light<br />
Yellow<br />
light<br />
Green<br />
light<br />
Buzzer Precedence<br />
4 The device is malfunctions. ON OFF OFF Flash Highest<br />
3<br />
The device malfunctions.<br />
(The buzzer is turned off.)<br />
Flash OFF OFF OFF<br />
2 The device is operating. OFF OFF ON OFF<br />
1 The work is done. OFF Flash OFF OFF<br />
0 The device is idling. OFF ON OFF OFF Lowest<br />
11.4.2 Planning Hardware<br />
In this example, the AH500 series CPU module AHCPU530-EN, the digital I/O module<br />
AH16AP11R-5A, and the four-slot main backplane AHBP04M1-5A are used. The table below is an<br />
I/O allocation table.<br />
Type ID Description<br />
Digital output Y0.0 Red light<br />
Digital output Y0.1 Yellow light<br />
Digital output Y0.2 Green light<br />
Digital output Y0.3 Buzzer<br />
11.4.3 Planning a Program<br />
(1) If the flag ERROR is ON, and the flag BUZZER_OFF is OFF, the state code will be 4.<br />
(2) If the flag ERROR is ON, and the flag BUZZER_OFF is ON, the state code will be 3.<br />
(3) If the flag ERROR is OFF, and the flag RUNNING is ON, the state code will be 2.<br />
(4) If the flags ERROR and RUNNING are OFF, and the flag COMPLETE is ON, the state code<br />
will be 1.<br />
(5) If the flags ERROR, RUNNING, and COMPLETE are OFF, the state code will be 0.<br />
(6) Every state code corresponds to a light. The control of the tricolor light has many practical<br />
applications, and the tricolor light can be displayed in various ways. Considering that a<br />
program can be expanded and reused, a function block is created.<br />
11.4.4 Creating a Program<br />
Start <strong>ISPSoft</strong>, and then create a new project.<br />
The hardware configuration in this example is the same as the hardware configuration in chapter 4.<br />
11-25