waynesun95
Member
Hi everyone,
I honestly think this is a stupid question and I am completely missing something simple here, but I am having difficulties trying to set a float register to a data tag in Red Lion. With integer, bit, and string addresses I can map it to the corresponding Red Lion tag by just inputting the correct register address as the Data Source. However, for floats this is not the case, as when I map a float address it to a numeric tag it always reads as 0.
From what I have figured out through personal investigation is that this is because in the "Treat As" field in the Data Source section of the Red Lion numeric tag, you can only choose the option to treat it as a float if it is a 32 bit address. In the Click PLC, floats are stored in Holding Registers, which has the form 4XXXXX. The default data type for these registers is Word as Word, which does not allow for the option to treat the numeric tag as a float, and the numeric tag always gives the value of 0 (probably because it is trying to treat the float as an integer). When I change it to Word as Real or Word as Long, the option to treat it as a float comes up. HOWEVER, the number I get is not the correct value, instead it is a crazy decimal. For example, if I input 50.43 in the Click PLC it corresponds to -5.013E-5 in the Red Lion.
If anyone has any help on this matter it would be very appreciated!
I honestly think this is a stupid question and I am completely missing something simple here, but I am having difficulties trying to set a float register to a data tag in Red Lion. With integer, bit, and string addresses I can map it to the corresponding Red Lion tag by just inputting the correct register address as the Data Source. However, for floats this is not the case, as when I map a float address it to a numeric tag it always reads as 0.
From what I have figured out through personal investigation is that this is because in the "Treat As" field in the Data Source section of the Red Lion numeric tag, you can only choose the option to treat it as a float if it is a 32 bit address. In the Click PLC, floats are stored in Holding Registers, which has the form 4XXXXX. The default data type for these registers is Word as Word, which does not allow for the option to treat the numeric tag as a float, and the numeric tag always gives the value of 0 (probably because it is trying to treat the float as an integer). When I change it to Word as Real or Word as Long, the option to treat it as a float comes up. HOWEVER, the number I get is not the correct value, instead it is a crazy decimal. For example, if I input 50.43 in the Click PLC it corresponds to -5.013E-5 in the Red Lion.
If anyone has any help on this matter it would be very appreciated!