EventTableTriggerIO and EventTableActionIO do not work for Smart Component IO

KennyJiang
mod
in RobotStudio
Hi,
I tried to use EventTableTriggerIO and EventTableActionIO for IOs of a smart component in a code behind way. However, they do not work if I set 'controller' property to the smart component.
It works if the trigger and action signals are set to be station signals, but not for smart component signals.
Is there anything wrong in my coding? Or is it a bug?
I tried to use EventTableTriggerIO and EventTableActionIO for IOs of a smart component in a code behind way. However, they do not work if I set 'controller' property to the smart component.
public void AddEventTable(SmartComponent component)
{
Project.UndoContext.BeginUndoStep("EventTable");
try
{
//define event table trigger IO
EventTableTriggerIO etTriggerDi1 = new EventTableTriggerIO();
etTriggerDi1.Controller = component;
etTriggerDi1.Name = "di1";
etTriggerDi1.Value = 1;
//define event table action IO
EventTableActionIO etActionDo1 = new EventTableActionIO();
etActionDo1.Controller = component;
etActionDo1.Name = "do1";
etActionDo1.Value = 1;
//define event table entry
EventTableEntry etEntryDly = new EventTableEntry();
etEntryDly.EventTableTrigger = etTriggerDi1;
etEntryDly.EventTableActions.Add(etActionDo1);
etEntryDly.EventActivationMode = EventActivationMode.Simulation;
EventTableEntryCollection etec = Simulator.ActiveConfiguration.EventTable.EventTableEntries;
etec.Add(etEntryDly);
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
}
It works if the trigger and action signals are set to be station signals, but not for smart component signals.
Is there anything wrong in my coding? Or is it a bug?
0
Categories
- All Categories
- 5.6K RobotStudio
- 401 UpFeed
- 21 Tutorials
- 15 RobotApps
- 303 PowerPacs
- 407 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 353 IRC5
- 74 OmniCore
- 8 RCS (Realistic Controller Simulation)
- 850 RAPID Programming
- 25 AppStudio
- 4 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 110 Collaborative Robots
- 5 Job listings