Method: Modbus::ProtocolData#push_word

Defined in:
lib/modbus/connection/protocol_data.rb

#push_word(word) ⇒ Object

Interprets a value as a word (network byte order) and pushes two bytes to the end of the array.

Parameters:

  • word (Integer)

    The value to push.



42
43
44
# File 'lib/modbus/connection/protocol_data.rb', line 42

def push_word(word)
  self.concat [word].pack('n').unpack('C2')
end