Class Parameter

  • All Implemented Interfaces:
    DataContext, AttributeHolder, DataWrapper, java.lang.Comparable<CipInstance>

    public class Parameter
    extends CipInstance
    implements DataWrapper
    Implementation of Stub Parameter Instances.

    Although the CIP Spec doesn't come out and say it, the definition of attribute #5 as a single USINT indicates that Parameter objects can only represent single instances of a base data type. No arrays or structures are allowed.

    This is also required by the structure of the scaling, limits, and indirection attributes that provide the information needed by a configuration tool to present an appropriate user interface.

    This implementation does not enforce this. A complex or array data element may be exposed here, but a caller will receive the complete formal data type in attribute #5, not just a byte.

    • Constructor Detail

      • Parameter

        protected Parameter​(ParamMgr parent,
                            int descriptor,
                            java.lang.String name,
                            byte aType)
        Subclasses may pass any desired descriptor bits, and are responsible for creating the value attribute, and any non-stub parameter attributes. They must also set the attr and linkPath fields appropriately.
        Parameters:
        parent - The parameter manager class object.
        descriptor - The feature descriptor for this parameter. No restrictions.
        name - The display name for the parameter instance.
      • Parameter

        public Parameter​(ParamMgr parent,
                         int descriptor,
                         CipAttribute target,
                         java.lang.String name)
        Support a reference to data in another attribute. The given attribute will be wrapped in a proxy and this Parameter's link path attribute will be set to the given attribute's EPath.
        Parameters:
        parent - The parameter manager class object.
        descriptor - The feature descriptor for this parameter, enforced in the proxy regardless of the given attribute's permissions. The following feature bits are allowed: 0x0010 Read-only 0x0020 Monitor (real time) 0x0200 Non-displayed 0x0400 Indirect reference 0x4000 Write-only
        target - The attribute to wrap in a proxy.
        name - The display name for the parameter instance.
      • Parameter

        public Parameter​(ParamMgr parent,
                         int descriptor,
                         BaseDataType<?> data,
                         java.lang.String name)
        Expose data directly in a parameter. The given data is expected to be the master instance. The link path will be empty and not settable.
        Parameters:
        parent - The parameter manager class object.
        descriptor - The feature descriptor for this parameter, enforced in the attribute. The following feature bits are allowed: 0x0010 Read-only 0x0020 Monitor (real time) 0x0200 Non-displayed 0x0400 Indirect reference 0x4000 Write-only
        data - The data to wrap in an attribute.
        name - The display name for the parameter instance.
      • Parameter

        public Parameter​(ParamMgr parent,
                         int descriptor,
                         CipPath path,
                         java.lang.String name)
        Expose data indirectly in a parameter. The given path will be resolved to the inner data of the target. The link path will be filled. It will also be settable if the descriptor bit is set.
        Parameters:
        parent - The parameter manager class object.
        descriptor - The feature descriptor for this parameter, enforced in the attribute. The following feature bits are allowed: 0x0001 Settable path 0x0010 Read-only 0x0020 Monitor (real time) 0x0200 Non-displayed 0x0400 Indirect reference 0x4000 Write-only
        path - The true attribute to point at via linkage.
        name - The display name for the parameter instance.
    • Method Detail

      • service

        public void service​(CipObject appContext,
                            CipRequest request,
                            int nesting)
        Description copied from class: CipObject

        Execute a CIP service on the object, using the request supplied. Supply a reply to the request and/or throw an appropriate CipException. Replies are not required before this routine returns.

        Direct service() calls MUST NOT BLOCK. Any operation that will take any significant time must be delegated to an executor. "Significant" may vary by application, but typically would be in the fractional millisecond range.

        Specified by:
        service in interface AttributeHolder
        Overrides:
        service in class CipInstance
        Parameters:
        appContext - Root object for application path lookups. Generally a Mirrored Device from a port context.
        request - What to do and where to reply. Services to be handled by child objects are to be passed to their service() method with nesting+1.
        nesting - How many leading path segments items to skip when processing this request. Avoids copying the balance of an application path into a new request when passing a request to a child object.
      • hasSettablePath

        public boolean hasSettablePath()
      • isReadOnly

        public boolean isReadOnly()
      • isMonitor

        public boolean isMonitor()
      • isNonDisplay

        public boolean isNonDisplay()
      • isIndirect

        public boolean isIndirect()
      • isWriteOnly

        public boolean isWriteOnly()
      • getData

        public BaseDataType<?> getData()
        Description copied from interface: DataWrapper
        Many CIP objects wrap a CIP data type. This interface allows the member resolver to access fragments of complex wrapped data in a uniform way.
        Specified by:
        getData in interface DataWrapper
        Returns: