Class LgxDevice

    • Constructor Detail

      • LgxDevice

        public LgxDevice​(EKeySeg ekey,
                         int serial,
                         java.lang.String name)
    • Method Detail

      • getDevice

        public LgxDevice getDevice()
        Description copied from class: CipObject
        CipObjects are expected to be organized as a tree, typically with a CipDevice at the root. (CipDevices can have a parent too, if an implementer chooses to represent a virtual chassis that way.)

        By default, any CipObject will simply ask its parent for the device if asked for the device. A CipDevice returns itself.

        Overrides:
        getDevice in class CipDevice
        Returns:
        The CipDevice found in the parents of this object, if any.
      • getTypeByName

        public StructDef getTypeByName​(java.lang.String typeName)
        Description copied from interface: DataContext
        Look up a named type for use constructing nested elements of a structure.
        Specified by:
        getTypeByName in interface DataContext
        Overrides:
        getTypeByName in class CipTreeCtx
        Parameters:
        typeName - The type name to look up in the predefined names.
        Returns:
        The type suitable for use with CipStruct and/or StructMember.
      • getPrunedTypes

        public java.util.List<StructDef> getPrunedTypes()
        Enumerate all user-defined (named) types in the context, plus any pre-defined types that are in use.
        Returns:
      • getTypeByCRC

        public java.lang.String getTypeByCRC​(int crc)
        Description copied from interface: DataContext
        Look up a named type by CRC for use directly by a StructureDefSeg or indirectly by an AnonTypeSeg.
        Specified by:
        getTypeByCRC in interface DataContext
        Overrides:
        getTypeByCRC in class CipTreeCtx
        Returns:
        The type suitable for use with CipStruct and/or StructMember.
      • setupTemplates

        protected void setupTemplates()
        Create typical Logic datatype like STRING, TIMER, and COUNTER with known instance numbers and structure handles.
      • executor

        public java.util.concurrent.ExecutorService executor()
        Description copied from class: CipObject
        Services and packet handlers may need to perform extended calculations or communicate with other systems in an unbounded way. This can be a resource management problem for devices, so the host device must make an appropriate executor service available.

        The base CIP object implementation simply retrieves the executor from the object's parent, returning a null if there's no parent. This will break real applications, so CipDevice implementations must override this method to supply a real executor.

        Overrides:
        executor in class CipObject
        Returns:
        An executor for general immediate task processing.
      • scheduler

        public java.util.concurrent.ScheduledExecutorService scheduler()
        Description copied from class: CipObject
        CIP connections that produce data at intervals need a way to schedule the transmissions, and may need significant time to assemble the data needed. As with executor(), this may be a resource problem for devices, so the host device must make an appropriate scheduler service available. Objects with repetitive housekeeping tasks should also use this scheduler instead of creating their own threads.

        The base CIP object implementation simply retrieves the scheduler from the object's parent, returning a null if there's no parent. This will break real applications, so CipDevice implementations must override this method to supply a real scheduler.

        Overrides:
        scheduler in class CipObject
        Returns:
        An executor for repeating task processing.