abb

package module
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2024 License: MIT Imports: 14 Imported by: 0

README

ABB Robot Web Service API Wrapper

Build and Test Lint Go Reference Go Report Card

Go package for ABB Robot Web Service API

Robot Web Service API Wrapper

ABB Robot Option Requirement

  • 616-1 PC Interface

Installation

go get github.com/atmassey/abb-lib-rws

Examples

There are a few full examples in the examples directory that can be referenced.

Create a backup on the controller
package main

import "github.com/atmassey/abb-lib-rws"

func main() {
	//create a new client
	client := abb.NewClient("localhost", "Default User", "robotics")
	//create a new backup on the robot controller
	err := client.CreateBackup("$TEMP/my_test_directory")
	if err != nil {
		panic(err)
	}
}
Subscribe on the Controller State Websocket
package main

import (
	"fmt"

	"github.com/atmassey/abb-lib-rws"
	)

func main() {
	//create a new client
	client := abb.NewClient("localhost", "Default User", "robotics")
	// subscribe to controller state websocket
	msg, err := client.SubscribeToControllerState()
	if err != nil {
		panic(err)
	}
	for range msg {
		message, ok := <-msg
		if !ok {
			fmt.Print("Channel closed")
			break
		}
		fmt.Printf("Controller State: %v", message["state"])
	}
}

List all the IO signals and their values on the controller
package main

import (
	"fmt"

	"github.com/atmassey/abb-lib-rws"
)

func main() {
	client := abb.NewClient("localhost", "Default User", "robotics")
	signals, err := client.GetIOSignals()
	if err != nil {
		panic(err)
	}
	for i, name := range signals.SignalName {
		fmt.Printf("Name: %s, Type: %s, Value: %v\n", name,
			signals.SignalType[i], signals.SignalValue[i])
	}
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Host     string
	Username string
	Password string
	Client   *http.Client
}

func NewClient

func NewClient(Host string, Username string, Password string) *Client

func (*Client) AcknowledgeOpMode added in v1.0.1

func (c *Client) AcknowledgeOpMode(Mode string) error

AcknowledgeOpMode is used to acknowledge the operation mode change.

func (*Client) AddRouteTableEntry

func (c *Client) AddRouteTableEntry(destination string, gateway string) error

Add Rotue Table Entry will add a route table entry to the controller network stack

func (*Client) AddValidationInfo added in v1.0.1

func (c *Client) AddValidationInfo(validated_by string) error

AddValidationInfo will add validation information to the controller with user who validated the configuration

func (*Client) BStart

func (c *Client) BStart() error

CAUTION: A "bstart" will restart the controller and revert it to its last auto-saved state.

func (*Client) CancelRMMPRequest added in v1.0.1

func (c *Client) CancelRMMPRequest() error

CancelRMMPRequest is used to cancel a RMMP request.

func (*Client) ClearElogMessages added in v1.0.1

func (c *Client) ClearElogMessages() error

ClearElogMessages clears all messages from the Elog system on domain 0.

func (*Client) ClearProfinetAlarms

func (c *Client) ClearProfinetAlarms(Device string, Network string) error

ClearProfinetAlarms clears the alarms for a specific profinet device

func (*Client) ClearSMBData

func (c *Client) ClearSMBData(MechUnit string, type_ string) error

ClearSMBData clears the SMB data for a specific mechunit type_ can be either "robot" or "controller"

func (*Client) CompressionResource

func (c *Client) CompressionResource(srcpath string, dstpath string, comp string) error

CompressionResource will compress or decompress a file a give path comp must be either "comp" for compression or "dcomp" for decompression

func (*Client) CopyDirectory

func (c *Client) CopyDirectory(SourcePath string, DestPath string, Overwrite bool) error

CopyDirestory will make a copy of a directory to a given location.

func (*Client) CreateBackup

func (c *Client) CreateBackup(Dir string) error

CreateBackup creates a backup of the controller to a specified directory. The backup path show include the environment variable along with the directory. Example: /$TEMP/my_backup_directory

func (*Client) CreateDIPCQueue added in v1.0.1

func (c *Client) CreateDIPCQueue(name string, size uint16, max_msg_size uint16) error

CreateDIPCQueue creates a DIPC queue on the controller with the specified name, size, and max message size.

func (*Client) CreateDirectory

func (c *Client) CreateDirectory(Env string, Dir string) error

