Real Values in Rapid
Hope the best of all!
is it possible to set real values as a global variable in IRC5 Rapid language like (speed/position) of an AC Servo and control the servo from IRC5 pendant.
I mean digital signals can be defined and can be used to map the PLC IO bits that makes servo on/off (servo is controlled using Siemens PLC), but to control the speed and position of ac servo from IRC5 pendant. can we define global variables to enter the values in pendant (rapid program) the motion speed and position.
any hint pleaseee
0
Answers
-
Map group outputs to the PLC for position and speed.Lee Justice0
-
Yes, single bit signals can be made for on/off (0/1), but you can also make group and analog input signals for larger numeric values.
0 -
All,
Please:
Regarding the size of this GI, can it to be 32 bit? I mean, if I am using form the PLC side SINT, should I use 4x SINT for 32 bit in the EOI? My doubt is with what IRC5 (my case is with an Omnicore E10) will see trough the EOI to be able to read REAL values (32 bit) sent out from the PLC.0 -
Hi !
Do I understand correctly, that you would like to use 32-bit IEEE-754 floating point on PLC side and decimal numeric in ABB side?
You can not use them directly as bitwise those are different datatypes. But you can write own functions to convert between them.!##########################################! Convert group 32 bits to float32 value! Tested using: https://www.h-schmidt.net/FloatConverter/IEEE754.htmlFUNC num Float32ToNum_Ext(dnum Bits, INOUT bool IsNaN, INOUT bool IsNegInfinity, INOUT bool IsPosInfinity)VAR rawbytes rawData;VAR num result;...
do NaN and Infinity testing here
...! pack 4 bytes into raw data without change in formatPackRawBytes Bits, rawData, (RawBytesLen(rawData) + 1) \IntX := 4;! read out 4 bytes using float format conversionUnpackRawBytes rawData, 1, result, \Float4;RETURN result;...
do error handling here
...ENDFUNC!##########################################! Encode decimal number to 32 bits IEEE754 floating point format! Tested using: https://www.h-schmidt.net/FloatConverter/IEEE754.htmlFUNC dnum NumToFloat32(num Decimal, \switch SetNaN, \switch SetNegInfinity \switch SetPosInfinity)VAR dnum result;VAR rawbytes rawData;...
do NaN and Infinity encoding here
...! pack decimal into raw data using 4-byte Float format conversionPackRawBytes Decimal, rawData,(RawBytesLen(rawData) + 1) \Float4;! and read 4 bytes of packed data out again into DNum without changing formatUnpackRawBytes rawData, 1, result, \IntX := 4;RETURN result;...
do error handling here
...ENDFUNC
Have fun!
Fritz.0 -
Hi Fritz,
Very clear...
appreciated!...I will try!0
Categories
- All Categories
- 5.5K RobotStudio
- 397 UpFeed
- 18 Tutorials
- 13 RobotApps
- 299 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 319 IRC5
- 63 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 804 RAPID Programming
- 4 AppStudio
- 3 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings