SmartComponent - Properties don't update
Henry123
✭
Hi
I'm just wondering, why the Digital IOs in the property window of my SmartComponent don't update according to the signal state.
I can see in the LogWindow of RobotStudio, that the signal "lifePulse" changes its value from 0-->1 / 1-->0 every 5 seconds as it is intended. The Method "OnIOSignalValueChanged" seems to work correct since it is triggering the LogWindow every time when the signal toggles. Nevertheless, the property Windows shows the Signal just on "1" or on "0", no changes.
Any suggestions?
-----Forum.xml-----
------Codebehind.cs-----
I can see in the LogWindow of RobotStudio, that the signal "lifePulse" changes its value from 0-->1 / 1-->0 every 5 seconds as it is intended. The Method "OnIOSignalValueChanged" seems to work correct since it is triggering the LogWindow every time when the signal toggles. Nevertheless, the property Windows shows the Signal just on "1" or on "0", no changes.
Any suggestions?
-----Forum.xml-----
<?xml version="1.0" encoding="utf-8" ?>
<lc:LibraryCompiler xmlns:lc="urn:abb-robotics-robotstudio-librarycompiler"
xmlns="urn:abb-robotics-robotstudio-graphiccomponent"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:abb-robotics-robotstudio-librarycompiler file:///C:\Program%20Files%20(x86)\ABB\SDK\RobotStudio%202023%20SDK\LibraryCompilerSchema.xsd
urn:abb-robotics-robotstudio-graphiccomponent file:///C:\Program%20Files%20(x86)\ABB\SDK\RobotStudio%202023%20SDK\GraphicComponentSchema.xsd">
<lc:Library fileName="Forum.rslib">
<lc:DocumentProperties>
<lc:Author>DEU216531</lc:Author>
<lc:Image source="Forum.png"/>
</lc:DocumentProperties>
<SmartComponent name="Forum" icon="Forum.png"
codeBehind="Forum.CodeBehind,Forum.dll"
canBeSimulated="true">
<Properties>
</Properties>
<Bindings>
</Bindings>
<Signals>
<IOSignal name="lifePulse" signalType="DigitalInput" value="0" uiVisible="true" />
</Signals>
<Connections>
</Connections>
<GraphicComponents>
</GraphicComponents>
<Assets>
<Asset source="Forum.dll"/>
</Assets>
</SmartComponent>
</lc:Library>
</lc:LibraryCompiler>
------Codebehind.cs-----
using ABB.Robotics.Math;
using ABB.Robotics.RobotStudio;
using ABB.Robotics.RobotStudio.Stations;
using System;
using System.Threading.Tasks;
namespace Forum
{
public class CodeBehind : SmartComponentCodeBehind
{
public bool simulationRun = false;
public override async void OnLoad(SmartComponent component)
{
await Task.Run(() => Life(component));
}
public override void OnIOSignalValueChanged(SmartComponent component, IOSignal changedSignal)
{
Logger.AddMessage(new LogMessage(component.IOSignals["lifePulse"].Value.ToString()));
}
private async Task Life(SmartComponent component)
{
while (simulationRun == false)
{
if (component.IOSignals["lifePulse"].Value.ToString() == "1") component.IOSignals["lifePulse"].Value = false;
else component.IOSignals["lifePulse"].Value = true;
await Task.Delay(5000);
}
}
}
}
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