Está en la página 1de 6

TANGO Device Server

Allen Bradley PLC connector Users Guide AllenBradleyPLC Class


Revision: - Author: piotrgoryl Implemented in C++

Introduction:
This class provides access to Rockwell Automations PLCs. It gives two ways of reading and setting values of tags. 1) by commands 2) by dynamic attributes (see Tags device property) Note! It depends on Tuxeip library.

Class Inheritance:
Tango::Device_4Impl AllenBradleyPLC

Properties:
Device Properties
Property name IP PlcType ConnectionID ConnectionSN RPI Path AutoConnect Property type
Tango::DEV_STRING Tango::DEV_STRING Tango::DEV_ULONG Tango::DEV_USHORT Tango::DEV_LONG Array of short Tango::DEV_BOOLEAN PLC IP number PLC type ID of the connection - for own use Connection Serial Number - should be unique in the network Request packet interval - used to calculate time-out Path to the device. See Tuxeip documentation. State if a device should try to reconnect to PLC if there is no connection, for an example in case of previous error... Min interval (in milliseconds) between update of taga value. List of tags in PLC. This list is used during device initiation to create attribs. It contains of lines of comma separated values: tagName,tagType,[attribName] tagName - is the name of tag in PLC, could contain array(structure) element selector in square bracket tagType - type of tag in PLC, should contain square bracket with size to determine array attribName - optionally attrib name to be mapped to tag attribName is required in case of tag pointing to element of structures or arrays in PLC

Description

TagUpdateInterval Tango::DEV_ULONG

Tags

Array of string

Device Properties Default Values:


Property Name IP PlcType ConnectionID ConnectionSN RPI Path AutoConnect TagUpdateInterval Tags Default Values 0.0.0.0 LGX 1111 1234 3000 No default value true 1.0 No default value

There is no Class properties.

States:
States
Names OPEN CLOSE
The device instance is connected to PLC The device instance is not connected to PLC

Descriptions

Commands:
More Details on commands....

Device Commands for Operator Level


Command name Init State Status Close Open WriteTagsAsDouble ReadTagsAsDouble ReadTag WriteTag
DEV_VOID DEV_VOID DEV_VOID DEV_VOID DEV_VOID DEVVAR_DOUBLESTRINGARRAY DEVVAR_STRINGARRAY DEV_STRING DEVVAR_STRINGARRAY

Argument In
DEV_VOID

Argument Out
DEV_STATE CONST_DEV_STRING DEV_VOID DEV_BOOLEAN DEVVAR_DOUBLESTRINGARRAY DEVVAR_DOUBLESTRINGARRAY DEV_STRING DEV_STRING

1 - Init
Description: This commands re-initialise a device keeping the same network connection. After an Init command executed on a device, it is not necessary for client to re-connect to the device. This command first calls the device delete_device() method and then execute its init_device() method. For C++ device server, all the memory allocated in the nit_device() method must be freed in the delete_device() method. The language device desctructor automatically calls the delete_device() method.

Argin: DEV_VOID : none. Argout: DEV_VOID : none. Command allowed for: Tango::OPEN Tango::CLOSE

2 - State
Description: This command gets the device state (stored in its device_state data member) and returns it to the caller. Argin: DEV_VOID : none. Argout: DEV_STATE : State Code Command allowed for: Tango::OPEN Tango::CLOSE

3 - Status
Description: This command gets the device status (stored in its device_status data member) and returns it to the caller. Argin: DEV_VOID : none. Argout: CONST_DEV_STRING : Status description Command allowed for: Tango::OPEN Tango::CLOSE

4 - Close
Description: Close connection to PLC Argin: DEV_VOID : Argout: DEV_VOID : Command allowed for: Tango::OPEN

5 - Open
Description: Open connection to PLC defined by properties Argin: DEV_VOID : Argout: DEV_BOOLEAN : If opening was successful Command allowed for: Tango::OPEN Tango::CLOSE

6 - WriteTagsAsDouble
Description: Writes tags, examining first types (by reading) in PLC and then doing proper conversion. Argin: DEVVAR_DOUBLESTRINGARRAY : Tag names and values. First strings are tags names, second values Argout: DEVVAR_DOUBLESTRINGARRAY : Tags old values with its type in PLC Command allowed for: Tango::OPEN

7 - ReadTagsAsDouble
Description: Reads the tags values from PLC and returns values and type Argin: DEVVAR_STRINGARRAY : Tags names Argout: DEVVAR_DOUBLESTRINGARRAY : Tags original type and values Command allowed for: Tango::OPEN

8 - ReadTag
Description: Read tag value and return it as a string. Argin: DEV_STRING : Tag name Argout: DEV_STRING : Tag value as string Command allowed for: Tango::OPEN

9 - WriteTag
Description: Write tag value specified by string. Argin: DEVVAR_STRINGARRAY : Tags name and its value Argout: DEV_STRING : Old value Command allowed for: Tango::OPEN

TANGO is an open source project hosted by :

Core and Tools : CVS repository on tango-cs project Device Servers : CVS repository on tango-ds project

También podría gustarte