Sunteți pe pagina 1din 10

1. early on in their education, many (most?

) beginning PLC students are given an assignment to "use one button to start and then to stop an output" ... for better or for worse, this classic "Flip/Flop" or "Toggle" exercise has become something of a PLC student's rite of passage ... unfortunately many instructors (and thus their students) are satisfied merely to "get it working" and they completely ignore the main objective of the exercise ... 2. the primary objective of this classic exercise is to demonstrate how the PLC processor functions scan-by-scan and branch-by-branch and instruction-by-instruction - as it executes its ladder logic rungs ... 3. students who simply skip over these critical concepts invariably have problems in their future studies simply because they have failed to master the basic mechanics of how the PLC processor "thinks" ... 4. the programming method I've used here was chosen primarily for its educational value and for being applicable to a wide range of PLC brands and platforms ... this programming method is NOT (I repeat: NOT) intended to show the "right" way or the "best" way or the "most efficient" way of programming a "Flip/Flop" operation ... 5. suggestion: watch the YouTube videos available from the Sample Lessons page of my website before you begin this exercise ... be sure to watch ALL eleven videos IN NUMBER ORDER ... all of the information necessary to fully understand this exercise is included in those preview lessons ... 6. suggestion: follow the "Bit Status" table shown in the attached figure to monitor the ONE and ZERO status of each of the four bits as you read through the following step-by-step explanation of the scan sequence ... this will help you master the ideas involved ... 7. if you have any questions or comments post them here on the forum ... my work schedule often prevents me from answering personal emails in a timely fashion ... the forum members will be happy to help with your questions and I will also contribute as my time allows ... 8. obviously quite a lot of Copy-and-Pasting has been used in developing this material ... I apologize in advance for any errors which might have crept in ... please bring them to my attention and I will do my best to correct them ...

9.

Start of Scan A

10. suppose that the system has just been powered up ... the operator has not pressed Button-A yet ... Lamp-E in the field is OFF ... 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. as we start this scan, the bits/boxes have the following status ... I:2/0 O:6/0 B3/0 B3/1 = = = = ZERO ZERO ZERO ZERO ... ... ... ...

here's how the processor interprets the rung ... the bit/box for I:2/0 contains a status of ZERO ... so ... the XIC instruction for I:2/0 is FALSE ... the bit/box for B3/1 contains a status of ZERO ... so ... the XIO instruction for B3/1 is TRUE ... the bit/box for O:6/0 contains a status of ZERO ... so ... the XIO instruction for O:6/0 is TRUE ... the OTL instruction for O:6/0 has FALSE logic coming in ... so ... the OTL instruction does nothing to the bit/box ... and ... the bit/box for O:6/0 keeps its status of ZERO ... the scan continues on Branch B ... the OTE instruction for B3/0 has FALSE logic coming in ... so ... the OTE instruction writes a ZERO into the bit/box for B3/0 ... and ... the bit/box for B3/0 has a status of ZERO ... the scan continues on Branch C ... the bit/box for B3/0 contains a status of ZERO ... so ... the XIO instruction for B3/0 is TRUE ... the OTU instruction for O:6/0 has FALSE logic coming in ... so ... the OTU instruction does nothing to the bit/box ... and ... the bit/box for O:6/0 keeps its status of ZERO ... the scan continues on Branch D ... the OTE instruction for B3/1 has FALSE logic coming in ... so ... the OTE instruction writes a ZERO into the bit/box for B3/1 ... and ... the bit/box for B3/1 has a status of ZERO ... as we finish this scan, the bits/boxes have the following status ... I:2/0 O:6/0 B3/0 B3/1 = = = = ZERO ZERO ZERO ZERO ... ... ... ...

the field device Lamp-E is OFF ... if Button-A stays released, all subsequent scans will be the same ...

47. 48. 49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 69. 70. 71. 72. 73. 74. 75. 76. 77. 78. 79. 80. 81. 82. 83.

Start of Scan B now suppose that the operator presses Button-A in the field ... as we start this scan, the bits/boxes have the following status ... I:2/0 O:6/0 B3/0 B3/1 = = = = ONE ... ZERO ... ZERO ... ZERO ...

