Class PhpType

Description

PhpType

The class includes set of methods that convert the received Modbus data (array of bytes) to the PHP data type, i.e. signed int, unsigned int and float.

  • author: Jan Krakora
  • copyright: Copyright (c) 2004, 2012 Jan Krakora

Located in /Phpmodbus/PhpType.php (line 28)


	
			
Method Summary
static float bytes2float (array $values, [bool $endianness = 0])
static int bytes2signedInt (array $values, [bool $endianness = 0])
static string bytes2string (array $values, [bool $endianness = 0])
static int|float bytes2unsignedInt (array $values, [bool $endianness = 0])
Methods
static method bytes2float (line 40)

bytes2float

The function converts array of 4 bytes to float. The return value depends on order of the input bytes (endianning).

  • access: public
static float bytes2float (array $values, [bool $endianness = 0])
  • array $values
  • bool $endianness
static method bytes2signedInt (line 62)

bytes2signedInt

The function converts array of 2 or 4 bytes to signed integer. The return value depends on order of the input bytes (endianning).

  • access: public
static int bytes2signedInt (array $values, [bool $endianness = 0])
  • array $values
  • bool $endianness
static method bytes2string (line 108)

bytes2string

The function converts an values array to the string. The function detects the end of the string by 0x00 character as defined by string standards.

  • access: public
static string bytes2string (array $values, [bool $endianness = 0])
  • array $values
  • bool $endianness
static method bytes2unsignedInt (line 87)

bytes2unsignedInt

The function converts array of 2 or 4 bytes to unsigned integer. The return value depends on order of the input bytes (endianning).

  • access: public
static int|float bytes2unsignedInt (array $values, [bool $endianness = 0])
  • array $values
  • bool $endianness

Documentation generated on Tue, 09 Jul 2013 23:46:23 +0200 by phpDocumentor 1.4.1