Posted 4 Mar 2020 Hi, We have a company that is specialized in bandsaw machines, this is one of those machines: What we have done is hook up a wire encoder to the saw bow and the other end of the wire on the base of the machine. You can see a picture of it in the attachment. I have followed the manual of the FX2N-2AD module, the wire encoder requires the current input from 4-20mA, and I am getting a digital output, but this needs to be converted to show in millimeters on the HMI. Unfortunately I am only learning how to do this, and am not an expert in Mitsubishi PLCs (yet). Currently the only code we are using in PLC for reading the 2AD module is found in attachment. TLDR: Wire encoder giving a digital output, but now need code that can convert this value into mm. Share this post Link to post Share on other sites
Posted 5 Mar 2020 (edited) All you have to do is give it an offset and Gain. You can do this is the PLC but as this is for displaying it on the HMI. You should also have this function in the HMI. Are you using a Mitsubishi GOT ? What is the range of the Digital value vs mm Edited 5 Mar 2020 by Gambit Share this post Link to post Share on other sites
Posted 5 Mar 2020 (edited) 1 hour ago, Gambit said: All you have to do is give it an offset and Gain. You can do this is the PLC but as this is for displaying it on the HMI. You should also have this function in the HMI. Are you using a Mitsubishi GOT ? What is the range of the Digital value vs mm Hoi Gambit, Even though we are both Dutchies I will continue in English. When the sawbow is down, which would amount to 0 mm, the plc has a digital value of 502. Can you tell me how to adjust it to be correct? I have already played with some offset/gain but I don't really understand how that works. Thanks! PS. Not using Mitsubishi GOT, using some HMI called Pingtung (Chinese brand). Software also gives me possibility of offset/gain, but rather do it via screws on the module. Edited 5 Mar 2020 by captainpatje Share this post Link to post Share on other sites
Posted 5 Mar 2020 No problem but i also need a point to make the offset gain 0mm = 502 100mm= xxxx For Instance 0- 4000 in the PLC should be a range of 10 - 20 bar so 0 = 10 and 4000 =20 For this example the gain = 0.0025 and the offset 10 because if the value for instance would be 2000 (2000 x 0.0025)+10= 15 (bar) Share this post Link to post Share on other sites
Posted 5 Mar 2020 16 minutes ago, Gambit said: No problem but i also need a point to make the offset gain 0mm = 502 100mm= xxxx For Instance 0- 4000 in the PLC should be a range of 10 - 20 bar so 0 = 10 and 4000 =20 For this example the gain = 0.0025 and the offset 10 because if the value for instance would be 2000 (2000 x 0.0025)+10= 15 (bar) Okay! Highest point of the sawbow = 54mm 54mm = digital value 589 Share this post Link to post Share on other sites
Posted 5 Mar 2020 (edited) 54mm=589 1mm=589/54=10.7090909 so you can divide digital value with 10 .7090909. Then you can get mm value Edited 5 Mar 2020 by Nigher Share this post Link to post Share on other sites
Posted 5 Mar 2020 (edited) 0 = 502 54 mm = 589 your offset would be -311.586 your Gain would be 0.62069 27 mm should be 545,5 (calc 545,5 x 0.62069)-311.586 = 27.0000395 Edited 5 Mar 2020 by Gambit Share this post Link to post Share on other sites