User Tools

Site Tools


uphp:modbus_functions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

uphp:modbus_functions [2019/06/27 03:27]
admin
uphp:modbus_functions [2021/09/13 05:57]
Line 1: Line 1:
-======Serial and Modbus Function Reference====== 
- 
-uPHP functions related to the serial port and Modbus are shown below: 
- 
-Click on the function name for further details: 
- 
-^FUNCTION NAME^PARAMETER(S)^RETURN^DESCRIPTION^ 
-|[[.functions:f485open]]|<html><span style="color:green">int<span style="color:blue"> baud<span style="color:black">,<span style="color:green"> int<span style="color:blue"> parity</html>|<html><span style="color:green">int<span style="color:black"> handle or 0</html>|<html>Open the RS-485 port at the specified <span style="color:blue">baud<span style="color:black"> rate and <span style="color:blue">parity</html>| 
-|[[.functions:fclose]]|<html><span style="color:green">int<span style="color:blue"> handle</html>||Close a file, stream or socket| 
-|[[.functions:feof]]|<html><span style="color:green">int<span style="color:blue"> handle</html>|<html><span style="color:green">int<span style="color:black"> 1 or 0</html>|Test if no more data is available in a file, stream or socket| 
-|[[.functions:fgets]]|<html><span style="color:green">int<span style="color:blue"> handle<span style="color:black">,<span style="color:green"> int<span style="color:blue"> size</html>|<html><span style="color:green">string<span style="color:black"> or <span style="color:green">int<span style="color:black"> -1</html>|<html>Return a single line from a file, stream or socket, with optional <span style="color:blue">size<span style="color:black"> limit</html>| 
-|[[.functions:filesize]]|<html><span style="color:green">string<span style="color:blue"> filename<span style="color:black"> or<span style="color:green"> int<span style="color:blue"> handle</html>|<html><span style="color:green">int<span style="color:black"> bytes</html>|Return the size of a file, or the number of unread bytes in a stream or socket| 
-|[[.functions:fread]]|<html><span style="color:green">int<span style="color:blue"> handle<span style="color:black">,<span style="color:green"> int<span style="color:blue"> bytes</html>|<html><span style="color:green">string<span style="color:black"> or <span style="color:green">int<span style="color:black"> 0</html>|<html>Read <span style="color:blue">bytes<span style="color:black"> from a file, stream or socket</html>| 
-|[[.functions:fseropen]]|<html><span style="color:green">int<span style="color:blue"> baud<span style="color:black">,<span style="color:green"> int<span style="color:blue"> blocking<span style="color:black">,<span style="color:green"> int<span style="color:blue"> invert<span style="color:black">,<span style="color:green"> int<span style="color:blue"> parity</html>|<html><span style="color:green">int<span style="color:black"> handle or 0</html>|<html>Open the serial port at the specified <span style="color:blue">baud<span style="color:black"> rate with optional parameters</html>| 
-[[.functions:fwrite]]|<html><span style="color:green">int<span style="color:blue"> handle<span style="color:black">, <span style="color:green">mixed <span style="color:blue">data<span style="color:black">, <span style="color:green">int <span style="color:blue">length</html>|<html><span style="color:green">int<span style="color:black"> bytes written or -1</html>|<html>Write <span style="color:blue">data<span style="color:black"> to a file, stream or socket</html>| 
-|[[.functions:mb_delete_device]]|<html><span style="color:green">int<span style="color:blue"> id</html>|<html><span style="color:green">int<span style="color:black"> 1=OK</html>|Delete a device from the list of active devices| 
-|[[.functions:mb_get_dev_by_id]]|<html><span style="color:green">int<span style="color:blue"> id</html>|<html><span style="color:green">array</html>|Return modbus device details by <html><span style="color:blue">id</html>| 
-|[[.functions:mb_get_dev_by_index]]|<html><span style="color:green">int<span style="color:blue"> index</html>|<html><span style="color:green">array</html>|Return modbus device details by <html><span style="color:blue">index</html>| 
-|[[.functions:mb_get_dev_by_name]]|<html><span style="color:green">string<span style="color:blue"> name</html>|<html><span style="color:green">array</html>|Return modbus device details by <html><span style="color:blue">name</html>| 
-|[[.functions:mb_get_dev_info]]|<html><span style="color:green">int<span style="color:blue"> type</html>|<html><span style="color:green">array</html>|Return modbus device details by <html><span style="color:blue">type</html>| 
-|[[.functions:mb_get_role_array]]||<html><span style="color:green">array</html>|Return an <html><span style="color:green">array<span style="color:black"></html> of all roles and their values| 
-|[[.functions:mb_get_status_by_role]]|<html><span style="color:green">int<span style="color:blue"> role</html>|<html><span style="color:green">int<span style="color:black"> 1=OK</html>|Return status of the device attached to the <html><span style="color:blue">role</html>| 
-|[[.functions:mb_get_val_by_role]]|<html><span style="color:green">int<span style="color:blue"> role</html>|<html><span style="color:green">number</html>|Return value of the <html><span style="color:blue">role</html>| 
-|[[.functions:mb_num_devices]]||<html><span style="color:green">int</html>|Return number of devices on the modbus| 
-|[[.functions:mb_queue_command]]|<html><span style="color:green">mixed<span style="color:blue"> values<span style="color:black"> ...</html>|<html><span style="color:green">array<span style="color:black"> of numbers</html>|Queue a sequence of characters to the RS-485 bus and get but ignore the reply| 
-|[[.functions:mb_scan_complete]]||<html><span style="color:green">int<span style="color:black"> 1=complete, 0=ongoing</html>|Check to see if a modbus scan has completed| 
-|[[.functions:mb_scan_percent]]||<html><span style="color:green">number<span style="color:black"> percent completed</html>|Return scan percentage completed| 
-|[[.functions:mb_send_command]]|<html><span style="color:green">mixed<span style="color:blue"> values<span style="color:black"> ...</html>|<html><span style="color:green">array<span style="color:black"> of numbers</html>|Send a sequence of characters to the RS-485 bus and get a reply| 
-|[[.functions:mb_set_dev_var]]|<html><span style="color:green">string<span style="color:blue"> name<span style="color:black"> or<span style="color:green"> int<span style="color:blue"> id<span style="color:black">,<span style="color:green"> string<span style="color:blue"> variable<span style="color:black">,<span style="color:green"> mixed<span style="color:blue"> value</html>|<html><span style="color:green">int<span style="color:black"> 1=OK</html>|Set a <html><span style="color:blue">variable<span style="color:black"></html> on a modbus device| 
-|[[.functions:mb_set_val_by_role]]|<html><span style="color:green">int<span style="color:blue"> role<span style="color:black">,<span style="color:green"> number<span style="color:blue"> value</html>|<html><span style="color:green">int<span style="color:black"> 1=OK</html>|Set a <html><span style="color:blue">role value<span style="color:black"></html> on a modbus device| 
-|[[.functions:mb_start_scan]]|<html><span style="color:green">int<span style="color:blue"> start<span style="color:black">,<span style="color:green"> int<span style="color:blue"> end</html>||Initiate an automatic scan of the modbus| 
  
uphp/modbus_functions.txt · Last modified: 2021/09/13 05:57 (external edit)