Bau20 Posted October 18 Report Posted October 18 I want to move float for example from d10 to d1. How can i do this? Used dmov, dfmov but they dont work. Appaers number like 999877656766
Crossbow Posted October 18 Report Posted October 18 For floating point the instruction is EMOV. You could also use DMOV since it moves 32 bits, but make sure you monitor the data in the proper Float format.
Parky Posted October 19 Report Posted October 19 Just remember that in mitsubishi a 32 bit number (double int or float) takes up two registers for example D0 + D1, so you would need to move two registers the MOV instruction only moves one 16 bit the DMOV moves two. If you program using symbolic i.e. rather than D registers then it may give you a compile error (if you are using GXworks2 or 3. unlike othe older GXDeveloper) i.e. you define the symbols as the type i.e. word, float etc. It makes sense for doubles or floats to start at even numbers i.e. D0, D2, D4 etc. this way it reduces possible errors it is easy to forget you use say D1 as a float & then use D2 as something else. Even better allocate certain blocks of registers as words, floats etc. like D100-D199 as singles (integers) D200-D299 as floats & so on. Also remember that the retentive types (keep their data when switched off) can be set in the PLC parameters, the setting (depending on PLC) does normally have a standard range already set but can be modified. 1
Zubair Ahmed Posted October 23 Report Posted October 23 to Move the float values from one register to another you have to use DEMOV Command reference as attachment. Remember a float register is two consective register . if D0 is float means D0+D1 value holds the register. so the desitnation will be also two consective registers.
Parky Posted October 23 Report Posted October 23 (edited) That is not strictly true if using GXDeveloper & not the later GXWorks2 (in label mode) It will still move the data as two 16 bit values even though they are a float see this picture it shows moving a Double (D0 +D1) to another double (D2 + D3) & when displayed as a float it is correct, however, it makes sense to actually use the correct move as it will display correctly in the ladder monitor. Edited October 23 by Parky
Crossbow Posted October 27 Report Posted October 27 On 10/23/2025 at 2:19 AM, Zubair Ahmed said: to Move the float values from one register to another you have to use DEMOV Command reference as attachment. Remember a float register is two consective register . if D0 is float means D0+D1 value holds the register. so the desitnation will be also two consective registers. It's only DEMOV in the FX family. He never said which PLC, so I answered EMOV, which is correct for Q Series, L Series, and iQ-R Series.
Parky Posted October 27 Report Posted October 27 Crossbow, if you read my post you can use DMOV or DEMOV in fact you can also use MOV twice i.e. MOV D0 to D2, & MOV D1 to D3 n FX,or Q if you use only the physical declaration i.e. "D" you can use any of those but as I said monitoring can be a problem as it will display in the format of the actual function.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now