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.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 316 IRC5
- 61 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 801 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings