RobotStudio event

Trouble writing to Analog Value

Every time I run this code I get an exception 'ABB.Robotics.ModeRejectExecption'.


Friend Function WriteAnalogOutput( sigName as String, sigValue as Double ) as Boolean
Dim aSignal as Signal
Dim signalValue as AnalogSignal
Dim returnValue as Boolean
Try
If _robotController.Connected And _robotController.OperatingMode = ControllerOperatingMode.Auto Then
returnValue =
True
aSignal = _robotController.IOSystem.GetSignal( sigName )
signalValue =
DirectCast( aSignal, AnalogSignal )
signalValue.Value = sigValue
Else
returnValue =
False
End If
Catch ex as Exception
returnValue =
False
Finally
If signalValue IsNot Nothing Then
signalValue.Dispose()
End If
End Try
WriteAnalogOutput = returnValue
End Function

Why does this happen?

Jake

Comments

  • In RSO>Configuration, look at the access level that your signal is configued with. If it has the access level "DEFAULT" you can only write to it in Manual Mode. You can create your own access level that has different permissions and assign the signals you want to modify to use that access level. Note that this is generally preferable to changing DEFAULT because by changing DEFAULT, you will increase the access to every signal this way, instead of the only the ones you care about. This may make your robot less safe.

    Russell Drown
  • That worked, thanks.  It's for changing motor speed.

    (Btw, RSO is a crutch.  Real men use the TP.)

    Jake