I/O Unit state
David L
✭
Hi <?: prefix = o ns = "urn:schemas-microsoft-com:office:office" />
I have created a graphical view of some slaves in a flexpendant appl. I want to show the current state of each slave in this window, but I can?_Tt figure out how to read the state of the units.
So my question is:
Is there's a way to read the state of an I/O unit (Running,Deactivated,Stoped)?
0
Comments
-
Hi David,
I dont know if RAB have built-in function for monitoring I/O device status but i think u can do it like that :
If your robot have "multitasking" option you can use "IOUnitState" instruction in a semistatic task.
PERS num nUnit1State;
PERS num nUnit2State;
WHILE TRUE DO
nUnit1State:=IOUnitState ("UNIT1");
nUnit2State:=IOUnitState ("UNIT2");
WaitTime 0.3;
ENDWHILE
According to manual "IOUnitState" instruction have return values between 1 to 4
(1=unit running, 2=runtime error, 3= disable, 4=other cfg. error)
By using this numeric values with "data binding" you can observe situation of cards with RAB.
charon2009-12-08 14:05:01Erdem Karaçeper0 -
FlexPendant SDK does not a have an API for working with units and buses.For anyone interested in doing it with PC SDK you can dolike this:[CODE]
Controller c = new Controller(...);
Unit unit = c.IOSystem.GetUnit("MyUnit");
unit.StateChanged += new EventHandler<UnitStateChangedEventArgs>(unit_StateChanged);
void unit_StateChanged(object sender, UnitStateChangedEventArgs e)
{
IOUnitPhysState state = e.NewUnitState.PhysicalState;
/// Do stuff with the state information...}[/CODE]Unfortunately the e.NewUnitState.PhysicalState returns a type that belongs to an internal namespace. So you must addusing ABB.Robotics.Internal;Formally that means that this code is not supported as internal types can change without notice between releases of the API.The fact that the type is located in the internal namespace is most likely a a bug and and will be corrected.Try at your own risk until then.Niklas Skoglund2010-01-14 10:51:560
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 310 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 785 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings