Hacker Public Radio

Hacker Public Radio is an podcast that releases shows every weekday Monday through Friday. Our shows are produced by the community (you) and can be on any topic that are of interest to hackers and hobbyists.

HPR4728: Programmable Logic Controls - Episode 3

This show has been flagged as Clean by the host. -------------------- 01 Introduction This is the third episode in an 8 part series. 02 In the previous episode we covered * The early history of computers in industrial control * The early history of PLCs, including how they got their name * Who the major brands are * What they look like physically * A basic description of the abstract machine architecture * A very brief look at what a PLC program is like * The scan concept * The main PLC programming languages * The minor PLC programming languages * The relative popularity of each of the programming languages 03 In this episode we will begin by taking a look at one of the early PLCs from the era when they first began seeing widespread use. I will not even attempt to try to be comprehensive, I will just give a broad overview in the limited time I have available here. I have started with an older model because its simplicity and limited features allow for an easier introduction to the topic. -------------------- 04 Allen Bradley PLC/2 The Allen Bradley PLC/2 was introduced to the market in 1977. It was not their first foray into this field, but it was their first really successful one. I am not aware of a comprehensive history of their early product line, but one of their early major selling models was the PLC2/30. This is also known as their 1771 series. -------------------- 05 Physical Layout The CPU module was a large metal box which sat beside the I/O rack and connected to it with a cable. The I/O rack was a box with an open front and an series of slots into which tall narrow boxes containing the I/O could be slotted. 06 A backplane ran across the back, connecting the I/O to the CPU. Multiple racks could be connected together by cables. For the PLC2/30, you could have a maximum of 896 digital I/O points. 07 Racks were 315mm high, and between 247mm to 610mm wide, with racks coming in 4, 8, 12, and 16 slot varieties. The CPU was the same height as the rack and roughly square in outline. 08 As micro electronics advanced, the CPU module was able to be shrunk down in size such that it would fit into a slot in the rack, which became the norm for PLCs. -------------------- 09 The Electronics Inside Early model PLC/2s used some sort of 8 bit processor, some sources say an Intel 8080. 10 They also used four AMD 2900 bit slice processors as a logic co-processor. If you are not familiar with bit slice processors, these are chips which are like a 4 bit vertical slice through a processor, and can be joined together with logic chips to form a complete CPU. These are what were used to construct minicomputers. 11 They were used as coprocessors in early PLCs because microprocessors on their own were simply too slow to handle running the user program rapidly enough to allow a useful size program. One or more microprocessors were used as well in order to coordinate the overall operation and system management. 12 As microprocessors grew faster and more powerful, the need for logic coprocessors declined and they were eventually dropped. Early versions used magnetic core memory. Later ones switched to some sort of solid state RAM, probably static RAM of some sort. 13 Details of what sort of processors are inside any PLC are actually very hard to come by as manufacturers don't generally talk about that sort of thing. They wish the user to see it as just a black box. -------------------- 14 The Data Table From a programmer's perspective, the most important thing to understand first is the data table. The data table is the PLC's data memory. 15 For a PLC2, this is an array of 16 bit words. Each word consists of two 8 bit bytes. Addressing for both bits and words is in octal. 16 For those not familiar with them, octal numbers follow a counting system that goes from 0 to 7. The next number after 7 is 10. Counting then proceeds from 11, 12, 13, etc. going to 17, 20, 21, etc. Each octal digit takes exactly 3 bits. 17 Individual bits in PLC2 notation may be addressed by specifying the word followed by a slash, and then the bit. For example, 030/12 is the 12 bit in word 030. Remember that this is octal, so 12 is not the 12th bit if you are counting in decimal. 18 Memory Organization On the PLC2/30, the data table has the following organization. 19 Word addresses 000 to 007 are Processor Work Area number 1. This is not accessible by the user. 20 Word addresses 010 up to, but not including, 100 are the Output Image Table. This is a memory mapped image of the I/O outputs. 010 to 077 is for Rack 1. 020 to 027 is for Rack 2. This pattern continues up to Rack 7, which is 070 to 077. 21 Word addresses 100 to 107 are Processor Work Area number 2. This is also not accessible by the user. 22 Word addresses 110 up to, but not including, 200 are the Input Image Table. This is a memory mapped image of the I/O inputs. This is laid out in the same way as the output image table, and goes from 110 to 177. 110 to 117 is for Rack 1. 120 to 127 is for Rack 2. This pattern continues up to Rack 7, which is 170 to 177. 23 You will notice that the output image table and input image table appear to address the same rack slots. They do in fact do this. As to which address a specific slot in a specific rack maps to depends on whether there is an input card or an output card in that slot. 24 Addresses 200 to 277 are for Timer/Counter accumulated values. An accumulated value is the current time or count. 25 Addresses 300 to 377 are for Timer/Counter preset values. A preset value is the target time or count which when reached causes the timer or counter to indicate that it has reached the desired value. 26 The memory above 400 can be configured to split it into a data storage area and user program area. The data storage area is where you would store data that your program needs to use which is not part of the I/O or times and counters. You need to strike the correct balance between user data and program size. 27 There are various things that can be changed and configured with respect to the above, but I am not going to cover that in any depth as this is not a tutorial on the PLC2. = You should however have a pretty good idea of the memory of an early model PLC. The things to understand are that I/O are mapped to memory addresses, and different memory ranges are used for different purposes. 28 All memory management was manual. It was up to the user to keep track of which memory addresses were to be used for what purposes. Allen Bradley helpfully provided paper forms which you could photocopy which you could use to plan out and document what each address would be used for. Part of the programmer's job was to make efficient and logical use of memory, while also leaving space for future changes. -------------------- 29 The User Program The user program is made up of instructions. Each instruction typically takes one word of memory. However, complex instructions can take up to 8 words of memory. 30 There is a main program. You can think of this as like the "main" function in C. If you don't find that analogy helpful, then just think of it as this is where your program starts. The main program continues with one rung after another until it reaches the END statement. 31 There is also a subroutine area. The main program calls a subroutine by using a Jump to Subroutine, or JSR instruction. 32 The T3 Programming Terminal When the PLC2 came out, things like laptops were still far in the future. Even the first Compaq Portable suitcase style PC was still some years away. Indeed, the first PLC/2 came out not long after the first Altair PC kit. 33 Programming initially therefore was done using a special programming terminal known as a T3. The T3 was a suitcase size box with a small CRT in the end of it, and a keyboard attached to it below the screen. If this sounds like the early portable PCs, keep in mind that this in fact predated them by a number of years. 34 The keyboard was not a typewriter or QWERTY style. It had a membrane keypad with graphical symbols. Recall the previous episode on control diagrams using relays and how these were documented using schematic symbols on drawings. The T3 terminal keypad had symbols corresponding to a simplified and modified version of the symbols used in those schematic drawings. 35 When a programmer pressed one of those symbols on the keypad, the corresponding symbol appeared on the screen in the current cursor location. The programmer could then enter the data address that the symbol was to correspond to using the numeric part of the keypad. 36 An engineer, technician, or electrician could therefore create and enter programs using a fully graphical environment that used his existing knowledge of control using hardware components. They did not see this as programming a computer, they saw it as something else entirely which was unrelated to computers. 37 Programming took place with the T3 connected to the PLC while the PLC was in program mode. The instructions were entered directly from the terminal into the PLC memory. Programs could be saved or restored to cassette tape. The program would run when the PLC was set to run mode. 38 What is more, the T3 terminal allowed on line debugging of programs. When the T3 was connected in run mode, the ladder diagram would update live. When a logic condition was true, it would be highlighted. When the logic condition was false, it would be shown in an non highlighted state. 39 By

