## BLOCK LOGIC

The first step is to name each block in the flowchart, as shown in Figure 10.1 Labeling Blocks in the Flowchart. Each of the numbered steps will then be converted to ladder logic Figure 10.1 Labeling Blocks in the Flowchart

Each block in the flowchart will be converted to a block of ladder logic. To do this we will use the MCR (Master Control Relay) instruction (it will be discussed in more detail later.) The instruction is shown in Figure 10.1 The MCR Function, and will appear as a matched pair of outputs labelled MCR. If the first MCR line is true then the ladder logic on the following lines will be scanned as normal to the second MCR. If the first line is false the lines to the next MCR block will all be forced off. If a normal output is used inside an MCR block, it may be forced off. Therefore latches will be used in this method. Figure 10.1 The MCR Function

The first part of the ladder logic required will reset the logic to an initial condition, as shown in Figure 10.1 Initial Reset of States. The line will only be true for the first scan of the PLC, and at that time it will turn on the flowchart block F1 which is the reset all values off operation. All other operations will be turned off. Figure 10.1 Initial Reset of States

The ladder logic for the first state is shown in Figure 10.1 Ladder Logic for the Operation F1. When F1 is true the logic between the MCR lines will be scanned, if F1 is false the logic will be ignored. This logic turns on the outlet valve and turns off the inlet valve. It then turns off operation F1, and turns on the next operation F2. Figure 10.1 Ladder Logic for the Operation F1

The ladder logic for operation F2 is simple, and when the start button is pushed, it will turn off F2 and turn on F3. The ladder logic for operation F3 opens the inlet valve and moves to operation F4. Figure 10.1 Ladder Logic for Flowchart Operations F2 and F3

The ladder logic for operation F4 turns off F4, and if the tank is full it turns on F6, otherwise F5 is turned on. The ladder logic for operation F5 is very similar. Figure 10.1 Ladder Logic for Operations F4 and F5

The ladder logic for operation F6 turns the outlet valve on and turns off the inlet valve. It then ends operation F6 and returns to operation F2. Figure 10.1 Ladder Logic for Operation F6
{"ft_lang_label":"__label__en","ft_lang_prob":0.8789003,"math_prob":0.9534984,"size":2242,"snap":"2021-21-2021-25","text_gpt3_token_len":541,"char_repetition_ratio":0.18811439,"word_repetition_ratio":0.073459715,"special_character_ratio":0.23282783,"punctuation_ratio":0.08631579,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9844208,"pos_list":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],"im_url_duplicate_count":[null,3,null,3,null,3,null,3,null,3,null,3,null,3,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-05-18T19:58:36Z\",\"WARC-Record-ID\":\"<urn:uuid:e8776c9f-8678-43a9-bfcd-110e7f7c7862>\",\"Content-Length\":\"12513\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:61d5f597-b447-44ce-b672-47cf052be0b4>\",\"WARC-Concurrent-To\":\"<urn:uuid:a7f5e9cc-7951-4bf6-a497-629470e94346>\",\"WARC-IP-Address\":\"107.180.55.229\",\"WARC-Target-URI\":\"http://engineeronadisk.com/V2/book_PLC/engineeronadisk-112.html\",\"WARC-Payload-Digest\":\"sha1:5VH4WBIJSPKB3D7V7HH6KFAGL3T3MZV6\",\"WARC-Block-Digest\":\"sha1:DRZ7RTM6M6TZF5I5QFIZBRJVCBKRYR2J\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-21/CC-MAIN-2021-21_segments_1620243991514.63_warc_CC-MAIN-20210518191530-20210518221530-00236.warc.gz\"}"}