CreateDirectory will create a directory on the controller. The resource should be the name of the environment variable plus the directory. Example: Env = $TEMP, Dir = my_test_directory

func (*Client) DeleteDirectory

func (c *Client) DeleteDirectory(Path string) error

DeleteDirectory delete a directory on the controller. The directory should be the name of the environment variable plus the directory. Example: $TEMP/my_test_directory

func (*Client) DeleteFile

func (c *Client) DeleteFile(Path string) error

DeleteFile will delete a file on the controller. The file should be the name of the environment variable plus the file. Example: $TEMP/my_test_file.txt

func (*Client) DigestAuthenticate

func (c *Client) DigestAuthenticate() *http.Client

DigestAuthenticate returns a new http.Client with digest authentication

func (*Client) FactoryDefaultSafetyController

func (c *Client) FactoryDefaultSafetyController() error

RestoreSafetyController will reset the safety controller Be careful with this function as it will reset the safety controller to its factory default state

func (*Client) FlashCameraLEDs added in v1.0.2

func (c *Client) FlashCameraLEDs(Name string) error

FlashCameraLEDs flashes the LEDs on the camera with the given name.

func (*Client) GetCameraStatus added in v1.0.2

func (c *Client) GetCameraStatus(Cameraname string) (status map[string]string, err error)

GetCameraStatus gets the status of the camera with the given name.

func (*Client) GetControllerActions

func (c *Client) GetControllerActions() (*structures.ControllerActions, error)

GetControllerActions returns the actions that can be performed on the controller

func (*Client) GetControllerResources

func (c *Client) GetControllerResources() (*structures.ControllerResources, error)

GetControllerResources returns a struct of the XML response for capturing the controllers resources.

func (*Client) GetErrorState

func (c *Client) GetErrorState() (*structures.MotionErrorState, error)

Returns the error state of the motion system

func (*Client) GetFile

func (c *Client) GetFile(Source string, Filename string) error

GetFile will get a file from the controller and save it with the specified filename. Example: Source = $TEMP/my_test_file.txt, Filename = my_test_file.txt

func (*Client) GetFileSize

func (c *Client) GetFileSize(Path string) (string, error)

GetFileSize will return the file size at a given filepath. Example: Path = $TEMP/my_test_file.txt -> 1024

func (*Client) GetHost

func (c *Client) GetHost() string

func (*Client) GetIOSignals

func (c *Client) GetIOSignals() (*structures.IOSignals, error)

GetIOSignals returns a struct of all IO signals on the robot with their names and values.

func (*Client) GetInstalledProducts

func (c *Client) GetInstalledProducts() (*structures.InstalledSystemProducts, error)

GetInstalledProducts returns a struct of installed products on the controller. The struct includes the product title and version.

func (*Client) GetMechUnits

func (c *Client) GetMechUnits() (*structures.MechUnits, error)

GetMechUnits returns a list of all the mechunits on the robot controller

func (*Client) GetOperationMode

func (c *Client) GetOperationMode() (string, error)

GetOperationMode returns the current operation mode of the controller. Possible values: (INIT | AUTO_CH | MANF_CH | MANR | MANF | AUTO | UNDEF)

func (*Client) GetPassword

func (c *Client) GetPassword() string

func (*Client) GetRobotType

func (c *Client) GetRobotType() (*structures.RobotType, error)

GetRobotType returns a struct of the robot type.

func (*Client) GetSystemEnergyMetrics

func (c *Client) GetSystemEnergyMetrics() (*structures.SystemEnergyMetrics, error)

GetSystemEnergyMetrics returns a struct of energy metrics for each axis on the controller. The struct includes the axis title and the energy consumption for the axis. The struct also includes the total accumulated energy consumption.

func (*Client) GetUsername

func (c *Client) GetUsername() string

func (*Client) GetUsers

func (c *Client) GetUsers() (*structures.UserResources, error)

GetUsers gets a list of users from the controller

func (*Client) IStart

func (c *Client) IStart() error

CAUTION: A "istart" will restart the controller and factory reset the controller.

func (*Client) KeylessMotorOn added in v1.0.1

func (c *Client) KeylessMotorOn() error

KeylessMotorOn is used to turn on the motors without utilizing the key.

func (*Client) LockOpMode added in v1.0.1

func (c *Client) LockOpMode(Pin int16, Permanent bool) error