09-16
34:56

HPR4727: friedcamp interviews part 4: The free Lantern

This show has been flagged as Clean by the host. jasper from the Free Latern https://www.thefreelantern.com/ LyricConductor https://github.com/jnuyens/LyricConductor ModuleJail: https://www.modulejail.com https://github.com/jnuyens/modulejail Smart Dinosaur - Space for Fantasy Youtube: https://www.youtube.com/watch?v=qnUyW2yiiwo&list=OLAK5uy_kCrIROefktTWed3iPyDGhCUKl4gTvqXDU Spotify: https://open.spotify.com/album/3J2qdIgJFtk78O5IhYWbOH?si=eba8037fe0b34339 Provide feedback on this episode.

09-15
23:53

HPR4726: Trurl's intro show

This show has been flagged as Clean by the host. Introduction & Setting : Recorded on a sunny August afternoon in a Merton garden with Trurl exploring a wide-ranging philosophical and analytical journey through mathematics, games, and literature. Literary & Sci-Fi References : Stanislaw Lem : Discussion of the robot character Trurl from The Cyberiad , who alphabetically creates everything before reaching the letter "N" for "nothing" and destroying everything. Learn more about Lem on Wikipedia . Vladimir Nabokov : Analysis of The Luzhin Defense , a novel exploring chess obsession, psychological breakdown, and the "horror of chess." Explore the book on Wikipedia . Edgar Allan Poe & Thomas Hobbes : Discussion on 19th-century precision in writing, stylistic inflections, and the value of rigorous language. Martin Amis : Praise for his modern precision, with highlights including Money and Information . Core Philosophical & Mathematical Themes : Socratic Epistemology : Exploring the ancient Greek view from Plato's dialogues that equates knowledge directly with practical skill. Active vs. Empirical Learning : Trurl's theoretical aversion to traditional science labs in favor of pure conceptual frameworks, contrasted with hands-on computational tinkering. Stephen Wolfram : Discussion of A New Kind of Science and the computational approach to universal systems. Applied Puzzles & Strategic Games : Chess Ratings : Investigating the rating system, Elo mechanics, and statistical anomalies suggesting top players are statistically underrated. The Drake Equation & Astrobiology : Quantitative modeling of extraterrestrial life inspired by Stephen Webb's If the Universe Is Teeming with Aliens... Where Is Everybody? . Economics & Libertarianism : Transition from early socialist upbringing to decentralized economic structures, cryptocurrency architectures, and the Lightning Network. Provide feedback on this episode.

