encoding/decoding Reals in Logix

Join Date
Jul 2015
Location
New York
Posts
1
Hi, I'm using Studio 5000 PE V24. I would like to encode a Real Float so that it my be transmitted serially and stored to an RFID tag occupying only 4 bytes. I know Logix uses IEE format so technically I should be able to convert the binary value to 4 ASCII characters. It would then need to be decoded to be read properly from the RFID tag. I don't see that there is any easy way to do this in Logix via STL.
Thank you for your time and consideration. :site:
 
Yup; the key is that the COP and CPS instructions act on the data in a raw "bitwise" fashion and don't try to interpret or convert it in any way.

Your results will be a bit array, and by default you'll be looking at them as though they were a signed 32-bit integer (a DINT).

You can choose to look at them as ASCII characters, or in Hex, or Binary, but they won't make any sense until they're copied back into a 32-bit IEEE Single-Precision Floating Point datatype.
 

Similar Topics

Hello, I was wondering if anyone has a ControlLogix block or routine for encoding and decoding base64. I figured I would ask before diving into...
Replies
1
Views
257
Gentlemen (includes ladies); I am looking for some help on my latest project. I want to use an encoder to get position and then use the PLS...
Replies
1
Views
2,053
Hello All, I hope we are all doing great and have a healthy and happy 2023!! I was wondering if anyone could help me decode this Motor Name...
Replies
15
Views
5,295
I have a Red Lion G315C That I am feeding Ascii String data from a Weight Scale. String is:<sp>G{GWT}<sp>{UN}<CR><LF>{EOS} <sp> = Space, decimal...
Replies
2
Views
4,393
I've been helping out a contractor friend who has picked up several customers who use Direct Logic PLC's talking over spread spectrum radio via...
Replies
0
Views
2,042
Back
Top Bottom