PC SDK Reading Writing Group Inputs Outputs
DavidLanham
✭✭✭
I am using PC SDK 2022 to read and write group outputs to controller.
Group Output goOutput size = 32 bit
Group Input giInput size =32 bit
When Using objController.IOSystem.GetSignal("giInput") it reads the value correctly until the value gets large enough that bit 30 of 32 would be on and then the value read is in Exponential format instead of the actual value. Does anyone know why it's doing this and if there is something in C# VS 2022 Pro that I need to change to make it still be in Int format.
So I have worked with this and figured out some more information. First, what I stated above is correct, it does change the value to Exponential when the bit 30 comes on, but the value is still correct. Here is the code I use to read the value:
It is when bit 32 comes on that the ObjController.IOSystem.GetSignal then returns a negative Exponential value that is incorrect. So it seems that the function has a problem with negative values? I need to be able to send positive and negative values between my application and the controller. Is this a bug with the function or am I doing something wrong?
Group Output goOutput size = 32 bit
Group Input giInput size =32 bit
When Using objController.IOSystem.GetSignal("giInput") it reads the value correctly until the value gets large enough that bit 30 of 32 would be on and then the value read is in Exponential format instead of the actual value. Does anyone know why it's doing this and if there is something in C# VS 2022 Pro that I need to change to make it still be in Int format.
So I have worked with this and figured out some more information. First, what I stated above is correct, it does change the value to Exponential when the bit 30 comes on, but the value is still correct. Here is the code I use to read the value:
GroupInput = objController.IOSystem.GetSignal("giInput");
GroupSignal giSig = (GroupSignal)GroupInput;
decimal x = decimal.Parse(giSig.Value.ToString(), NumberStyles.Number | NumberStyles.AllowExponent); It is when bit 32 comes on that the ObjController.IOSystem.GetSignal then returns a negative Exponential value that is incorrect. So it seems that the function has a problem with negative values? I need to be able to send positive and negative values between my application and the controller. Is this a bug with the function or am I doing something wrong?
�
Post edited by DavidLanham on
Tagged:
0
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)
- 798 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings