the Block Transfer "mailman" lecture
short on time but - the 5 integer words of the CONTROL BLOCK are used to “control” the operation of the Block Transfer - quick analogy: the Block Transfer is a “mailman” - if it’s a Block Transfer WRITE then the mailman is carrying mail FROM the processor TO another device (like your analog card) - if it’s a Block Transfer READ then the mailman is carrying mail TO the processor FROM the other device (example: your analog card) - in simplest terms: the Block Transfer WRITE “mailman” does NOT write the message - he just carries it FROM the processor - the Block Transfer READ “mailman” does NOT read the message - he just carries it TO the processor - specifically, the terms READ and WRITE serve only to tell us in which direction the data is being moved (data FROM the processor = WRITE; data TO the processor = READ) -
next point - using the “mailman” analogy, consider that the 5 integer words of the control block are the “address” on the outside of the envelope - example: it takes 5 pieces of information to convey MY personal mailing address - my NAME - my STREET - my CITY - my STATE - and my ZIP CODE - (of course this is an oversimplification - but it works well for beginners)
next point - using the “mailman” analogy, consider that the integer words of the data file are the “message” inside the envelope - specifically, the actual information that the message conveys - example: scaling values, analog signal values, etc. - how many words are in the data file? - the Block Transfer’s LENGTH entry tells the mailman how many words of data to transfer -
that should get you going - now here’s a VERY instructive experiment to hammer it all home - and you DON'T need a processor to try this - it will work OFFLINE too -
start a brand new temporary program - program a quick BTW rung using N7:0 for the control block - use N7:5 for the data file - set the rack to “000” (“00” is the same thing) - set the group for “4” - set the module for “0” - set the length for 37 - set continuous for “No” - nail down the rung and then proofread the entries carefully - now notice that the first word of the control block is N7:0 - next go to the data table location for that word - notice that it currently contains the value “8” - manually change N7:0 to contain the value “4095” - now take another look at your Block Transfer entries - WHOA! - what the heck happened here? - now change N7:0 back to the value “8” - how about THAT sports fans? -
major concept: once the control blocks are set up for your block transfers, STAY-THE-HECK-AWAY-FROM-THOSE-LOCATIONS - clumsy changes to those values will blow your Block Transfers completely out of the water - keep this in mind as you reference the first word “bit patterns” in Kim’s post above -
one more thought: suppose that you have a TON timer rung in your program (example: for T4:0) - what would happen if you were to go to the timer’s location in the T4 data file, and change the value stored in the Preset? - try it if you don’t already know the answer - give away: changing the value in the Preset location on the data table file will automatically change the Preset value shown in the timer rung - think about it this way: T4:0 on the data table is the “CONTROL BLOCK” for the timer! - most people never look at it that way, but it’s a perfectly valid concept - point: a timer needs a “control block” in the processor’s memory - a Block Transfer needs a “control block” in the processor’s memory -
finally, you might want to experiment with using the “BT” type files for your Block Transfer control blocks - just keep in mind that not all PLC-5 processors support the BT file types - so it’s best to understand the integer types, and then consider the BT types as a “simplified” way of setting things up - quick analogy: learn to drive “clutch pedal and stick shift” and later on “automatic transmissions” will be a piece of cake -