Class: PlcUtil::Awl::ArrayType

Inherits:
Object
  • Object
show all
Defined in:
lib/plcutil/siemens/awl/array_type.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(element_type, range) ⇒ ArrayType

Returns a new instance of ArrayType.



6
7
8
# File 'lib/plcutil/siemens/awl/array_type.rb', line 6

def initialize(element_type, range)
	@range, @element_type = range, element_type
end

Instance Attribute Details

#element_typeObject

Returns the value of attribute element_type.



4
5
6
# File 'lib/plcutil/siemens/awl/array_type.rb', line 4

def element_type
  @element_type
end

#rangeObject

Returns the value of attribute range.



4
5
6
# File 'lib/plcutil/siemens/awl/array_type.rb', line 4

def range
  @range
end

Instance Method Details

#end_address(start_addr) ⇒ Object



14
15
16
# File 'lib/plcutil/siemens/awl/array_type.rb', line 14

def end_address(start_addr)
  start_addr.skip type.bit_size * range.count
end

#skip_padding(addr) ⇒ Object



10
11
12
# File 'lib/plcutil/siemens/awl/array_type.rb', line 10

def skip_padding(addr)
  addr.next_word
end