Posted 8 Jun 2016 (edited) Hi, I am not an advance user of PLC's but I can muddle my way around. I am currently reviewing a program written by another person and I will need to make some modifications. I have noted that on a M8002 pulse the Mitsubishi FX2N-8AD CH5 to CH8 -[To K0 K1 H3333 K1]- are all set for a 4-20mA current input which is perfectly acceptable however on the same pulse is written -[TO K0 K22 K0 K1]-. I was hoping that someone could explain exactly what this is doing. I understand that the first K0 is the module number K22 is BFM#22 but I am not sure exactly what this is and I am a little confused by what is written in the manual. (8.2.7 BFM #22: Sets convenient functions: The functions described below are assigned to b0 to b3 of BFM #22. When a bit is set to ON, the assigned function becomes valid. When a bit is set to OFF, the assigned function becomes invalid..............) .Due to not knowing exactly what BFM #22 is doing I am unsure why the next K0 is used and the final K1 is to do this operation once? I apologise if this seems like a very basic question but I just can't seem to find any further detail online regarding BFM#22 that I can understand. Any help would be greatly appreciated. Thanks for your help. Paul. Edited 8 Jun 2016 by Paul101 Spelling Mistake Share this post Link to post Share on other sites
Posted 8 Jun 2016 (edited) First the last K1 just means that this value is only written to BFM 22. When you use TO K0 K1 K10 K3 then the value 10 is written to BFM 1 buts also 2 and 3.. When you use TO K0 K1 D1 K3 then the value of D1 is written to BFM 1 but D2 to BFM 2 and D3 to BFM 3. As for BFM 22: Bit 0 is a Data addition function Bit 1 is Upper / Lower limit value detection function Bit 2 is Sudden Change Detection Bit 3 is Peak Value Hold Function But all these are Disabled in your program I've attached the manual which explains them in detailJY992D86001B FX2N-8AD Analog input block USER'S MANUAL [12-06-2004].pdf Edited 8 Jun 2016 by Gambit Share this post Link to post Share on other sites
Posted 8 Jun 2016 Hi thanks for your reply. I actually have the manual but thank you. I am just finding the manual a little confusing (please forgive my lack of understanding). So in this instance -[TO K0 K22 K0 K1]- the value 0 is written to BFM#22 which I understand. Am I correct to say that if as in this case writing the value 0 to BFM#22 disables it and if I place the value 1 in BFM22 I am enabling it? It's also the concept of if BFM#22 is actually enabled what can I do with it and how is this done? Knowing how to enable or disable It is probably the most important thing for now. Again, thanks for the help. Paul Share this post Link to post Share on other sites
Posted 8 Jun 2016 If you write 1 you're only enabling the first one Bit 0. If you would like to enable them all it would be (bin 0000.0000.0000.1111) = (Hex HF) or (Dec K15). Share this post Link to post Share on other sites
Posted 9 Jun 2016 Let's separate the instruction is doing from the result of the operation. The TO instruction is just a way to write information from the PLC to the module, and it works like this: [ TO S1 S2 S3 S4] S1 - location of module on PLC, (first intelligent module attached to base is 0) S2 - number of the first register you are writing on the module S3 - source information - could be a constant or a register on the PLC S4 - number of registers you are writing to So take a different example: [TO K0 K22 K0 K2] This would write a constant of zero into buffer memory locations 22 and 23 on module 0. In your case, the instruction is writing a 0 to buffer memory 22. That's the end of what the TO instruction is doing, now let's look at the result. For the particular module you are using, buffer memory 22 has a particular use. Each buffer memory location is 16 bits, which can be represented as a bit pattern, or a value. In this case it's a bit pattern, where each of the first four bits enables or disables a particular feature of the analog to digital conversion. The details of the functions should be in the manual, which do take a little getting used to. But all you really need to know is that since you are writing a 0, all four bits are turned off, and therefore all four functions are disabled. Share this post Link to post Share on other sites