here's how the processor interprets the rung ... the bit/box for I:2/0 contains a status of ONE ... so ... the XIC instruction for I:2/0 is TRUE ... the bit/box for B3/1 contains a status of ZERO ... so ... the XIO instruction for B3/1 is TRUE ... the bit/box for O:6/0 contains a status of ZERO ... so ... the XIO instruction for O:6/0 is TRUE ... the OTL instruction for O:6/0 has TRUE logic coming in ... so ... the OTL instruction writes a ONE to the bit/box ... and ... the bit/box for O:6/0 has a status of ONE ... the scan continues on Branch B ... the OTE instruction for B3/0 has TRUE logic coming in ... so ... the OTE instruction writes a ONE into the bit/box for B3/0 ... and ... the bit/box for B3/0 has a status of ONE ... the scan continues on Branch C ... the bit/box for B3/0 contains a status of ONE ... so ... the XIO instruction for B3/0 is FALSE ... the OTU instruction for O:6/0 has FALSE logic coming in ... so ... the OTU instruction does nothing to the bit/box ... and ... the bit/box for O:6/0 keeps its status of ONE ... the scan continues on Branch D ... the OTE instruction for B3/1 has TRUE logic coming in ... so ... the OTE instruction writes a ONE into the bit/box for B3/1 ... and ... the bit/box for B3/1 has a status of ONE ... as we finish this scan, the bits/boxes have the following status ... I:2/0 O:6/0 B3/0 B3/1 = = = = ONE ONE ONE ONE ... ... ... ...

the field device Lamp-E turns ON ...

84. 85. 86. 87. 88. 89. 90. 91. 92. 93. 94. 95. 96. 97. 98. 99. 100. 101. 102. 103. 104. 105. 106. 107. 108. 109. 110. 111. 112. 113. 114. 115. 116. 117. 118. 119. 120.

Start of Scan C suppose that the operator keeps pressing Button-A in the field ... as we start this scan, the bits/boxes have the following status ... I:2/0 O:6/0 B3/0 B3/1 = = = = ONE ONE ONE ONE ... ... ... ...

here's how the processor interprets the rung ... the bit/box for I:2/0 contains a status of ONE ... so ... the XIC instruction for I:2/0 is TRUE ... the bit/box for B3/1 contains a status of ONE ... so ... the XIO instruction for B3/1 is FALSE ... the bit/box for O:6/0 contains a status of ONE ... so ... the XIO instruction for O:6/0 is FALSE ... the OTL instruction for O:6/0 has FALSE logic coming in ... so ... the OTL instruction does nothing to the bit/box ... and ... the bit/box for O:6/0 keeps its status of ONE ... the scan continues on Branch B ... the OTE instruction for B3/0 has FALSE logic coming in ... so ... the OTE instruction writes a ZERO into the bit/box for B3/0 ... and ... the bit/box for B3/0 has a status of ZERO ... the scan continues on Branch C ... the bit/box for B3/0 contains a status of ZERO ... so ... the XIO instruction for B3/0 is TRUE ... the OTU instruction for O:6/0 has FALSE logic coming in ... so ... the OTU instruction does nothing to the bit/box ... and ... the bit/box for O:6/0 keeps its status of ONE ... the scan continues on Branch D ... the OTE instruction for B3/1 has TRUE logic coming in ... so ... the OTE instruction writes a ONE into the bit/box for B3/1 ... and ... the bit/box for B3/1 has a status of ONE ... as we finish this scan, the bits/boxes have the following status ... I:2/0 O:6/0 B3/0 B3/1 = = = = ONE ... ONE ... ZERO ... ONE ...

the field device Lamp-E stays ON ...

121. 122. 123. 124. 125. 126. 127. 128. 129. 130. 131. 132. 133. 134. 135. 136. 137. 138. 139. 140. 141. 142. 143. 144. 145. 146. 147. 148. 149. 150. 151. 152. 153. 154. 155. 156. 157. 158.

Start of Scan D suppose that the operator keeps pressing Button-A in the field ... as we start this scan, the bits/boxes have the following status ... I:2/0 O:6/0 B3/0 B3/1 = = = = ONE ... ONE ... ZERO ... ONE ...