LockOpMode is used to lock the operation mode selection.

func (*Client) LoginAsLocalUser

func (c *Client) LoginAsLocalUser(Type_ string) error

LoginAsLocalUser A client is normally logged in as a remote client. To login as local client it needs access to an enabling device. To successfully login as local user, the client should make the request and within 5 seconds press and release the enabling button. Accepted types are local or remote.

func (*Client) Logout added in v1.0.1

func (c *Client) Logout() error

Logs out the user and removes the associated session by clearing the session cookie

func (*Client) PStart

func (c *Client) PStart() error

CAUTION: A "pstart" will restart the controller and delete all rapid programs but keep all configuration data.

func (*Client) RefreshCameras added in v1.0.2

func (c *Client) RefreshCameras() error

RefreshCameras refreshes the cameras on the robot.

func (*Client) RegisterUser added in v1.0.1

func (c *Client) RegisterUser(Username string, Application string, Location string, Locale bool) error

RegisterUser is used to register a user. If locale is true, the user is registered as a local user. If locale is false, the user is registered as a remote user. The user is registered with the username, application and location specified in the request.

func (*Client) ReleaseMastershipAll added in v1.0.1

func (C *Client) ReleaseMastershipAll() error

ReleaseMastership releases mastership of all domains on the controller. ie. CFG, Motion, RAPID, etc.

func (*Client) ReleaseMastershipIndividual added in v1.0.1

func (C *Client) ReleaseMastershipIndividual(domain string) error

ReleaseMastershipIndividual releases mastership of a specific domain on the controller. ie. CFG, Motion, RAPID, etc.

func (*Client) RemoteUserLogOutRequest

func (c *Client) RemoteUserLogOutRequest() error

RemoteUserLogOutRequest is used to request a remote user log out.

func (*Client) RemoteUserLogonRequest

func (c *Client) RemoteUserLogonRequest() error

RemoteUserLogonRequest is used to request a remote user logon.

func (*Client) RemoveRouteTableEntry

func (c *Client) RemoveRouteTableEntry(destination string) error

RemoveRoutTableEntry will remove a route table entry from the controller network stack

func (*Client) RemoveValidationInfo added in v1.0.1

func (c *Client) RemoveValidationInfo() error

RemoveValidationInfo will remove the validation information from the controller.

func (*Client) RenameDirectory

func (c *Client) RenameDirectory(OldPath string, NewName string) error

RenameDirectory will rename a directory at the given path. Example OldPath: $TEMP/test_dir Example NewName: new_dir

func (*Client) RenameFile

func (c *Client) RenameFile(NewName string, Path string) error

RenameFile will rename a file at the given path. Example NewName: new_file.txt, Path: $TEMP/old_file.txt

func (*Client) RenameSystem added in v1.0.1

func (c *Client) RenameSystem(old_name string, new_name string) error

func (*Client) RequestMastershipAll added in v1.0.1

func (c *Client) RequestMastershipAll() error

RequestMastership requests mastership of all domains on the controller. ie. CFG, Motion, RAPID, etc.

func (*Client) RequestMastershipIndividual added in v1.0.1

func (c *Client) RequestMastershipIndividual(domain string) error

RequestMastershipIndividual requests mastership of a specific domain on the controller. ie. CFG, Motion, RAPID, etc.

func (*Client) RequestRMMP

func (c *Client) RequestRMMP(Action string) error

Request RMMP is used to request manual mode priveleges. Accepted actions are modify or exec.

func (*Client) ResetAccumulatedEnergy added in v1.0.1

func (c *Client) ResetAccumulatedEnergy() error

ResetAccumulatedEnergy resets the accumulated energy consumption on the controller.

func (*Client) RestartCamera added in v1.0.2

func (c *Client) RestartCamera(Name string) error

RestartCamera restarts the camera with the given name.

func (*Client) RestartController

func (c *Client) RestartController(Action string) error

RestartController is used to restart the controller with the specified action. Possible values: {restart | istart | pstart | bstart}

func (*Client) RestoreBackup

func (c *Client) RestoreBackup(Dir string) error

RestoreBackup restores a backup from a specified directory. The backup path show include the environment variable along with the directory. This does require a UAS grant. Example: /$SYSPAR/my_backup_directory

func (*Client) SaveElogSystemDump

func (c *Client) SaveElogSystemDump(Path string) error

