Class: PlcAccess::Protocol::PlcShare::PlcShareProtocol

Inherits:
Keyence::KvProtocol show all
Defined in:
lib/plc_access/protocol/plc_share/plc_share_protocol.rb

Constant Summary

Constants inherited from PlcAccess::Protocol::Protocol

PlcAccess::Protocol::Protocol::TIMEOUT

Instance Attribute Summary collapse

Attributes inherited from PlcAccess::Protocol::Protocol

#host, #log_level, #port

Instance Method Summary collapse

Methods inherited from Keyence::KvProtocol

#available_bits_range, #available_words_range, #close, #device_by_name, #dump_packet, #get_bits_from_device, #get_words_from_device, #open, #open!, #receive, #set_bits_to_device, #set_words_to_device

Methods inherited from PlcAccess::Protocol::Protocol

#[], #[]=, #available_bits_range, #available_words_range, #close, #destination_ipv4, #device_by_name, #get_bit_from_device, #get_bits_from_device, #get_from_devices, #get_word_from_device, #get_words_from_device, #open, #self_ipv4, #set_bit_to_device, #set_bits_to_device, #set_to_devices, #set_word_to_device, #set_words_to_device

Constructor Details

#initialize(options = {}) ⇒ PlcShareProtocol

Returns a new instance of PlcShareProtocol.



32
33
34
35
36
37
38
# File 'lib/plc_access/protocol/plc_share/plc_share_protocol.rb', line 32

def initialize(options = {})
  super
  @socket = nil
  @host = options[:host] || '192.168.0.10'
  @port = options[:port] || 10000
  self.device_type = options[:device_type] if options[:device_type]
end

Instance Attribute Details

#device_typeObject

Returns the value of attribute device_type.



30
31
32
# File 'lib/plc_access/protocol/plc_share/plc_share_protocol.rb', line 30

def device_type
  @device_type
end