here's how the processor interprets the rung ... the bit/box for I:2/0 contains a status of ONE ... so ... the XIC instruction for I:2/0 is TRUE ... the bit/box for B3/1 contains a status of ONE ... so ... the XIO instruction for B3/1 is FALSE ... the bit/box for O:6/0 contains a status of ONE ... so ... the XIO instruction for O:6/0 is FALSE ... the OTL instruction for O:6/0 has FALSE logic coming in ... so ... the OTL instruction does nothing to the bit/box ... and ... the bit/box for O:6/0 keeps its status of ONE ... the scan continues on Branch B ... the OTE instruction for B3/0 has FALSE logic coming in ... so ... the OTE instruction writes a ZERO into the bit/box for B3/0 ... and ... the bit/box for B3/0 has a status of ZERO ... the scan continues on Branch C ... the bit/box for B3/0 contains a status of ZERO ... so ... the XIO instruction for B3/0 is TRUE ... the OTU instruction for O:6/0 has FALSE logic coming in ... so ... the OTU instruction does nothing to the bit/box ... and ... the bit/box for O:6/0 keeps its status of ONE ... the scan continues on Branch D ... the OTE instruction for B3/1 has TRUE logic coming in ... so ... the OTE instruction writes a ONE into the bit/box for B3/1 ... and ... the bit/box for B3/1 has a status of ONE ... as we finish this scan, the bits/boxes have the following status ... I:2/0 O:6/0 B3/0 B3/1 = = = = ONE ... ONE ... ZERO ... ONE ...

the field device Lamp-E stays ON ... if Button-A stays pressed, all subsequent scans will be the same ...

159. 160. 161. 162. 163. 164. 165. 166. 167. 168. 169. 170. 171. 172. 173. 174. 175. 176. 177. 178. 179. 180. 181. 182. 183. 184. 185. 186. 187. 188. 189. 190. 191. 192. 193. 194. 195.

Start of Scan E now suppose that the operator releases Button-A in the field ... as we start this scan, the bits/boxes have the following status ... I:2/0 O:6/0 B3/0 B3/1 = = = = ZERO ... ONE ... ZERO ... ONE ...

here's how the processor interprets the rung ... the bit/box for I:2/0 contains a status of ZERO ... so ... the XIC instruction for I:2/0 is FALSE ... the bit/box for B3/1 contains a status of ONE ... so ... the XIO instruction for B3/1 is FALSE ... the bit/box for O:6/0 contains a status of ONE ... so ... the XIO instruction for O:6/0 is FALSE ... the OTL instruction for O:6/0 has FALSE logic coming in ... so ... the OTL instruction does nothing to the bit/box ... and ... the bit/box for O:6/0 keeps its status of ONE ... the scan continues on Branch B ... the OTE instruction for B3/0 has FALSE logic coming in ... so ... the OTE instruction writes a ZERO into the bit/box for B3/0 ... and ... the bit/box for B3/0 has a status of ZERO ... the scan continues on Branch C ... the bit/box for B3/0 contains a status of ZERO ... so ... the XIO instruction for B3/0 is TRUE ... the OTU instruction for O:6/0 has FALSE logic coming in ... so ... the OTU instruction does nothing to the bit/box ... and ... the bit/box for O:6/0 keeps its status of ONE ... the scan continues on Branch D ... the OTE instruction for B3/1 has FALSE logic coming in ... so ... the OTE instruction writes a ZERO into the bit/box for B3/1 ... and ... the bit/box for B3/1 has a status of ZERO ... as we finish this scan, the bits/boxes have the following status ... I:2/0 O:6/0 B3/0 B3/1 = = = = ZERO ... ONE ... ZERO ... ZERO ...

the field device Lamp-E stays ON ...

196. 197. 198. 199. 200. 201. 202. 203. 204. 205. 206. 207. 208. 209. 210. 211. 212. 213. 214. 215. 216. 217. 218. 219. 220. 221. 222. 223. 224. 225. 226. 227. 228. 229. 230. 231. 232. 233.

