Forum Migration Notice
We're transitioning to a more modern community platform by beginning of next year. Learn about the upcoming changes and what to expect.
Write number in Group Output in ieee-754 format ?
I need to write some parameter in a Group Output of 32 bits in the ieee-754 format. Example to write the value 15 i need to write the num 1097859072.
Any help will be appreciated.
Thanks
0
Comments
-
Hi,
you can use the instructions PackRawbyte and UnpackRawbyte to convert your value into ieee-754 format or use use the attached function.
Example:
Tpwrite "15 = "\Dnum:=FloatToUInt32(15);FUNC dnum FloatToUInt32(num Value)
VAR rawbytes raw_data;
VAR dnum dnResult;
PackRawBytes Value,raw_data,1\Float4;
UnpackRawBytes raw_data,1,dnResult\IntX:=UDINT;
RETURN dnResult;
endfunc
Regards
Micky
1
Categories
- All Categories
- 5.7K RobotStudio
- 401 UpFeed
- 21 Tutorials
- 16 RobotApps
- 306 PowerPacs
- 407 RobotStudio S4
- 1.8K Developer Tools
- 251 ScreenMaker
- 2.9K Robot Controller
- 366 IRC5
- 90 OmniCore
- 8 RCS (Realistic Controller Simulation)
- 857 RAPID Programming
- 43 AppStudio
- 4 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 111 Collaborative Robots
- 5 Job listings
