naresh_pt Posted May 11, 2006 Report Posted May 11, 2006 Hi all, Can any body tell me that how to write Real_Flot) Number in adata registers in PLC program. to write integer 100 in data register D1 we write thr instruction [MOV K100 D1] For writing Real value what should be the statement. Regards Naresh P. Quote
FNMdeJong Posted May 11, 2006 Report Posted May 11, 2006 These instructions is different for each PLC type: For an FX2N series PLC : MOV K100 D0 FLT D0 D10 ................. INT D10 D20 First move the value K100 into register D0 Convert D0 to floating point format into D10 Do something with the value Next convert D10 in floating point back to decimal into D20 The function FLT is depending on special bit M8023, if M8023 is off the conversion is from decimal to floating point, if M8023 is on the conversion is from floating point to decimal. floating point numbers are 32 bit, so the conversion backwards is in 32 bits format. For a Q system you can write direct a floating point value: EMOV E100 D0 Conversion functions are the same as for the FX series. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.