Start of Scan F suppose that the operator leaves Button-A in the field released ... as we start this scan, the bits/boxes have the following status ... I:2/0 O:6/0 B3/0 B3/1 = = = = ZERO ... ONE ... ZERO ... ZERO ...

here's how the processor interprets the rung ... the bit/box for I:2/0 contains a status of ZERO ... so ... the XIC instruction for I:2/0 is FALSE ... the bit/box for B3/1 contains a status of ZERO ... so ... the XIO instruction for B3/1 is TRUE ... the bit/box for O:6/0 contains a status of ONE ... so ... the XIO instruction for O:6/0 is FALSE ... the OTL instruction for O:6/0 has FALSE logic coming in ... so ... the OTL instruction does nothing to the bit/box ... and ... the bit/box for O:6/0 keeps its status of ONE ... the scan continues on Branch B ... the OTE instruction for B3/0 has FALSE logic coming in ... so ... the OTE instruction writes a ZERO into the bit/box for B3/0 ... and ... the bit/box for B3/0 has a status of ZERO ... the scan continues on Branch C ... the bit/box for B3/0 contains a status of ZERO ... so ... the XIO instruction for B3/0 is TRUE ... the OTU instruction for O:6/0 has FALSE logic coming in ... so ... the OTU instruction does nothing to the bit/box ... and ... the bit/box for O:6/0 keeps its status of ONE ... the scan continues on Branch D ... the OTE instruction for B3/1 has FALSE logic coming in ... so ... the OTE instruction writes a ZERO into the bit/box for B3/1 ... and ... the bit/box for B3/1 has a status of ZERO ... as we finish this scan, the bits/boxes have the following status ... I:2/0 O:6/0 B3/0 B3/1 = = = = ZERO ... ONE ... ZERO ... ZERO ...

the field device Lamp-E stays ON ... if Button-A stays released, all subsequent scans will be the same ...

234. 235. 236. 237. 238. 239. 240. 241. 242. 243. 244. 245. 246. 247. 248. 249. 250. 251. 252. 253. 254. 255. 256. 257. 258. 259. 260. 261. 262. 263. 264. 265. 266. 267. 268. 269. 270.

Start of Scan G now suppose that the operator presses Button-A in the field ... as we start this scan, the bits/boxes have the following status ... I:2/0 O:6/0 B3/0 B3/1 = = = = ONE ... ONE ... ZERO ... ZERO ...

here's how the processor interprets the rung ... the bit/box for I:2/0 contains a status of ONE ... so ... the XIC instruction for I:2/0 is TRUE ... the bit/box for B3/1 contains a status of ZERO ... so ... the XIO instruction for B3/1 is TRUE ... the bit/box for O:6/0 contains a status of ONE ... so ... the XIO instruction for O:6/0 is FALSE ... the OTL instruction for O:6/0 has FALSE logic coming in ... so ... the OTL instruction does nothing to the bit/box ... and ... the bit/box for O:6/0 keeps its status of ONE ... the scan continues on Branch B ... the OTE instruction for B3/0 has FALSE logic coming in ... so ... the OTE instruction writes a ZERO into the bit/box for B3/0 ... and ... the bit/box for B3/0 has a status of ZERO ... the scan continues on Branch C ... the bit/box for B3/0 contains a status of ZERO ... so ... the XIO instruction for B3/0 is TRUE ... the OTU instruction for O:6/0 has TRUE logic coming in ... so ... the OTU instruction writes a ZERO to the bit/box ... and ... the bit/box for O:6/0 has a status of ZERO ... the scan continues on Branch D ... the OTE instruction for B3/1 has TRUE logic coming in ... so ... the OTE instruction writes a ONE into the bit/box for B3/1 ... and ... the bit/box for B3/1 has a status of ONE ... as we finish this scan, the bits/boxes have the following status ... I:2/0 O:6/0 B3/0 B3/1 = = = = ONE ... ZERO ... ZERO ... ONE ...

the field device Lamp-E turns OFF ...

271. 272. 273. 274. 275. 276. 277. 278. 279. 280. 281. 282. 283. 284. 285. 286. 287. 288. 289. 290. 291. 292. 293. 294. 295. 296. 297. 298. 299. 300. 301. 302. 303. 304. 305. 306. 307. 308.