SaveElogSystemDump dumps log file to the specified path on the controller. Example path: $HOME/my_dump_file.txt

func (*Client) SetAxisPose added in v1.0.2

func (c *Client) SetAxisPose(Mechunit string, Axisnum int, Positions structures.AxisPositon) error

SetAxisPose sets the axis pose for a specific mechanical unit

func (*Client) SetBootDevice added in v1.0.1

func (c *Client) SetBootDevice(path string) error

SetBootDevice will set the boot device of the controller

func (*Client) SetCameraDHCP added in v1.0.2

func (c *Client) SetCameraDHCP(CameraName string) error

SetCameraDCHP sets camera to dhcp mode

func (*Client) SetCameraDNS added in v1.0.2

func (c *Client) SetCameraDNS(CameraName string, Suffix string, Server string) error

SetCameraDNS sets the cameras DNS settings

func (*Client) SetCameraIP added in v1.0.2

func (c *Client) SetCameraIP(CameraName string, IP string, Subnet string, Gateway string) error

SetCameraIP sets the IP settings for the camera Restart the controller after setting the IP settings

func (*Client) SetCameraName added in v1.0.2

func (c *Client) SetCameraName(Index int, NewName string) error

SetCameraName sets the name of the camera with the given index.

func (*Client) SetCameraState added in v1.0.2

func (c *Client) SetCameraState(Name string, State bool) error

SetCameraState sets the state of the camera to either run or standby. Set state to true for run and false for standby.

func (*Client) SetCameraUserCredentials added in v1.0.2

func (c *Client) SetCameraUserCredentials(CameraName string, Username string, Password string) error

SetUserCredentials sets the user credentials for the camera Restart the controller after setting the credentials

func (*Client) SetClock

func (c *Client) SetClock(Time structures.Clock) error

func (*Client) SetComplianceLeadThrough added in v1.0.2

func (c *Client) SetComplianceLeadThrough(Mechunit string, Status bool) error

SetComplianceLeadThrough sets the compliance lead through for a specific mechanical unit Set Status to true to enable compliance lead through, false to disable

func (*Client) SetControllerLanguage

func (c *Client) SetControllerLanguage(language string) error

SetControllerLanguage sets the language of the controller language can be either "en", "zh", etc. refer to RFC 3066

func (*Client) SetControllerNetworkConfiguration

func (c *Client) SetControllerNetworkConfiguration(Method string, Address string, Mask string, Gateway string) error

SetControllerNetworkConfiguration sets the network configuration of the controller Method can be either "fixip", "dhcp", or "noip"

func (*Client) SetControllerState added in v1.0.1

func (c *Client) SetControllerState(MotorOn bool) error

SetControllerState will set the controller state to either motoron or motoroff

func (*Client) SetFineCalibration added in v1.0.2

func (c *Client) SetFineCalibration(Mechunit string, AxisValue int) error

SetFineCalibration sets the fine calibration for a specific mechanical unit

func (*Client) SetHost

func (c *Client) SetHost(Host string)

func (*Client) SetIdentity

func (c *Client) SetIdentity(ControllerName string, ControllerId string) error

SetIdentity sets the controller name and id

func (*Client) SetModifyAllPostions added in v1.0.2

func (c *Client) SetModifyAllPostions(CheckLimit bool, CheckDeactAxes bool) error

Modify position for all syncrhonized targets

func (*Client) SetMotionSupervisionMode

func (c *Client) SetMotionSupervisionMode(MechanicalUnit string, Mode bool) error

SetMotionSupervisionMode sets the motion supervision mode for a specific mechanical unit

func (*Client) SetMotionSupervisionSensitivity

func (c *Client) SetMotionSupervisionSensitivity(MechanicalUnit string, Sensitivity string) error

SetMotionSupervisionSensitivity sets the motion supervision sensitivity for a specific mechanical unit

func (*Client) SetNonMotionExecutionMode added in v1.0.2

func (c *Client) SetNonMotionExecutionMode(Mode string) error

SetNonMotionExecutionMode sets the non-motion execution mode

func (*Client) SetPassword

func (c *Client) SetPassword(Password string)

func (*Client) SetPathSupervisionLevel

func (c *Client) SetPathSupervisionLevel(Level string, MechUnit string) error

SetPathSupervisionLevel sets the path supervision level for a specific mechanical unit

func (*Client) SetPathSupervisionMode

