Issue with Mapping Floating Point Addresses from Click PLC to Red Lion in Crimson 3.0

waynesun95

Member
Join Date
Jun 2016
Location
NJ
Posts
2
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!
 
A 32 bit floating point consists of two 16 bit words, each 16 bit word is 4 hexadecimal characters.

The wrong value comes from a misinterpretation because the word order is flipped/backwards.

All the bits are there, but not in the correct order to interpret the bits as 50.43.

50.43 is hex 4249 b852
4249b852_hi.jpg


When the the 16 bits are reversed, b852 4249, then the interpreted value is the oddball value you cited:
b8524249_hi.jpg


I can't tell you how to swap the word order in a Red Lion, you'll have to figure that out for yourself, but that's what the issue is.
 
I had the same symptoms the first time I used a Red Lion with a P2000. Only floats were screwy, and it had to do with the data type I was selecting. When choosing the data type from the address picker for Modbus Holding Registers, at the bottom of the window there are three choices. I ended up getting the right numbers when I chose "Word as Real".
 

Similar Topics

Hi There, I have an AB L33ER talking with a unit over Modbus TCP, coms are all good and i am reading in data so all that side of it is fine. The...
Replies
1
Views
1,955
Dear All, I am currently facing a simple input mapping logic issue. Basically, the input bit function well from the sensor and it trigger...
Replies
11
Views
3,510
Hi Guys There is a tester on my floor, using SoftLogix, 1784-PCID interface, 1734-ADN Adapter and 1734-IB2. when I open the PLC program, the...
Replies
2
Views
1,659
I have a German programed ME program. I want to know what tag in the PLC a latched button turns on. However when I open up the tag properties I...
Replies
14
Views
174
Hi everyone, I have an issue with installation of Studio 5000 33.00.02 DVD Media disc 2 with View Designer on Windows 11. After installation...
Replies
0
Views
68
Back
Top Bottom