Start of Scan H suppose that the operator keeps pressing Button-A in the field ... as we start this scan, the bits/boxes have the following status ... I:2/0 O:6/0 B3/0 B3/1 = = = = ONE ... ZERO ... ZERO ... ONE ...

here's how the processor interprets the rung ... the bit/box for I:2/0 contains a status of ONE ... so ... the XIC instruction for I:2/0 is TRUE ... the bit/box for B3/1 contains a status of ONE ... so ... the XIO instruction for B3/1 is FALSE ... the bit/box for O:6/0 contains a status of ZERO ... so ... the XIO instruction for O:6/0 is TRUE ... the OTL instruction for O:6/0 has FALSE logic coming in ... so ... the OTL instruction does nothing to the bit/box ... and ... the bit/box for O:6/0 keeps its status of ZERO ... the scan continues on Branch B ... the OTE instruction for B3/0 has FALSE logic coming in ... so ... the OTE instruction writes a ZERO into the bit/box for B3/0 ... and ... the bit/box for B3/0 has a status of ZERO ... the scan continues on Branch C ... the bit/box for B3/0 contains a status of ZERO ... so ... the XIO instruction for B3/0 is TRUE ... the OTU instruction for O:6/0 has FALSE logic coming in ... so ... the OTU instruction does nothing to the bit/box ... and ... the bit/box for O:6/0 keeps its status of ZERO ... the scan continues on Branch D ... the OTE instruction for B3/1 has TRUE logic coming in ... so ... the OTE instruction writes a ONE into the bit/box for B3/1 ... and ... the bit/box for B3/1 has a status of ONE ... as we finish this scan, the bits/boxes have the following status ... I:2/0 O:6/0 B3/0 B3/1 = = = = ONE ... ZERO ... ZERO ... ONE ...

the field device Lamp-E stays OFF ... if Button-A remains pressed, all subsequent scans will be the same ...

309. 310. 311. 312. 313. 314. 315. 316. 317. 318. 319. 320. 321. 322. 323. 324. 325. 326. 327. 328. 329. 330. 331. 332. 333. 334. 335. 336. 337. 338. 339. 340. 341. 342. 343. 344. 345. 346.

Start of Scan I now suppose that the operator releases Button-A in the field ... as we start this scan, the bits/boxes have the following status ... I:2/0 O:6/0 B3/0 B3/1 = = = = ZERO ... ZERO ... ZERO ... ONE ...

here's how the processor interprets the rung ... the bit/box for I:2/0 contains a status of ZERO ... so ... the XIC instruction for I:2/0 is FALSE ... the bit/box for B3/1 contains a status of ONE ... so ... the XIO instruction for B3/1 is FALSE ... the bit/box for O:6/0 contains a status of ZERO ... so ... the XIO instruction for O:6/0 is TRUE ... the OTL instruction for O:6/0 has FALSE logic coming in ... so ... the OTL instruction does nothing to the bit/box ... and ... the bit/box for O:6/0 keeps its status of ZERO ... the scan continues on Branch B ... the OTE instruction for B3/0 has FALSE logic coming in ... so ... the OTE instruction writes a ZERO into the bit/box for B3/0 ... and ... the bit/box for B3/0 has a status of ZERO ... the scan continues on Branch C ... the bit/box for B3/0 contains a status of ZERO ... so ... the XIO instruction for B3/0 is TRUE ... the OTU instruction for O:6/0 has FALSE logic coming in ... so ... the OTU instruction does nothing to the bit/box ... and ... the bit/box for O:6/0 keeps its status of ZERO ... the scan continues on Branch D ... the OTE instruction for B3/1 has FALSE logic coming in ... so ... the OTE instruction writes a ZERO into the bit/box for B3/1 ... and ... the bit/box for B3/1 has a status of ZERO ... as we finish this scan, the bits/boxes have the following status ... I:2/0 O:6/0 B3/0 B3/1 = = = = ZERO ZERO ZERO ZERO ... ... ... ...

the field device Lamp-E stays OFF ... and now we're back to our original starting conditions ...

S-ar putea să vă placă și