Sign in to follow this  
Followers 0
anjani

Decimal value input from HMI Lookout 6.2 to Mitsubishi Fx2nc PLC

6 posts in this topic

Dear all I am trying to get the decimal value like 1.2 or 2.4 into Mitsubishi FX2N PLC ( like D40) from HMI software NI Lookout 6.2 for comparision with data obtained from analog module saved into variable like D1 or D2. My problem is that when I move the knob to 1.2 value or input decimal value in Lookout which is saved in variable like D40 , knob value reverts to 1.0 or 2.0 after releasing the knob button or input value goes back to full value, it seems that decimal value is discarded by PLC so that Lookout just shows the complete number not the number with decimal part. Am I doing something wrong with choosing the variable type selection in PLC or 16bit or 32bit are variable not selected correctly. When I input full number like 1,2,3 it compares well with the data stored in analog module variable D1,D2,D3. Thanks for any suggestion!

Share this post


Link to post
Share on other sites
Values 1.2 or 2.4 are not decimal, these are floating point values. It is naturally that you get integer part of number only.

Share this post


Link to post
Share on other sites
Try the FLT command (floating point). LD M8000 FLT D40 D40 This will allow you to store a decimal in D40

Share this post


Link to post
Share on other sites
Thanks Paul Ked for your reply! Sorry for not mentioning that I had tried floating point instruction before posting but it didn't work. When I use FLT instruction to convert decimal value from NI Lookout HMI to FX2N PLC like you suggested, FLT D40 D40 HMI shows zero digit after releasing the knob button within 1 second from decimal value like 2.3, even for non decimal value like 1,2 ,3 , shows zero value. I have even tried to store the fractional number first in one register like D70 and then using float instruction to convert that into decimal value into D75 register like M8000 FLT D70 D75 but still do not get the desired result. Using above instruction ,D76 shows big number in GX developer which I don't understand as in programming manual says, in 32bit mode , integer part should be stored in D75 and decimal part in D76 but I don't see any number in D75. Though without FLT instruction PLC only discards decimal and stores the integer part ( HMI must be showing the integer part and discarding the decimal part after reading back the interger value from the PLC ). Is there any method by which I can first convert the destination data register like D40 into floating point and then try to store fractional number into that register from HMI? Because it seems, as mentioned in manual, by default PLC only handles integer data. That's why when I input fractional number like 3.3 in HMI , that number is read into data register , but PLC immediately discard the decimal part and stores only integer part. One forum member has successfully handled fractional number as described in one post, but he stored all fractional numbers in PLC programme, not read from HMI. Hope I have described my problem well! Thanks a lot! Edited by anjani

Share this post


Link to post
Share on other sites
Give your analogue object in the HMI a gain of 0.1 and set it to one decimal place. When you read 1.2 from the HMI it will be stored in the register as 12. You can then FLT this into another register and EDIV E10 Dxx it to give you the actual value in the HMI. Just worked for me using an E1101 HMI.

Share this post


Link to post
Share on other sites
Thanks Paul Ked for your prompt reply! Since I am not using the HMI that you mentioned so I couldn't do it that way with the HMI I am using, I couldn't find any such configuration in NI Lookout HMI, but your suggestion gave me an idea. Actually there is scaling option for analog data acquired from PLC, like suppose if analog data varies from 0 though 1000 then I can scale that range into 0 - 5 meter, so if analog data is 100 from PLC then HMI shows 0.5 meter. In fact I was trying to control the water gate up and downward movement which moves between 0 and 5 meter span. Gate position sensor feeds analog signal (4~20mAmp) to PLC which gives 0 - 1000 integer value to HMI, with scaling option I can scale 0 - 1000 into 0 - 5 value, so when I input 1.2 meter then HMI scales this value into corresponding 240 integer value and stores in PLC data register D40, when gate moves beyond 240 value it stops at that point as I have programmed to make the gate stop at set value, this way floating point calculation is not needed. Thanks for your kind suggestion and interest in my post! Edited by anjani

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0