09-14
40:06

HPR4725: HPR Beer Garden - Tasting and reviewing beers

This show has been flagged as Clean by the host. In a bonus episode for the reserve queue, Kevie and Dave talk about how they review beers: Aroma - what do you smell from the glass and bottle or can Taste - take a sip, swirl it around your mouth and allow it rest a second before drinking; don't gulp. What flavours are you getting. Wait - What flavours are appearing in the aftertaste. Opinions - what are your personal thoughts on this beer. Score - pick a score and rarely give any beer full marks. Connect with the guys on Untappd: Dave Kevie The intro sounds for the show are used from: https://freesound.org/people/mixtus/sounds/329806/ https://freesound.org/people/j1987/sounds/123003/ https://freesound.org/people/greatsoundstube/sounds/628437/ Provide feedback on this episode.

09-11
38:48

HPR4724: HPR Beer Garden 19 - Lager

This show has been flagged as Clean by the host. As we are currently going through a warm patch (well, at the time of recording anyway), the HPR Beer Garden returns to provide some refreshment in the heat with a glass of cold and refreshing lager. Dave chooses Super Bock from Portugal, whilst Kevie picks City Limits Amber Lager from the tiny Dog Falls Brewing Co in Inverness. Connect with the guys on Untappd : Dave Kevie The intro sounds for the show are used from: https://freesound.org/people/mixtus/sounds/329806/ https://freesound.org/people/j1987/sounds/123003/ https://freesound.org/people/greatsoundstube/sounds/628437/ Upcoming beers: Mild Bitter Pale Ale Provide feedback on this episode.

09-10
--:--

Recommend Channels