func (c *Client) SetPathSupervisionMode(Mode bool, MechUnit string) error

SetPathSupervisionMode sets the path supervision mode for a specific mechanical unit

func (*Client) SetSafetyMode added in v1.0.1

func (c *Client) SetSafetyMode(mode string) error

SetSafetyMode will set the safety mode of the controller. mode can be either "active", "service", or "commissioning"

func (*Client) SetSpeedRatio added in v1.0.1

func (c *Client) SetSpeedRatio(SpeedRatio int8) error

SetSpeedRatio is used to set the speed ratio of the controller. The value should be between 0 and 100.

func (*Client) SetTimeServer added in v1.0.1

func (c *Client) SetTimeServer(server string) error

SetTimeServer will set the time server of the controller

func (*Client) SetUsername

func (c *Client) SetUsername(Username string)

func (*Client) SetVTSpeed added in v1.0.1

func (c *Client) SetVTSpeed(speed int) error

SetVTSpeed will set the virtual time speed of the controller

func (*Client) SoftwareSyncAcknowledgement added in v1.0.1

func (c *Client) SoftwareSyncAcknowledgement(index int) error

SoftwareSyncAcknowledgement will acknowledge a software safety sync request

func (*Client) SubscribeToControllerState

func (c *Client) SubscribeToControllerState() (chan map[string]string, error)

SubscribeToControllerState is subscribed to the controller state websocket that will send an update anytime the controller state changes. The map key returned is mapString["state"]. Possible states are {init | motoron | motoroff | guardstop | emergencystop | emergencystopreset | sysfail}

func (*Client) SubscribeToElog

func (c *Client) SubscribeToElog() (chan map[string]string, error)

SubscribeToElog subscribes to the Elog websocket for all events happening at the robot. This function returns a map of strings. The keys within the map are as follows "msgtype", "code", "tstamp", "title", "desc", "conseqs", "causes", "actions", "argc", "arg1", and "arg2".

func (*Client) SubscribeToIOSignal

func (c *Client) SubscribeToIOSignal(Signal string) (chan map[string]string, error)

SubscribeToIOSignal is used to subscribe to an IO signal and returns a channel with the signal value and simulation state. Example signal: LOCAL/PANEL/MAN1 for manual mode

func (*Client) SubscribeToOperationMode

func (c *Client) SubscribeToOperationMode() (chan map[string]string, error)

SubscribeToOperationMode is subscribed to the operation mode websocket that will send an update anytime the operation mode changes. The map key returned is mapString["mode"]. Possible states are {INIT | AUTO_CH | MANF_CH | MANR | MANF | AUTO | UNDEF}

func (*Client) UnblockSignals added in v1.0.1

func (c *Client) UnblockSignals() error

UnblockSignals will remove simulation for all simulated logical I/O signals.

func (*Client) UnlockOpMode added in v1.0.1

func (c *Client) UnlockOpMode(Pin int16) error

UnlockOpMode is used to unlock the operation mode selection.

func (*Client) UnlockSafetyController

func (c *Client) UnlockSafetyController() error

UnlockSafetyController will unlock the safety controller if the proper user is logged in and authenticated.

func (*Client) UpdateCommutate added in v1.0.2

func (c *Client) UpdateCommutate(Mechunit string, Axis string) error

UpdateCommutate will update the commutate for a specific mechanical unit and axis

func (*Client) UpdateIODevice

func (c *Client) UpdateIODevice(State string, DevicePath string) error

UpdateIODevice is used to enable or disable an IO device. Possible values: {enable | disable} Possible Device path example: Local/DRV_1

func (*Client) UpdateSyncRevCounter added in v1.0.2

func (c *Client) UpdateSyncRevCounter(Mechunit string, Axis string) error

SetSyncRevCounter will update the sync rev counter for a specific mechanical unit and axis

func (*Client) UploadFile

func (c *Client) UploadFile(SourcePath string, DestPath string) error

UploadFile wil upload a file to the controller. The source path should be the path to the file on the local machine. The destination path should be the name of the environment variable plus the file. Example: Source = /home/user/my_test_file.txt, Dest = $TEMP

func (*Client) Warmstart

func (c *Client) Warmstart() error

CAUTION: A warmstart will restart the controller and all running programs will be stopped. (Warmstart)

type RestartController

type RestartController interface {
	Warmstart() error
	IStart() error
	PStart() error
	BStart() error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL