summaryrefslogtreecommitdiff
path: root/doc/functions.texi
blob: 358aeb917f9128cb288b7bdc26c6b58acfa21cf7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
@c ---------------------------------------------------
@node Common Functions
@section Common Functions
@cindex Common Functions
@c Common Functions flushinput
@c -----------------------------------------
@subsection flushinput
@cindex flushinput
@deftypefn {} {} flushinput (@var{dev})
 Flush the instruments input buffers

@subsubheading Inputs
@var{dev} - connected device or array of devices

@subsubheading Outputs
 None

@xseealso{flushoutput}
@end deftypefn
@c Common Functions flushoutput
@c -----------------------------------------
@subsection flushoutput
@cindex flushoutput
@deftypefn {} {} flushoutput (@var{dev})
 Flush the instruments output buffers

@subsubheading Inputs
@var{dev} - connected device or array of devices

@subsubheading Outputs
 None

@xseealso{flushinput}
@end deftypefn
@c Common Functions readbinblock
@c -----------------------------------------
@subsection readbinblock
@cindex readbinblock
@deftypefn {} {@var{data} =} readbinblock (@var{dev})
@deftypefnx {} {@var{data} =} readbinblock (@var{dev}, @var{datatype})
 read a binblock of data from a instrument device

@subsubheading Inputs
@var{dev} - connected device

@var{datatype} - optional data type to read data as (default 'uint8')

@subsubheading Outputs
@var{data} - data read

@xseealso{flushoutput}
@end deftypefn
@c Common Functions readline
@c -----------------------------------------
@subsection readline
@cindex readline
@deftypefn {} {@var{data} =} readline (@var{dev})
 read data from a instrument device excluding terminator value

@subsubheading Inputs
@var{dev} - connected device

@subsubheading Outputs
@var{data} - ASCII data read

@xseealso{flushoutput}
@end deftypefn
@c Common Functions writebinblock
@c -----------------------------------------
@subsection writebinblock
@cindex writebinblock
@deftypefn {} {} writebinblock (@var{dev}, @var{data}, @var{datatype})
 Write a IEEE 488.2 binblock of data to a instrument device

 binblock formatted data is defined as:

 #<A><B><C>

 where:
     <A> ASCII number containing the length of part <B>

     <B> ASCII number containing the number of bytes of <C>

     <C> Binary data block

@subsubheading Inputs
@var{dev} - connected device

@var{data} - binary data to send

@var{datatype} - datatype to send data as

@subsubheading Outputs
 None

@xseealso{flushoutput}
@end deftypefn
@c Common Functions writeline
@c -----------------------------------------
@subsection writeline
@cindex writeline
@deftypefn {} {} writeline (@var{dev}, @var{data})
 Write data to a instrument device including terminator value

@subsubheading Inputs
@var{dev} - connected device

@var{data} - ASCII data to write

@subsubheading Outputs
 None

@xseealso{flushoutput}
@end deftypefn
@c Common Functions writeread
@c -----------------------------------------
@subsection writeread
@cindex writeread
@deftypefn {} {@var{data} =} writeread (@var{dev}, @var{command})
 write a ASCII command and read data from a instrument device.

@subsubheading Inputs
@var{dev} - connected device

@var{command} - ASCII command

@subsubheading Outputs
@var{data} - ASCII data read

@xseealso{readline, writeline}
@end deftypefn
@c ---------------------------------------------------
@node General
@section General
@cindex General
@c General instrhelp
@c -----------------------------------------
@subsection instrhelp
@cindex instrhelp
@deftypefn {} {} instrhelp ()
@deftypefnx {} {} instrhelp (@var{funcname})
@deftypefnx {} {} instrhelp (@var{obj})
 Display instrument help

@subsubheading Inputs
@var{funcname} - function to display help about.@*
@var{obj} - object to display help about.@*

 If no input is provided, the function will display and overview
 of the package functionality.

@subsubheading Outputs
 None

@end deftypefn
@c General instrhwinfo
@c -----------------------------------------
@subsection instrhwinfo
@cindex instrhwinfo
@deftypefn {Function File} {[@var{list}] =} instrhwinfo ()
@deftypefnx {Function File} {@var{list} =} instrhwinfo (@var{interface})
 Query available hardware for instrument-control

 When run without any input parameters, instrhwinfo will provide the toolbox
 information and a list of supported interfaces.

@subsubheading Inputs
@var{interface} is the instrument interface to query. When provided, instrhwinfo
 will provide information on the specified interface.

 Currently only interface "serialport","i2c" and "spi" and is supported, which will provide a list of
 available serial ports or i2c ports.

@subsubheading Outputs
 If an output variable is provided, the function will store the information
 to the variable, otherwise it will be displayed to the screen.

@subsubheading Example
@example
 instrhwinfo
 scalar structure containing the fields:

    ToolboxVersion = 0.4.0
    ToolboxName = octave instrument control package
    SupportedInterfaces =
    @{
      [1,1] = i2c
      [1,2] = parallel
      [1,3] = serialport
      [1,4] = tcp
      [1,5] = udp
      [1,6] = usbtmc
      [1,7] = vxi11
    @}

@end example

@end deftypefn
@c General resolvehost
@c -----------------------------------------
@subsection resolvehost
@cindex resolvehost
@deftypefn {Loadable Function} {@var{name} = } resolvehost (@var{host})
@deftypefnx {Loadable Function} {[@var{name}, @var{address}] = } resolvehost (@var{host})
@deftypefnx {Loadable Function} {@var{out} = } resolvehost (@var{host}, @var{returntype})

Resolve a network host name or address to network name and address

@subsubheading Inputs
@var{host} - Host name or IP address string to resolve.@*
@var{name} - Resolved IP host name.@*
@var{returntype} - 'name' to get host name, 'address' to get IP address.

@subsubheading Outputs
@var{name} - Resolved IP host name.@*
@var{address} - Resolved IP host address.@*
@var{out} - host name if @var{returntype} is 'name', ipaddress if @var{returntype} is 'address'@*

@subsubheading Example
@example
%% get resolved ip name and address of www.gnu.org
[name, address] = resolvehost ('www.gnu.org');

%% get ip address of www.gnu.org
ipaddress = resolvehost ('www.gnu.org', 'address');

@end example

@xseealso{tcp, udp}

@end deftypefn
@c ---------------------------------------------------
@node GPIB
@section GPIB
@cindex GPIB
@c GPIB @octave_gpib/fclose
@c -----------------------------------------
@subsection @@octave_gpib/fclose
@cindex fclose
@deftypefn {Function File} {@var{res} =} fclose (@var{obj})
 Closes connection to GPIB device @var{obj}
@end deftypefn
@c GPIB @octave_gpib/fopen
@c -----------------------------------------
@subsection @@octave_gpib/fopen
@cindex fopen
@deftypefn {Function File} {@var{res} =} fopen (@var{obj}) (dummy)
 Opens connection to GPIB device @var{obj}
 This currently is a dummy function to improve compatibility to MATLAB

@end deftypefn
@c GPIB @octave_gpib/fprintf
@c -----------------------------------------
@subsection @@octave_gpib/fprintf
@cindex fprintf
@deftypefn {Function File} {} fprintf (@var{obj}, @var{cmd})
@deftypefnx {Function File} {} fprintf (@var{obj}, @var{format}, @var{cmd})
@deftypefnx {Function File} {} fprintf (@var{obj}, @var{cmd}, @var{mode})
@deftypefnx {Function File} {} fprintf (@var{obj}, @var{format}, @var{cmd}, @var{mode})
 Writes string @var{cmd} to GPIB instrument

@var{obj} is a GPIB object

@var{cmd} String
@var{format} Format specifier
@var{mode} sync

@end deftypefn
@c GPIB @octave_gpib/fread
@c -----------------------------------------
@subsection @@octave_gpib/fread
@cindex fread
@deftypefn {Function File} {@var{data} =} fread (@var{obj})
@deftypefnx {Function File} {@var{data} =} fread (@var{obj}, @var{size})
@deftypefnx {Function File} {@var{data} =} fread (@var{obj}, @var{size}, @var{precision})
@deftypefnx {Function File} {[@var{data},@var{count}] =} fread (@var{obj}, ...)
@deftypefnx {Function File} {[@var{data},@var{count},@var{errmsg}] =} fread (@var{obj}, ...)
 Reads @var{data} from GPIB instrument

@var{obj} is a GPIB object

@var{size} Number of values to read. (Default: 100)
@var{precision} precision of data

@var{count} values read
@var{errmsg} read operation error message

@end deftypefn
@c GPIB @octave_gpib/fscanf
@c -----------------------------------------
@subsection @@octave_gpib/fscanf
@cindex fscanf
@deftypefn {Function File} {@var{res} =} fscanf (@var{obj})
@deftypefnx {Function File} {@var{res} =} fscanf (@var{obj}, @var{format})
@deftypefnx {Function File} {@var{res} =} fscanf (@var{obj}, @var{format}, @var{size})
@deftypefnx {Function File} {[@var{res},@var{count}] =} fscanf (@var{obj}, ...)
@deftypefnx {Function File} {[@var{res},@var{count},@var{errmsg}] =} fscanf (@var{obj}, ...)
 Reads data @var{res} from GPIB instrument

@var{obj} is a GPIB object

@var{format} Format specifier
@var{size} number of values

@var{count} values read
@var{errmsg} read operation error message

@end deftypefn
@c GPIB @octave_gpib/fwrite
@c -----------------------------------------
@subsection @@octave_gpib/fwrite
@cindex fwrite
@deftypefn {Function File} {} fwrite (@var{obj}, @var{data})
@deftypefnx {Function File} {} fwrite (@var{obj}, @var{data}, @var{precision})
@deftypefnx {Function File} {} fwrite (@var{obj}, @var{data}, @var{mode})
@deftypefnx {Function File} {} fwrite (@var{obj}, @var{data}, @var{precision}, @var{mode})
 Writes @var{data} to GPIB instrument

@var{obj} is a GPIB object

@var{data} data to write
@var{precision} precision of data
@var{mode} sync

@end deftypefn
@c GPIB clrdevice
@c -----------------------------------------
@subsection clrdevice
@cindex clrdevice
@deftypefn {Function File} {} clrdevice (@var{obj})
 Send clear command to Clear GPIB instrument.

@var{obj} is a GPIB object

@end deftypefn
@c GPIB gpib
@c -----------------------------------------
@subsection gpib
@cindex gpib
@deftypefn {Loadable Function} {@var{gpib} = } gpib ([@var{gpibid}], [@var{timeout}])

Open gpib interface.

@var{gpibid} - the interface number.@*
@var{timeout} - the interface timeout value. If omitted defaults to blocking call.

The gpib() shall return instance of @var{octave_gpib} class as the result @var{gpib}.
@end deftypefn
@c GPIB gpib_close
@c -----------------------------------------
@subsection gpib_close
@cindex gpib_close
@deftypefn {Loadable Function} {} gpib_close (@var{gpib})

Close the interface and release a file descriptor.

@var{gpib} - instance of @var{octave_gpib} class.
@end deftypefn
@c GPIB gpib_read
@c -----------------------------------------
@subsection gpib_read
@cindex gpib_read
@deftypefn {Loadable Function} {[@var{data}, @var{count}, @var{eoi}] = } gpib_read (@var{gpib}, @var{n})

Read from gpib interface.

@var{gpib} - instance of @var{octave_gpib} class.@*
@var{n} - number of bytes to attempt to read of type Integer.

The gpib_read() shall return number of bytes successfully read in @var{count} as Integer and the bytes themselves in @var{data} as uint8 array.
@var{eoi} indicates read operation complete 
@end deftypefn
@c GPIB gpib_timeout
@c -----------------------------------------
@subsection gpib_timeout
@cindex gpib_timeout
@deftypefn {Loadable Function} {} gpib_timeout (@var{gpib}, @var{timeout})
@deftypefnx {Loadable Function} {@var{t} = } gpib_timeout (@var{gpib})

Set new or get existing gpib interface timeout parameter. The timeout value is valid from 0 to 17.

@var{gpib} - instance of @var{octave_gpib} class.@*
@var{timeout} - Value of 0 means never timeout, 11 means one second and 17 means 1000 seconds (see GPIB documentation (ibtmo) for further details)

If @var{timeout} parameter is omitted, the gpib_timeout() shall return current timeout value as the result @var{t}.
@end deftypefn
@c GPIB gpib_write
@c -----------------------------------------
@subsection gpib_write
@cindex gpib_write
@deftypefn {Loadable Function} {@var{n} = } gpib_write (@var{gpib}, @var{data})

Write data to a gpib interface.

@var{gpib} - instance of @var{octave_gpib} class.@*
@var{data} - data to be written to the gpib interface. Can be either of String or uint8 type.

Upon successful completion, gpib_write() shall return the number of bytes written as the result @var{n}.
@end deftypefn
@c GPIB spoll
@c -----------------------------------------
@subsection spoll
@cindex spoll
@deftypefn {Function File} {@var{out} =} spoll (@var{obj})
@deftypefnx {Function File} {[@var{out},@var{statusByte}] =} spoll (@var{obj})
 Serial polls GPIB instruments.

@var{obj} is a GPIB object or a cell array of GPIB objects

@var{out} GPIB objects ready for service
@var{statusByte} status Byte

@end deftypefn
@c GPIB trigger
@c -----------------------------------------
@subsection trigger
@cindex trigger
@deftypefn {Function File} {} trigger (@var{obj})
 Triggers GPIB instrument.

@var{obj} is a GPIB object

@end deftypefn
@c ---------------------------------------------------
@node I2C
@section I2C
@cindex I2C
@c I2C @octave_i2c/fclose
@c -----------------------------------------
@subsection @@octave_i2c/fclose
@cindex fclose
@deftypefn {Function File} {@var{res} =} fclose (@var{obj})
 Closes I2C connection @var{obj}
@end deftypefn
@c I2C @octave_i2c/fopen
@c -----------------------------------------
@subsection @@octave_i2c/fopen
@cindex fopen
@deftypefn {Function File} {@var{res} =} fopen (@var{obj}) (dummy)
 Opens I2C connection @var{obj}

 This currently is a dummy function to improve compatibility to MATLAB

@end deftypefn
@c I2C @octave_i2c/fread
@c -----------------------------------------
@subsection @@octave_i2c/fread
@cindex fread
@deftypefn {Function File} {@var{data} =} fread (@var{obj})
@deftypefnx {Function File} {@var{data} =} fread (@var{obj}, @var{size})
@deftypefnx {Function File} {@var{data} =} fread (@var{obj}, @var{size}, @var{precision})
@deftypefnx {Function File} {[@var{data},@var{count}] =} fread (@var{obj}, ...)
@deftypefnx {Function File} {[@var{data},@var{count},@var{errmsg}] =} fread (@var{obj}, ...)
 Reads @var{data} from I2C instrument

@subsubheading Inputs
@var{obj} is a I2C object.@*
@var{size} Number of values to read. (Default: 100).@*
@var{precision} precision of data.@*

@subsubheading Outputs
@var{data} data values.@*
@var{count} number of values read.@*
@var{errmsg} read operation error message.@*

@end deftypefn
@c I2C @octave_i2c/fwrite
@c -----------------------------------------
@subsection @@octave_i2c/fwrite
@cindex fwrite
@deftypefn {Function File} {@var{numbytes} = } fwrite (@var{obj}, @var{data})
@deftypefnx {Function File} {@var{numbytes} =} fwrite (@var{obj}, @var{data}, @var{precision})
 Writes @var{data} to I2C instrument

@subsubheading Inputs
@var{obj} is a I2C object.@*
@var{data} data to write.@*
@var{precision} precision of data.@*

@subsubheading Outputs
 returns number of bytes written.
@end deftypefn
@c I2C @octave_i2c/get
@c -----------------------------------------
@subsection @@octave_i2c/get
@cindex get
@deftypefn {Function File} {@var{struct} = } get (@var{i2c})
@deftypefnx {Function File} {@var{field} = } get (@var{i2c}, @var{property})
 Get the properties of i2c object.

@subsubheading Inputs
@var{i2c} - instance of @var{octave_i2c} class.@*

@var{property} - name of property.@*

@subsubheading Outputs
 When @var{property} was specified, return the value of that property.@*
 otherwise return the values of all properties as a structure.@*

@xseealso{@@octave_i2c/set}
@end deftypefn
@c I2C @octave_i2c/set
@c -----------------------------------------
@subsection @@octave_i2c/set
@cindex set
@deftypefn {Function File} set (@var{obj}, @var{property},@var{value})
@deftypefnx {Function File} set (@var{obj}, @var{property},@var{value},@dots{})
 Set the properties of i2c object.

@subsubheading Inputs
@var{obj} - instance of @var{octave_i2c} class.@*
@var{property} - name of property.@*

 If @var{property} is a cell so must be @var{value}, it sets the values of
 all matching properties.

 The function also accepts property-value pairs.

@subsubheading Properties
@table @var
@item 'name'
 Set the name for the i2c socket.

@item 'remoteaddress'
 Set the remote address for the i2c socket.

@end table

@subsubheading Outputs
 None

@xseealso{@@octave_i2c/get}
@end deftypefn
@c I2C i2c
@c -----------------------------------------
@subsection i2c
@cindex i2c
@deftypefn {Loadable Function} {@var{i2c} = } i2c ([@var{port_path}], [@var{address}])

Open i2c interface.

@subsubheading Inputs
@var{port_path} - the interface device port/path of type String. If omitted defaults to 
'/dev/i2c-0'. @*
@var{address} - the slave device address. If omitted must be set using i2c_addr() call.

@subsubheading Outputs
@var{i2c} - An instance of @var{octave_i2c} class.

@subsubheading Properties
The i2c object has the following properties:
@table @asis
@item name
Name of the object
@item remoteaddress
the slave device address
@item port
The interface driver port (readonly)
@end table
@end deftypefn
@c I2C i2c_addr
@c -----------------------------------------
@subsection i2c_addr
@cindex i2c_addr
@deftypefn {Loadable Function} {} i2c_addr (@var{i2c}, @var{address})
@deftypefnx {Loadable Function} {@var{addr} = } i2c_addr (@var{i2c})

Set new or get existing i2c slave device address.

@subsubheading Inputs
@var{i2c} - instance of @var{octave_i2c} class.@*
@var{address} - i2c slave device address of type Integer.
The address is passed in the 7 or 10 lower bits of the argument.

@subsubheading Outputs
@var{addr} - If @var{address} parameter is omitted, the i2c_addr() shall return
current i2c slave device address.
@end deftypefn
@c I2C i2c_close
@c -----------------------------------------
@subsection i2c_close
@cindex i2c_close
@deftypefn {Loadable Function} {} i2c_close (@var{i2c})

Close the interface and release a file descriptor.

@subsubheading Inputs
@var{i2c} - instance of @var{octave_i2c} class.@*

@subsubheading Outputs
None
@end deftypefn
@c I2C i2c_read
@c -----------------------------------------
@subsection i2c_read
@cindex i2c_read
@deftypefn {Loadable Function} {[@var{data}, @var{count}] = } i2c_read (@var{i2c}, @var{n})

Read from i2c slave device.

@subsubheading Inputs
@var{i2c} - instance of @var{octave_i2c} class.@*
@var{n} - number of bytes to attempt to read of type Integer.

@subsubheading Outputs
The i2c_read() shall return number of bytes successfully read in @var{count} as Integer and the bytes themselves in @var{data} as uint8 array.
@end deftypefn
@c I2C i2c_write
@c -----------------------------------------
@subsection i2c_write
@cindex i2c_write
@deftypefn {Loadable Function} {@var{n} = } i2c_write (@var{i2c}, @var{data})

Write data to a i2c slave device.

@subsubheading Inputs
@var{i2c} - instance of @var{octave_i2c} class.@*
@var{data} - data, of type uint8, to be written to the slave device.

@subsubheading Outputs
Upon successful completion, i2c_write() shall return the number of bytes written as the result @var{n}.
@end deftypefn
@c ---------------------------------------------------
@node Modbus
@section Modbus
@cindex Modbus
@c Modbus @octave_modbus/get
@c -----------------------------------------
@subsection @@octave_modbus/get
@cindex get
@deftypefn {Function File} {@var{struct} = } get (@var{dev})
@deftypefnx {Function File} {@var{field} = } get (@var{dev}, @var{property})
 Get the properties of modbus object.

@subsubheading Inputs
@var{dev} - instance of @var{octave_modbus} class.@*
@var{property} - name of property.@*

@subsubheading Outputs
 When @var{property} was specified, return the value of that property.@*
 otherwise return the values of all properties as a structure.@*

@xseealso{@@octave_modbus/set}
@end deftypefn
@c Modbus @octave_modbus/maskWrite
@c -----------------------------------------
@subsection @@octave_modbus/maskWrite
@cindex maskWrite
@deftypefn {} {@var{data} =} maskWrite (@var{dev}, @var{address}, @var{andmask}, @var{ormask})
@deftypefnx {} {@var{data} =} maskWrite (@var{dev}, @var{address}, @var{andmask}, @var{ormask}, @var{serverid})
 Read holding register at @var{address} from modbus device @var{dev} apply masking and write the change data.

 writeregister value = (readregister value AND andMask) OR (orMask AND (NOT andMask))

@subsubheading Inputs
@var{dev} - connected modbus device

@var{address} - address to read from.

@var{andmask} - AND mask to apply to the register

@var{ormask} - OR mask to apply to the register

@var{serverId} - address to send to (0-247). Default of 1 is used if not specified.

@subsubheading Outputs
@var{data} - data read from the device

@xseealso{modbus}
@end deftypefn
@c Modbus @octave_modbus/read
@c -----------------------------------------
@subsection @@octave_modbus/read
@cindex read
@deftypefn {} {@var{data} =} read (@var{dev}, @var{target}, @var{address})
@deftypefnx {} {@var{data} =} read (@var{dev}, @var{target}, @var{address}, @var{count})
@deftypefnx {} {@var{data} =} read (@var{dev}, @var{target}, @var{address}, @var{count}, @var{serverId}, @var{precision})
 Read data from modbus device @var{dev} target @var{target} starting at address @var{address}.

@subsubheading Inputs
@var{dev} - connected modbus device

@var{target} - target type to read. One of 'coils', 'inputs', 'inputregs' or 'holdingregs'

@var{address} - address to start reading from.

@var{count} - number of elements to read. If not provided, count is 1.

@var{serverId} - address to send to (0-247). Default of 1 is used if not specified.

@var{precision} - Optional precision for how to interpret the read data.
 Currently known precision values are uint16 (default), int16, uint32, int32, uint64, uint64, single, double.

@subsubheading Outputs
@var{data} - data read from the device

@xseealso{modbus}
@end deftypefn
@c Modbus @octave_modbus/set
@c -----------------------------------------
@subsection @@octave_modbus/set
@cindex set
@deftypefn {Function File} set (@var{obj}, @var{property},@var{value})
@deftypefnx {Function File} set (@var{obj}, @var{property},@var{value},@dots{})
 Set the properties of modbus object.

@subsubheading Inputs
@var{obj} - instance of @var{octave_modbus} class.@*
@var{property} - name of property.@*

 If @var{property} is a cell so must be @var{value}, it sets the values of
 all matching properties.

 The function also accepts property-value pairs.

@subsubheading Properties
@table @var
@item 'Name'
 Set the stored string name of the object.

@item 'Timeout'
 Set the timeout value.

@item 'Numretries'
 Set the numretries value.

@item 'ByteOrder'
 Set the byteorder value

@item 'WordOrder'
 Set the wordorder value

@item 'UserData'
 Set the userdata value

@end table

@subsubheading Outputs
 None

@xseealso{@@octave_modbus/get}
@end deftypefn
@c Modbus @octave_modbus/write
@c -----------------------------------------
@subsection @@octave_modbus/write
@cindex write
@deftypefn {} {} write (@var{dev}, @var{target}, @var{address}, @var{values})
@deftypefnx {} {} read (@var{dev}, @var{target}, @var{address}, @var{values}, @var{serverId}, @var{precision})
 Write data @var{data} to modbus device @var{dev} target @var{target} starting at address @var{address}.

@subsubheading Inputs
@var{dev} - connected modbus device

@var{target} - target type to read. One of 'coils' or 'holdingregs'

@var{address} - address to start reading from.

@var{data} - data to write.

@var{serverId} - address to send to (0-247). Default of 1 is used if not specified.

@var{precision} - Optional precision for how to interpret the write data.
 Currently known precision values are uint16 (default), int16, uint32, int32, uint64, uint64, single, double.

@subsubheading Outputs
 None

@xseealso{modbus}
@end deftypefn
@c Modbus @octave_modbus/writeRead
@c -----------------------------------------
@subsection @@octave_modbus/writeRead
@cindex writeRead
@deftypefn {} {@var{data} =} writeRead (@var{dev}, @var{writeAddress}, @var{values}, @var{readAddress}, @var{readcount})
@deftypefnx {} {@var{data} =} writeRead (@var{dev}, @var{writeAddress}, @var{values}, @var{readAddress}, @var{readcount}, @var{serverId})
@deftypefnx {} {@var{data} =} writeRead (@var{dev}, @var{writeAddress}, @var{values}, @var{writePrecision}, @var{readAddress}, @var{readCount}, @var{readPrecision})
 Write data @var{values} to the modbus device @var{dev} holding registers starting at address @var{writeAddress}
 and then read @var{readCount} register values starting at address @var{readAddress}.

@subsubheading Inputs
@var{dev} - connected modbus device

@var{writeAddress} - address to start writing to.

@var{values} - data to write to the device.

@var{readAddress} - address to start reading from.

@var{readCount} - number of elements to read.

@var{serverId} - address to send to (0-247). Default of 1 is used if not specified.

@var{precision} - Optional precision for how to interpret the read data.
 Currently known precision values are uint16 (default), int16, uint32, int32, uint64, uint64, single, double.

@subsubheading Outputs
@var{data} - data read from the device

@xseealso{modbus}
@end deftypefn
@c Modbus modbus
@c -----------------------------------------
@subsection modbus
@cindex modbus
@deftypefn {Loadable Function} {@var{dev} = } modbus ('tcpip', @var{deviceaddress})
@deftypefnx {Loadable Function} {@var{dev} = } modbus ('tcpip', @var{deviceaddress}, @var{remoteport})
@deftypefnx {Loadable Function} {@var{dev} = } modbus ('tcpip', @var{deviceaddress}, @var{name}, @var{value})
@deftypefnx {Loadable Function} {@var{dev} = } modbus ('serialrtu', @var{serialport})
@deftypefnx {Loadable Function} {@var{dev} = } modbus ('serialrtu', @var{serialport}, @var{name}, @var{value})

Open modbus interface using a specified transport of 'tcpip' or 'serialrtu'.

@subsubheading Inputs
@var{deviceaddress} - the device ip address of type String.@*
@var{remoteport} - the device remote port number. If not specified, a default of 502 will be used.@*
@var{name}, @var{value} - Optional name value pairs for setting properties of the object.@*
@var{serialport} - the name of the serial port to connect to. It must be specified when transport is 'serialrtu'.@*

@subsubheading Common Input Name, Value pairs
@table @asis
@item Timeout
timeout value used for waiting for data
@item NumRetries
number of retries after a timeout
@item UserData
Additional data to attach to the object
@end table

@subsubheading Serial RTU Input Name, Value pairs
@table @asis
@item BaudRate
Baudrate for the serial port
@item DataBits
number of databits for serial port
@item Parity
Parity for serial port ('odd', 'even' or 'none')
@item StopBits
number of stopbits for serial port
@end table

@subsubheading Outputs
The modbus() shall return instance of @var{octave_modbus} class as the result @var{modbus}.

@subsubheading Properties
The modbus object has the following public properties:
@table @asis
@item Name
name assigned to the modbus object
@item Type
instrument type 'modbus' (readonly)
@item Port
Remote port number or serial port name (readonly)
@item DeviceAddress
Device address if transport was 'tcpip' (readonly)
@item Status
status of the object 'open' or 'closed' (readonly)
@item Timeout
timeout value used for waiting for data
@item NumRetries
number of retries after a timeout
@item UserData
Additional data to attach to the object
@end table 
@end deftypefn
@c ---------------------------------------------------
@node Parallel
@section Parallel
@cindex Parallel
@c Parallel @octave_parallel/fclose
@c -----------------------------------------
@subsection @@octave_parallel/fclose
@cindex fclose
@deftypefn {Function File} {@var{res} =} fclose (@var{obj})
 Closes parallel connection @var{obj}
@end deftypefn
@c Parallel @octave_parallel/fopen
@c -----------------------------------------
@subsection @@octave_parallel/fopen
@cindex fopen
@deftypefn {Function File} {@var{res} =} fopen (@var{obj}) (dummy)
 Opens parallel interface @var{obj}

 This currently is a dummy function to improve compatibility to MATLAB

@end deftypefn
@c Parallel @octave_parallel/fread
@c -----------------------------------------
@subsection @@octave_parallel/fread
@cindex fread
@deftypefn {Function File} {@var{data} =} fread (@var{obj})
@deftypefnx {Function File} {@var{data} =} fread (@var{obj}, @var{size})
@deftypefnx {Function File} {@var{data} =} fread (@var{obj}, @var{size}, @var{precision})
@deftypefnx {Function File} {[@var{data},@var{count}] =} fread (@var{obj}, ...)
@deftypefnx {Function File} {[@var{data},@var{count},@var{errmsg}] =} fread (@var{obj}, ...)
 Reads @var{data} from parallel instrument

@subsubheading Inputs
@var{obj} is a parallel object.@*
@var{size} Number of values to read. (Default: 1).@*
@var{precision} precision of data.@*

@subsubheading Outputs
@var{data} The read data.@*
@var{count} values read.@*
@var{errmsg} read operation error message.@*

@end deftypefn
@c Parallel @octave_parallel/fwrite
@c -----------------------------------------
@subsection @@octave_parallel/fwrite
@cindex fwrite
@deftypefn {Function File} {@var{numbytes} = } fwrite (@var{obj}, @var{data})
@deftypefnx {Function File} {@var{numbytes} =} fwrite (@var{obj}, @var{data}, @var{precision})
 Writes @var{data} to parallel instrument

@subsubheading Inputs
@var{obj} is a parallel object.@*
@var{data} data to write.@*
@var{precision} precision of data.@*

@subsubheading Outputs
 returns number of bytes written.
@end deftypefn
@c Parallel parallel
@c -----------------------------------------
@subsection parallel
@cindex parallel
@deftypefn {Loadable Function} {@var{parallel} = } parallel ([@var{path}], [@var{direction}])

Open Parallel interface.

@subsubheading Inputs
@var{path} - the interface path of type String. If omitted defaults to '/dev/parport0'.@*
@var{direction} - the direction of interface drivers of type Integer, see: PP_DATADIR for more info.
If omitted defaults to 1 (Input).

@subsubheading Outputs
The parallel() shall return instance of @var{octave_parallel} class as the result @var{parallel}.
@end deftypefn
@c Parallel pp_close
@c -----------------------------------------
@subsection pp_close
@cindex pp_close
@deftypefn {Loadable Function} {} pp_close (@var{parallel})

Close the interface and release a file descriptor.

@subsubheading Inputs
@var{parallel} - instance of @var{octave_serial} class.@*
@subsubheading Outputs
None
@end deftypefn
@c Parallel pp_ctrl
@c -----------------------------------------
@subsection pp_ctrl
@cindex pp_ctrl
@deftypefn {Loadable Function} {} pp_ctrl (@var{parallel}, @var{ctrl})
@deftypefnx {Loadable Function} {@var{c} = } pp_ctrl (@var{parallel})

Sets or Read the Control lines.

@subsubheading Inputs
@var{parallel} - instance of @var{octave_parallel} class.@*
@var{ctrl} - control parameter to be set of type Byte.

@subsubheading Outputs
If @var{ctrl} parameter is omitted, the pp_ctrl() shall return current Control lines state as the result @var{c}.
@end deftypefn
@c Parallel pp_data
@c -----------------------------------------
@subsection pp_data
@cindex pp_data
@deftypefn {Loadable Function} {} pp_data (@var{parallel}, @var{data})
@deftypefnx {Loadable Function} {@var{d} = } pp_data (@var{parallel})

Sets or Read the Data lines.

@subsubheading Inputs
@var{parallel} - instance of @var{octave_parallel} class.@*
@var{data} - data parameter to be set of type Byte.

@subsubheading Outputs
If @var{data} parameter is omitted, the pp_data() shall return current Data lines state as the result @var{d}.
@end deftypefn
@c Parallel pp_datadir
@c -----------------------------------------
@subsection pp_datadir
@cindex pp_datadir
@deftypefn {Loadable Function} {} pp_datadir (@var{parallel}, @var{direction})
@deftypefnx {Loadable Function} {@var{dir} = } pp_datadir (@var{parallel})

Controls the Data line drivers.

Normally the computer's parallel port will drive the data lines,
but for byte-wide transfers from the peripheral to the host it is useful to turn off those drivers
and let the peripheral drive the signals. (If the drivers on the computer's parallel port are left
on when this happens, the port might be damaged.)

@subsubheading Inputs
@var{parallel} - instance of @var{octave_parallel} class.@*
@var{direction} - direction parameter of type Integer. Supported values: 0 - the drivers are turned on
(Output/Forward direction); 1 - the drivers are turned off (Input/Reverse direction).

@subsubheading Outputs
If @var{direction} parameter is omitted, the pp_datadir() shall return current Data direction as the result @var{dir}.
@end deftypefn
@c Parallel pp_stat
@c -----------------------------------------
@subsection pp_stat
@cindex pp_stat
@deftypefn {Loadable Function} {@var{stat} = } pp_stat (@var{parallel})

Reads the Status lines.

@subsubheading Inputs
@var{parallel} - instance of @var{octave_parallel} class.@*

@subsubheading Outputs
The pp_stat() shall return current Status lines state as the result @var{stat}.
@end deftypefn
@c ---------------------------------------------------
@node Serial (Deprecated)
@section Serial (Deprecated)
@cindex Serial (Deprecated)
@c Serial (Deprecated) @octave_serial/fclose
@c -----------------------------------------
@subsection @@octave_serial/fclose
@cindex fclose
@deftypefn {Function File} {@var{res} =} fclose (@var{obj})
 Closes SERIAL connection @var{obj}
@end deftypefn
@c Serial (Deprecated) @octave_serial/flushinput
@c -----------------------------------------
@subsection @@octave_serial/flushinput
@cindex flushinput
@deftypefn {Loadable Function} {} flushinput (@var{serial})

 Flush the pending input, which will also make the BytesAvailable property be 0.

@subsubheading Inputs
@var{serial} - instance of @var{octave_serial} class.

@subsubheading Outputs
 None

@xseealso{srl_flush, flushoutput}
@end deftypefn
@c Serial (Deprecated) @octave_serial/flushoutput
@c -----------------------------------------
@subsection @@octave_serial/flushoutput
@cindex flushoutput
@deftypefn {Loadable Function} {} flushoutput (@var{serial})

 Flush the output buffer.

@subsubheading Inputs
@var{serial} - instance of @var{octave_serial} class.

@subsubheading Outputs
 None

@xseealso{srl_flush, flushinput}
@end deftypefn
@c Serial (Deprecated) @octave_serial/fopen
@c -----------------------------------------
@subsection @@octave_serial/fopen
@cindex fopen
@deftypefn {Function File} {@var{res} =} fopen (@var{obj}) (dummy)
 Opens SERIAL interface @var{obj}

 This currently is a dummy function to improve compatibility to MATLAB

@end deftypefn
@c Serial (Deprecated) @octave_serial/fprintf
@c -----------------------------------------
@subsection @@octave_serial/fprintf
@cindex fprintf
@deftypefn {Function File} {@var{numbytes} =} fprintf (@var{obj}, @var{template} ...)
 Writes formatted string @var{template} using optional parameters to
 serial instrument

@subsubheading Inputs
@var{obj} is a serial object.@*
@var{template} Format template string

@subsubheading Outputs
@var{numbytes} - number of bytes written to the serial device.

@end deftypefn
@c Serial (Deprecated) @octave_serial/fread
@c -----------------------------------------
@subsection @@octave_serial/fread
@cindex fread
@deftypefn {Function File} {@var{data} =} fread (@var{obj})
@deftypefnx {Function File} {@var{data} =} fread (@var{obj}, @var{size})
@deftypefnx {Function File} {@var{data} =} fread (@var{obj}, @var{size}, @var{precision})
@deftypefnx {Function File} {[@var{data},@var{count}] =} fread (@var{obj}, ...)
@deftypefnx {Function File} {[@var{data},@var{count},@var{errmsg}] =} fread (@var{obj}, ...)
 Reads @var{data} from serial instrument

@subsubheading Inputs
@var{obj} is a serial object.@*
@var{size} Number of values to read. (Default: 100).@*
@var{precision} precision of data.@*

@subsubheading Outputs
@var{data} The read data.@*
@var{count} values read.@*
@var{errmsg} read operation error message.@*

@end deftypefn
@c Serial (Deprecated) @octave_serial/fwrite
@c -----------------------------------------
@subsection @@octave_serial/fwrite
@cindex fwrite
@deftypefn {Function File} {@var{numbytes} = } fwrite (@var{obj}, @var{data})
@deftypefnx {Function File} {@var{numbytes} =} fwrite (@var{obj}, @var{data}, @var{precision})
 Writes @var{data} to serial instrument

@subsubheading Inputs
@var{obj} is a serial object.@*
@var{data} data to write.@*
@var{precision} precision of data.@*

@subsubheading Outputs
 returns number of bytes written.
@end deftypefn
@c Serial (Deprecated) @octave_serial/get
@c -----------------------------------------
@subsection @@octave_serial/get
@cindex get
@deftypefn {Function File} {@var{struct} = } get (@var{serial})
@deftypefnx {Function File} {@var{field} = } get (@var{serial}, @var{property})
 Get the properties of serial object.

@subsubheading Inputs
@var{serial} - instance of @var{octave_serial} class.@*
@var{property} - name of property.@*

@subsubheading Outputs
 When @var{property} was specified, return the value of that property.@*
 otherwise return the values of all properties as a structure.@*

@xseealso{@@octave_serial/set}
@end deftypefn
@c Serial (Deprecated) @octave_serial/serialbreak
@c -----------------------------------------
@subsection @@octave_serial/serialbreak
@cindex serialbreak
@deftypefn {Function File} {} serialbreak (@var{serial})
@deftypefnx {Function File} {} serialbreak (@var{serial}, @var{time})
 Send a break to the serial port

@subsubheading Inputs
@var{serial} - serial object@*
@var{time} - number of milliseconds to break for. If not specified a value of 10 will be used.

@subsubheading Outputs
 None

@xseealso{serial}
@end deftypefn
@c Serial (Deprecated) @octave_serial/set
@c -----------------------------------------
@subsection @@octave_serial/set
@cindex set
@deftypefn {Function File} set (@var{obj}, @var{property},@var{value})
@deftypefnx {Function File} set (@var{obj}, @var{property},@var{value},@dots{})
 Set the properties of serial object.

@subsubheading Inputs
@var{serial} - instance of @var{octave_serial} class.@*
@var{property} - name of property.@*

 If @var{property} is a cell so must be @var{value}, it sets the values of
 all matching properties.

 The function also accepts property-value pairs.

@subsubheading Properties
@table @var
@item 'baudrate'
 Set the baudrate of serial port. Supported values by instrument-control:
 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600,
 19200, 38400, 57600, 115200 and 230400. The supported baudrate of your
 serial port may be different.

@item 'bytesize'
 Set the bytesize. Supported values: 5, 6, 7 and 8.

@item 'name'
 Set the stored string name of the serial object.

@item 'parity'
 Set the parity value. Supported values: Even/Odd/None. This Parameter
 must be of type string. It is case insensitive and can be abbreviated
 to the first letter only

@item 'stopbits'
 Set the number of stopbits. Supported values: 1, 2.

@item 'timeout'
 Set the timeout value in tenths of a second. Value of -1 means a
 blocking call. Maximum value of 255 (i.e. 25.5 seconds).

@item 'requesttosend'
 Set the requesttosend (RTS) line.

@item 'dataterminalready'
 Set the dataterminalready (DTR) line.

@end table

@subsubheading Outputs
 None

@xseealso{@@octave_serial/get}
@end deftypefn
@c Serial (Deprecated) @octave_serial/srl_baudrate
@c -----------------------------------------
@subsection @@octave_serial/srl_baudrate
@cindex srl_baudrate
@deftypefn {Loadable Function} {} srl_baudrate (@var{serial}, @var{baudrate})\
@deftypefnx {Loadable Function} {@var{br} = } srl_baudrate (@var{serial})

 Set new or get existing serial interface baudrate parameter. Only standard values are supported.

@subsubheading Inputs
@var{serial} - instance of @var{octave_serial} class.@*
@var{baudrate} - the baudrate value used. Supported values: 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600 19200, 38400, 57600, 115200 and 230400.@*

 If @var{baudrate} parameter is omitted, the srl_baudrate() shall return current baudrate value as the result @var{br}.

@subsubheading Outputs
@var{br} - The currently set baudrate

 This function is obsolete. Use get and set method instead.

@end deftypefn
@c Serial (Deprecated) @octave_serial/srl_bytesize
@c -----------------------------------------
@subsection @@octave_serial/srl_bytesize
@cindex srl_bytesize
@deftypefn {Loadable Function} {} srl_bytesize (@var{serial}, @var{bsize})
@deftypefnx {Loadable Function} {@var{bs} = } srl_bytesize (@var{serial})

 Set new or get existing serial interface byte size parameter.

@subsubheading Inputs
@var{serial} - instance of @var{octave_serial} class.@*
@var{bsize} - byte size of type Integer. Supported values: 5/6/7/8.@*

 If @var{bsize} parameter is omitted, the srl_bytesize() shall return current byte size value
 or in case of unsupported setting -1, as the result @var{bs}.

 This function is obsolete. Use get and set method instead.

@subsubheading Outputs
@var{bs} -the currently set  byte size.

@end deftypefn
@c Serial (Deprecated) @octave_serial/srl_close
@c -----------------------------------------
@subsection @@octave_serial/srl_close
@cindex srl_close
@deftypefn {Loadable Function} {} srl_close (@var{serial})

 Close the interface and release a file descriptor.

@subsubheading Inputs
@var{serial} - instance of @var{octave_serial} class.

 This function is obsolete. Use fclose() method instead.

@subsubheading Outputs
 None

@end deftypefn
@c Serial (Deprecated) @octave_serial/srl_flush
@c -----------------------------------------
@subsection @@octave_serial/srl_flush
@cindex srl_flush
@deftypefn {Loadable Function} {} srl_flush (@var{serial}, [@var{q}])

Flush the pending input/output.

@subsubheading Inputs
@var{serial} - instance of @var{octave_serial} class.@*
@var{q} - queue selector of type Integer. Supported values:@*
@table @asis
@item 0
 flush untransmitted output
@item 1
 flush pending input
@item 2
 flush both pending input and untransmitted output.
@end table

 If @var{q} parameter is omitted, the srl_flush() shall flush both, input and output buffers.

@subsubheading Outputs
 None

@end deftypefn
@c Serial (Deprecated) @octave_serial/srl_parity
@c -----------------------------------------
@subsection @@octave_serial/srl_parity
@cindex srl_parity
@deftypefn {Loadable Function} {} srl_parity (@var{serial}, @var{parity})
@deftypefnx {Loadable Function} {@var{p} = } srl_parity (@var{serial})

 Set new or get existing serial interface parity parameter. Even/Odd/None values are supported.

@subsubheading Inputs
@var{serial} - instance of @var{octave_serial} class.@*
@var{parity} - parity value of type String. Supported values:
 Even/Odd/None (case insensitive, can be abbreviated to the first letter only)@*

 If @var{parity} parameter is omitted, the srl_parity() shall return current parity value as the result @var{p}.

 This function is obsolete. Use get and set method instead.

@subsubheading Outputs
@var{p} - The currently set parity

@end deftypefn
@c Serial (Deprecated) @octave_serial/srl_stopbits
@c -----------------------------------------
@subsection @@octave_serial/srl_stopbits
@cindex srl_stopbits
@deftypefn {Loadable Function} {} srl_stopbits (@var{serial}, @var{stopb})
@deftypefnx {Loadable Function} {@var{sb} = } srl_stopbits (@var{serial})

 Set new or get existing serial interface stop bits parameter. Only 1 or 2 stop bits are supported.

@subsubheading Inputs
@var{serial} - instance of @var{octave_serial} class.@*
@var{stopb} - number of stop bits used. Supported values: 1, 2.@*

@subsubheading Outputs
 If @var{stopb} parameter is omitted, the srl_stopbits() shall return current stop bits value as the result @var{sb}.

 This function is obsolete. Use get and set method instead.

@end deftypefn
@c Serial (Deprecated) @octave_serial/srl_timeout
@c -----------------------------------------
@subsection @@octave_serial/srl_timeout
@cindex srl_timeout
@deftypefn {Loadable Function} {} srl_timeout (@var{serial}, @var{timeout})
@deftypefnx {Loadable Function} {@var{t} = } srl_timeout (@var{serial})

 Set new or get existing serial interface timeout parameter used for srl_read() requests. The timeout value is specified in tenths of a second.

@subsubheading Inputs
@var{serial} - instance of @var{octave_serial} class.@*
@var{timeout} - srl_read() timeout value in tenths of a second.
 A value of -1 means a blocking call. Maximum value of 255 (i.e. 25.5 seconds).@*

@subsubheading Outputs
 If @var{timeout} parameter is omitted, the srl_timeout() shall return current timeout value as the result @var{t}.

 This function is obsolete. Use get and set method instead.

@end deftypefn
@c Serial (Deprecated) serial
@c -----------------------------------------
@subsection serial
@cindex serial
@deftypefn {Loadable Function} {@var{serial} = } serial ([@var{path}], [@var{baudrate}], [@var{timeout}])

Open serial interface.

@subsubheading Inputs
@var{path} - the interface path of type String. @*
@var{baudrate} - the baudrate of interface. If omitted defaults to 115200. @*
@var{timeout} - the interface timeout value. If omitted defaults to blocking call.

@subsubheading Outputs
The serial() shall return an instance of @var{octave_serial} class as the result @var{serial}.
@subsubheading Properties
The serial object has the following public properties:
@table @asis
@item name
name assigned to the object
@item type
instrument type 'serial' (readonly)
@item port
OS specific port name (readonly)
@item status
status of the object 'open' or 'closed' (readonly)
@item timeout
timeout value used for waiting for data
@item bytesavailable
number of bytes currently available to read (readonly)
@item stopbits
number of stopbits to use
@item requesttosend
request to send state - 'on' or 'off'
@item parity
Parity setting 'none', 'even', 'odd'
@item bytesize
Number of bits to a byte (7 or 8)
@item baudrate
Baudrate setting
@item dataterminalready
state of dataterminal ready - 'on' or 'off'
@item pinstatus
current state of pins (readonly)
@end table 
@end deftypefn
@c Serial (Deprecated) seriallist
@c -----------------------------------------
@subsection seriallist
@cindex seriallist
@deftypefn {Function File} {@var{list} = } seriallist ()
 Returns a list of all serial ports detected in the system.

@subsubheading Inputs
 None

@subsubheading Outputs
@var{list} is a string cell array of serial ports names detected
 in the system.

@xseealso{instrhwinfo("serial")}
@end deftypefn
@c Serial (Deprecated) srl_read
@c -----------------------------------------
@subsection srl_read
@cindex srl_read
@deftypefn {Loadable Function} {[@var{data}, @var{count}] = } srl_read (@var{serial}, @var{n})

Read from serial interface.

@subsubheading Inputs
@var{serial} - instance of @var{octave_serial} class.@*
@var{n} - number of bytes to attempt to read of type Integer.

@subsubheading Outputs
The srl_read() shall return number of bytes successfully read in @var{count} as Integer and the bytes themselves in @var{data} as uint8 array.
@end deftypefn
@c Serial (Deprecated) srl_write
@c -----------------------------------------
@subsection srl_write
@cindex srl_write
@deftypefn {Loadable Function} {@var{n} = } srl_write (@var{serial}, @var{data})

Write data to a serial interface.

@subsubheading Inputs
@var{serial} - instance of @var{octave_serial} class.@*
@var{data} - data to be written to the serial interface. Can be either of String or uint8 type.

@subsubheading Outputs
Upon successful completion, srl_write() shall return the number of bytes written as the result @var{n}.
@end deftypefn
@c ---------------------------------------------------
@node Serial Port
@section Serial Port
@cindex Serial Port
@c Serial Port @octave_serialport/configureTerminator
@c -----------------------------------------
@subsection @@octave_serialport/configureTerminator
@cindex configureTerminator
@deftypefn {Function File} {} configureTerminator (@var{serial}, @var{term})
@deftypefnx {Function File} {} configureTerminator (@var{serial}, @var{readterm}, @var{writeterm})
 Set terminator for ASCII string manipulation

@subsubheading Inputs
@var{serial} - serialport object@*
@var{term} - terminal value for both read and write@*
@var{readterm} = terminal value type for read data@*
@var{writeterm} = terminal value for written data@*

 The terminal can be either strings "cr", "lf" (default), "lf/cr" or an integer between 0 to 255.

@subsubheading Outputs
 None

@xseealso{serialport}
@end deftypefn
@c Serial Port @octave_serialport/flush
@c -----------------------------------------
@subsection @@octave_serialport/flush
@cindex flush
@deftypefn {} {@var{data} =} flush (@var{dev})
@deftypefnx {} {@var{data} =} flush (@var{dev}, "input")
@deftypefnx {} {@var{data} =} flush (@var{dev}, "output")
 Flush the serial port buffers

@subsubheading Inputs
@var{dev} - connected serialport device

 If an additional parameter is provided of "input" or "output",
 then only the input or output buffer will be flushed

@subsubheading Outputs
 None

@xseealso{serialport}
@end deftypefn
@c Serial Port @octave_serialport/fprintf
@c -----------------------------------------
@subsection @@octave_serialport/fprintf
@cindex fprintf
@deftypefn {Function File} {@var{numbytes} =} fprintf (@var{obj}, @var{template} ...)
 Writes formatted string @var{template} using optional parameters to
 serialport instrument

@subsubheading Inputs
@var{obj} is a serialport object.@*
@var{template} Format template string

@subsubheading Outputs
@var{numbytes} - number of bytes written to the serial device.

@end deftypefn
@c Serial Port @octave_serialport/fread
@c -----------------------------------------
@subsection @@octave_serialport/fread
@cindex fread
@deftypefn {Function File} {@var{data} =} fread (@var{obj})
@deftypefnx {Function File} {@var{data} =} fread (@var{obj}, @var{size})
@deftypefnx {Function File} {@var{data} =} fread (@var{obj}, @var{size}, @var{precision})
@deftypefnx {Function File} {[@var{data},@var{count}] =} fread (@var{obj}, ...)
@deftypefnx {Function File} {[@var{data},@var{count},@var{errmsg}] =} fread (@var{obj}, ...)
 Reads @var{data} from serial port instrument

@subsubheading Inputs
@var{obj} is a serialport object.@*
@var{size} Number of values to read.@*
@var{precision} precision of data.@*

@subsubheading Outputs
@var{data} The read data.@*
@var{count} number of values read.@*
@var{errmsg} read operation error message.@*

@end deftypefn
@c Serial Port @octave_serialport/fwrite
@c -----------------------------------------
@subsection @@octave_serialport/fwrite
@cindex fwrite
@deftypefn {Function File} {@var{numbytes} = } fwrite (@var{obj}, @var{data})
@deftypefnx {Function File} {@var{numbytes} =} fwrite (@var{obj}, @var{data}, @var{precision})
 Writes @var{data} to serial port instrument

@subsubheading Inputs
@var{obj} is a serial port object.@*
@var{data} data to write.@*
@var{precision} precision of data.@*

@subsubheading Outputs
 returns number of bytes written.
@end deftypefn
@c Serial Port @octave_serialport/get
@c -----------------------------------------
@subsection @@octave_serialport/get
@cindex get
@deftypefn {Function File} {@var{struct} = } get (@var{serial})
@deftypefnx {Function File} {@var{field} = } get (@var{serial}, @var{property})
 Get the properties of serialport object.

@subsubheading Inputs
@var{serial} - instance of @var{octave_serialport} class.@*
@var{property} - name of property.@*

@subsubheading Outputs
 When @var{property} was specified, return the value of that property.@*
 otherwise return the values of all properties as a structure.@*

@xseealso{@@octave_serial/set}
@end deftypefn
@c Serial Port @octave_serialport/getpinstatus
@c -----------------------------------------
@subsection @@octave_serialport/getpinstatus
@cindex getpinstatus
@deftypefn {Function File} {@var{status}} getpinstatus (@var{serial})
 Get status of serial pins

@subsubheading Inputs
@var{serial} - serial object@*

@subsubheading Outputs
@var{status} - a structure with the logic names of ClearToSend, DataSetReady, CarrierDetect, and RingIndicator

@xseealso{serialport}
@end deftypefn
@c Serial Port @octave_serialport/read
@c -----------------------------------------
@subsection @@octave_serialport/read
@cindex read
@deftypefn {} {@var{data} =} read (@var{dev}, @var{count})
@deftypefnx {} {@var{data} =} read (@var{dev}, @var{count}, @var{precision})
 Read a specified number of values from a serialport
 using optional precision for valuesize.

@subsubheading Inputs
@var{dev} - connected serialport device

@var{count} - number of elements to read

@var{precision} - Optional precision for the output data read data.
 Currently known precision values are uint8 (default), int8, uint16, int16, uint32, int32, uint64, uint64

@subsubheading Outputs
@var{data} - data read from the device

@xseealso{serialport}
@end deftypefn
@c Serial Port @octave_serialport/serialbreak
@c -----------------------------------------
@subsection @@octave_serialport/serialbreak
@cindex serialbreak
@deftypefn {Function File} {} serialbreak (@var{serial})
@deftypefnx {Function File} {} serialbreak (@var{serial}, @var{time})
 Send a break to the serial port

@subsubheading Inputs
@var{serial} - serialport object@*
@var{time} - number of milliseconds to break for. If not specified a value of 10 will be used.

@subsubheading Outputs
 None

@xseealso{serial}
@end deftypefn
@c Serial Port @octave_serialport/set
@c -----------------------------------------
@subsection @@octave_serialport/set
@cindex set
@deftypefn {Function File} set (@var{obj}, @var{property},@var{value})
@deftypefnx {Function File} set (@var{obj}, @var{property},@var{value},@dots{})
 Set the properties of serialport object.

@subsubheading Inputs
@var{serial} - instance of @var{octave_serialport} class.@*
@var{property} - name of property.@*

 If @var{property} is a cell so must be @var{value}, it sets the values of
 all matching properties.

 The function also accepts property-value pairs.

@subsubheading Properties
@table @var
@item 'baudrate'
 Set the baudrate of serial port. Supported values by instrument-control:
 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600,
 19200, 38400, 57600, 115200 and 230400. The supported baudrate of your
 serial port may be different.

@item 'bytesize'
 Set the bytesize. Supported values: 5, 6, 7 and 8.

@item 'name'
 Set the stored string name of the serial object.

@item 'parity'
 Set the parity value. Supported values: Even/Odd/None. This Parameter
 must be of type string. It is case insensitive and can be abbreviated
 to the first letter only

@item 'stopbits'
 Set the number of stopbits. Supported values: 1, 2.

@item 'timeout'
 Set the timeout value in tenths of a second. Value of -1 means a
 blocking call. Maximum value of 255 (i.e. 25.5 seconds).

@item 'requesttosend'
 Set the requesttosend (RTS) line.

@item 'dataterminalready'
 Set the dataterminalready (DTR) line.

@end table

@subsubheading Outputs
 None

@xseealso{@@octave_serialport/-get}
@end deftypefn
@c Serial Port @octave_serialport/setDTR
@c -----------------------------------------
@subsection @@octave_serialport/setDTR
@cindex setDTR
@deftypefn {} {} setDTR (@var{dev}, @var{true_false})
 Set the state of the DTR line

@subsubheading Inputs
@var{dev} - connected serial device.@*
@var{true_false} - state to set the line.@*

@subsubheading Outputs
 None

@xseealso{serialport, getpinstatus, setRTS}
@end deftypefn
@c Serial Port @octave_serialport/setRTS
@c -----------------------------------------
@subsection @@octave_serialport/setRTS
@cindex setRTS
@deftypefn {} {} setRTS (@var{dev}, @var{true_false})
 Set the state of the RTS line

@subsubheading Inputs
@var{dev} - connected serial device.@*
@var{true_false} - state to set the line.@*

@subsubheading Outputs
 None

@xseealso{serialport, getpinstatus}
@end deftypefn
@c Serial Port @octave_serialport/write
@c -----------------------------------------
@subsection @@octave_serialport/write
@cindex write
@deftypefn {Function File} {@var{numbytes} = } write (@var{obj}, @var{data})
@deftypefnx {Function File} {@var{numbytes} =} write (@var{obj}, @var{data}, @var{precision})
 Writes @var{data} to serialport instrument

@subsubheading Inputs
@var{obj} is a serialport object.@*
@var{data} data to write.@*
@var{precision} precision of data.@*

@subsubheading Outputs
 returns number of bytes written.
@end deftypefn
@c Serial Port serialport
@c -----------------------------------------
@subsection serialport
@cindex serialport
@deftypefn {Loadable Function} {@var{serial} = } serialport ([@var{path}], [@var{baudrate}])
@deftypefnx {Loadable Function} {@var{serial} = } serialport ([@var{path}], [@var{propname}, @var{propvalue}])

Open serial port interface.

@subsubheading Inputs
@var{path} - the interface path of type String. @*
@var{baudrate} - the baudrate of interface.@*
@var{propname},@var{propvalue} - property name/value pairs.

Known input properties:
@table @asis
@item BaudRate
Numeric baudrate value
@item Timeout
Numeric timeout value in seconds or -1 to wait forever
@item StopBits
number of stopbits to use
@item Parity
Parity setting 'none', 'even', 'odd'
@item DataBits
Number of bits to a byte (5 to 8)
@item FlowControl
Number of bits to a byte 'none', 'hardware', 'software'
@end table

@subsubheading Outputs
The serialport() shall return an instance of @var{octave_serialport} class as the result @var{serial}.

@subsubheading Properties
The serial object has the following public properties:
@table @asis
@item Name
name assigned to the object
@item Type
instrument type 'serial' (readonly)
@item Port
OS specific port name (readonly)
@item Status
status of the object 'open' or 'closed' (readonly)
@item Timeout
timeout value used for waiting for data
@item NumBytesAvailable
number of bytes currently available to read (readonly)
@item NumBytesWritten
number of bytes written (readonly)
@item StopBits
number of stopbits to use
@item Parity
Parity setting 'none', 'even', 'odd'
@item DataBits
Number of bits to a byte (5 to 8)
@item BaudRate
Baudrate setting
@item FlowControl
Number of bits to a byte 'none', 'hardware', 'software'
@item PinStatus
current state of pins (readonly)
@item UserData
user defined data
@end table 
@end deftypefn
@c Serial Port serialportlist
@c -----------------------------------------
@subsection serialportlist
@cindex serialportlist
@deftypefn {Function File} {@var{list} = } serialportlist ()
@deftypefnx {Function File} {@var{list} = } serialportlist ("all")
@deftypefnx {Function File} {@var{list} = } serialportlist ("available")
 Returns a list of all serial ports detected in the system.

@subsubheading Inputs
 'all' - show all serial ports (same as providing no arguments)
 'available' - show only serial ports that are available for use

@subsubheading Outputs
@var{list} is a string cell array of serial ports names detected
 in the system.

@xseealso{instrhwinfo("serialport")}
@end deftypefn
@c ---------------------------------------------------
@node SPI
@section SPI
@cindex SPI
@c SPI @octave_spi/fclose
@c -----------------------------------------
@subsection @@octave_spi/fclose
@cindex fclose
@deftypefn {Function File} {@var{res} =} fclose (@var{obj})
 Closes SPI connection @var{obj}
@end deftypefn
@c SPI @octave_spi/fopen
@c -----------------------------------------
@subsection @@octave_spi/fopen
@cindex fopen
@deftypefn {Function File} {@var{res} =} fopen (@var{obj}) (dummy)
 Opens SPI connection @var{obj}

 This currently is a dummy function to improve compatibility to MATLAB

@end deftypefn
@c SPI @octave_spi/fread
@c -----------------------------------------
@subsection @@octave_spi/fread
@cindex fread
@deftypefn {Function File} {@var{data} =} fread (@var{obj})
@deftypefnx {Function File} {@var{data} =} fread (@var{obj}, @var{size})
@deftypefnx {Function File} {@var{data} =} fread (@var{obj}, @var{size}, @var{precision})
@deftypefnx {Function File} {[@var{data},@var{count}] =} fread (@var{obj}, ...)
@deftypefnx {Function File} {[@var{data},@var{count},@var{errmsg}] =} fread (@var{obj}, ...)
 Reads @var{data} from a SPI instrument

@subsubheading Inputs
@var{obj} is a SPI object.@*
@var{size} Number of values to read. (Default: 10).@*
@var{precision} precision of data.@*

@subsubheading Outputs
@var{data} data values.@*
@var{count} number of values read.@*
@var{errmsg} read operation error message.@*

@end deftypefn
@c SPI @octave_spi/fwrite
@c -----------------------------------------
@subsection @@octave_spi/fwrite
@cindex fwrite
@deftypefn {Function File} {@var{numbytes} = } fwrite (@var{obj}, @var{data})
@deftypefnx {Function File} {@var{numbytes} =} fwrite (@var{obj}, @var{data}, @var{precision})
 Writes @var{data} to SPI instrument

@subsubheading Inputs
@var{obj} is a SPI object.@*
@var{data} data to write.@*
@var{precision} precision of data.@*

@subsubheading Outputs
 returns number of bytes written.
@end deftypefn
@c SPI @octave_spi/get
@c -----------------------------------------
@subsection @@octave_spi/get
@cindex get
@deftypefn {Function File} {@var{struct} = } get (@var{spi})
@deftypefnx {Function File} {@var{field} = } get (@var{spi}, @var{property})
 Get the properties of spi object.

@subsubheading Inputs
@var{spi} - instance of @var{octave_spi} class.@*

@var{property} - name of property.@*

@subsubheading Properties
@table @var
@item 'name'
 Name for the spi socket.

@item 'bitrate'
 The bitrate for the spi object.

@item 'clockpolarity'
 The clock polarity for the spi object of 'idlehigh' or 'idlelow'.

@item 'clockphase'
 The clock phase for the spi object of 'firstedge' or 'secondedge'.

@item 'port'
 The device port name.

@item 'status'
 The device status of 'open' or 'closed'
@end table

@subsubheading Outputs
 When @var{property} was specified, return the value of that property.@*
 otherwise return the values of all properties as a structure.@*

@xseealso{@@octave_spi/set}
@end deftypefn
@c SPI @octave_spi/read
@c -----------------------------------------
@subsection @@octave_spi/read
@cindex read
@deftypefn {Function File} {@var{data} =} read (@var{obj})
@deftypefnx {Function File} {@var{data} =} read (@var{obj}, @var{size})
 Reads @var{data} from SPI instrument

@subsubheading Inputs
@var{obj} is a SPI object.@*
@var{size} Number of values to read. (Default: 10).@*

@subsubheading Outputs
@var{data} data values.@*

@end deftypefn
@c SPI @octave_spi/set
@c -----------------------------------------
@subsection @@octave_spi/set
@cindex set
@deftypefn {Function File} set (@var{obj}, @var{property},@var{value})
@deftypefnx {Function File} set (@var{obj}, @var{property},@var{value},@dots{})
 Set the properties of spi object.

@subsubheading Inputs
@var{obj} - instance of @var{octave_spi} class.@*
@var{property} - name of property.@*

 If @var{property} is a cell so must be @var{value}, it sets the values of
 all matching properties.

 The function also accepts property-value pairs.

@subsubheading Properties
@table @var
@item 'name'
 Set the name for the spi socket.

@item 'bitrate'
 Set the bitrate for the spi object.

@item 'clockpolarity'
 Set the clock polarity for the spi object of 'idlehigh' or 'idlelow'.

@item 'clockphase'
 Set the clock phase for the spi object of 'firstedge' or 'secondedge'.

@end table

@subsubheading Outputs
 None

@xseealso{@@octave_spi/get}
@end deftypefn
@c SPI @octave_spi/write
@c -----------------------------------------
@subsection @@octave_spi/write
@cindex write
@deftypefn {Function File} {@var{numbytes} = } fwrite (@var{obj}, @var{data})
 Writes @var{data} to SPI instrument

@subsubheading Inputs
@var{obj} is a SPI object.@*
@var{data} data to write.@*

@subsubheading Outputs
 returns number of bytes written.
@end deftypefn
@c SPI @octave_spi/writeAndRead
@c -----------------------------------------
@subsection @@octave_spi/writeAndRead
@cindex writeAndRead
@deftypefn {Function File} {@var{data} =} writeAndRead (@var{obj}, @var{wrdata})
 Writes and reads @var{data} from SPI instrument

@subsubheading Inputs
@var{obj} is a SPI object.@*
@var{wrdata} Data to write.@*

@subsubheading Outputs
@var{data} data values read.@*

@end deftypefn
@c SPI spi
@c -----------------------------------------
@subsection spi
@cindex spi
@deftypefn {Loadable Function} {@var{spi} = } spi ([@var{port_path}])
@deftypefnx {Loadable Function} {@var{spi} = } spi ([@var{port_path}], [@var{propname}, @var{propvalue}])

Open a spi interface.

@subsubheading Inputs
@var{port_path} - the interface device port/path of type String. If omitted defaults to 
'/dev/spi-0'. @*
@var{propname},@var{propvalue} - property name/value pairs.

Known input properties:
@table @asis
@item name
Name of the object
@item bitrate
Numeric bitrate value
@item clockpolarity
Clock polarity: idlehigh or idlelow.
@item clockphase
Clock phase value: firstedge or secondedge
@end table

@subsubheading Outputs
@var{spi} - An instance of @var{octave_spi} class.

@subsubheading Properties
The spi object has the following properties:
@table @asis
@item name
Name of the object
@item status
Open or closed status of object (readonly).
@item bitrate
Numeric bitrate value
@item clockpolarity
Clock polarity: idlehigh or idlelow.
@item clockphase
Clock phase value: firstedge or secondedge
@item port
The interface driver port (readonly)
@end table
@end deftypefn
@c SPI spi_close
@c -----------------------------------------
@subsection spi_close
@cindex spi_close
@deftypefn {Loadable Function} {} spi_close (@var{spi})

Close the interface and release a file descriptor.

@subsubheading Inputs
@var{spi} - instance of @var{octave_spi} class.@*

@subsubheading Outputs
None
@end deftypefn
@c SPI spi_read
@c -----------------------------------------
@subsection spi_read
@cindex spi_read
@deftypefn {Loadable Function} {[@var{data}, @var{count}] = } spi_read (@var{spi}, @var{n})

Read from spi slave device.

@subsubheading Inputs
@var{spi} - instance of @var{octave_spi} class.@*
@var{n} - number of bytes to attempt to read of type Integer.

@subsubheading Outputs
The spi_read() shall return number of bytes successfully read in @var{count} as Integer and the bytes themselves in @var{data} as uint8 array.
@end deftypefn
@c SPI spi_write
@c -----------------------------------------
@subsection spi_write
@cindex spi_write
@deftypefn {Loadable Function} {@var{n} = } spi_write (@var{spi}, @var{data})

Write data to a spi slave device.

@subsubheading Inputs
@var{spi} - instance of @var{octave_spi} class.@*
@var{data} - data, of type uint8, to be written to the slave device.

@subsubheading Outputs
Upon successful completion, spi_write() shall return the number of bytes written as the result @var{n}.
@end deftypefn
@c SPI spi_writeAndRead
@c -----------------------------------------
@subsection spi_writeAndRead
@cindex spi_writeAndRead
@deftypefn {Loadable Function} {@var{rddata} = } spi_writeAndRead (@var{spi}, @var{wrdata})

Write data to a spi slave device and then read same number of values.

@subsubheading Inputs
@var{spi} - instance of @var{octave_spi} class.@*
@var{wrdata} - data, of type uint8, to be written to the slave device.@*

@subsubheading Outputs
Upon successful completion, spi_writeAndRead() shall return the bytes read.
@end deftypefn
@c ---------------------------------------------------
@node TCP (Deprecated)
@section TCP (Deprecated)
@cindex TCP (Deprecated)
@c TCP (Deprecated) @octave_tcp/fclose
@c -----------------------------------------
@subsection @@octave_tcp/fclose
@cindex fclose
@deftypefn {Function File} {@var{res} =} fclose (@var{obj})
 Closes TCP connection @var{obj}
@end deftypefn
@c TCP (Deprecated) @octave_tcp/flush
@c -----------------------------------------
@subsection @@octave_tcp/flush
@cindex flush
@deftypefn {} {@var{data} =} flush (@var{dev})
@deftypefnx {} {@var{data} =} flush (@var{dev}, "input")
@deftypefnx {} {@var{data} =} flush (@var{dev}, "output")
 Flush the tcp socket buffers

@subsubheading Inputs
@var{dev} - connected tcp device

 If an additional parameter is provided of "input" or "output",
 then only the input or output buffer will be flushed

@subsubheading Outputs
 None

@xseealso{serialport}
@end deftypefn
@c TCP (Deprecated) @octave_tcp/flushinput
@c -----------------------------------------
@subsection @@octave_tcp/flushinput
@cindex flushinput
@deftypefn {Loadable Function} {} flushinput (@var{tcp})

 Flush the pending input, which will also make the BytesAvailable property be 0.

@subsubheading Inputs
@var{tcp} - instance of @var{octave_tcp} class.

@subsubheading Outputs
 None.

@xseealso{flushoutput}
@end deftypefn
@c TCP (Deprecated) @octave_tcp/flushoutput
@c -----------------------------------------
@subsection @@octave_tcp/flushoutput
@cindex flushoutput
@deftypefn {Loadable Function} {} flushoutput (@var{tcp})

 Flush the output buffer.

@subsubheading Inputs
@var{tcp} - instance of @var{octave_tcp} class.

@subsubheading Outputs
 None.

@xseealso{flushinput}
@end deftypefn
@c TCP (Deprecated) @octave_tcp/fopen
@c -----------------------------------------
@subsection @@octave_tcp/fopen
@cindex fopen
@deftypefn {Function File} {@var{res} =} fopen (@var{obj}) (dummy)
 Opens TCP connection @var{obj}

 This currently is a dummy function to improve compatibility to MATLAB

@end deftypefn
@c TCP (Deprecated) @octave_tcp/fprintf
@c -----------------------------------------
@subsection @@octave_tcp/fprintf
@cindex fprintf
@deftypefn {Function File} {@var{numbytes} =} fprintf (@var{obj}, @var{template} ...)
 Writes formatted string @var{template} using optional parameters to
 TCP instrument

@subsubheading Inputs
@var{obj} is a TCP object.@*
@var{template} Format template string

@subsubheading Outputs
 Number of characters written

@end deftypefn
@c TCP (Deprecated) @octave_tcp/fread
@c -----------------------------------------
@subsection @@octave_tcp/fread
@cindex fread
@deftypefn {Function File} {@var{data} =} fread (@var{obj})
@deftypefnx {Function File} {@var{data} =} fread (@var{obj}, @var{size})
@deftypefnx {Function File} {@var{data} =} fread (@var{obj}, @var{size}, @var{precision})
@deftypefnx {Function File} {[@var{data},@var{count}] =} fread (@var{obj}, ...)
@deftypefnx {Function File} {[@var{data},@var{count},@var{errmsg}] =} fread (@var{obj}, ...)
 Reads @var{data} from TCP instrument

@subsubheading Inputs
@var{obj} is a TCP object.@*
@var{size} Number of values to read. (Default: 100).@*
@var{precision} precision of data.@*

@subsubheading Outputs
@var{data} data read.@*
@var{count} values read.@*
@var{errmsg} read operation error message.@*

@end deftypefn
@c TCP (Deprecated) @octave_tcp/fwrite
@c -----------------------------------------
@subsection @@octave_tcp/fwrite
@cindex fwrite
@deftypefn {Function File} {@var{numbytes} = } fwrite (@var{obj}, @var{data})
@deftypefnx {Function File} {@var{numbytes} =} fwrite (@var{obj}, @var{data}, @var{precision})
 Writes @var{data} to TCP instrument

@subsubheading Inputs
@var{obj} is a TCP object.@*
@var{data} data to write.@*
@var{precision} precision of data.@*

@subsubheading Outputs
 returns number of bytes written.
@end deftypefn
@c TCP (Deprecated) @octave_tcp/get
@c -----------------------------------------
@subsection @@octave_tcp/get
@cindex get
@deftypefn {Function File} {@var{struct} = } get (@var{tcp})
@deftypefnx {Function File} {@var{field} = } get (@var{tcp}, @var{property})
 Get the properties of tcp object.

@subsubheading Inputs
@var{tcp} - instance of @var{octave_tcp} class.@*
@var{property} - name of property.@*

@subsubheading Outputs
 When @var{property} was specified, return the value of that property.@*
 otherwise return the values of all properties as a structure.@*

@xseealso{@@octave_tcp/set}
@end deftypefn
@c TCP (Deprecated) @octave_tcp/read
@c -----------------------------------------
@subsection @@octave_tcp/read
@cindex read
@deftypefn {Function File} {@var{data} =} read (@var{obj})
@deftypefnx {Function File} {@var{data} =} read (@var{obj}, @var{size})
@deftypefnx {Function File} {@var{data} =} read (@var{obj}, @var{size}, @var{datatype})
 Reads @var{data} from TCP instrument

@subsubheading Inputs
@var{obj} is a TCP object.@*
@var{size} Number of values to read. (Default: 100).@*
@var{datatype} datatype of data.@*

@subsubheading Outputs
@var{data} data read.@*

@end deftypefn
@c TCP (Deprecated) @octave_tcp/set
@c -----------------------------------------
@subsection @@octave_tcp/set
@cindex set
@deftypefn {Function File} set (@var{obj}, @var{property},@var{value})
@deftypefnx {Function File} set (@var{obj}, @var{property},@var{value},@dots{})
 Set the properties of tcp object.

@subsubheading Inputs
 If @var{property} is a cell so must be @var{value}, it sets the values of
 all matching properties.

 The function also accepts property-value pairs.

@subsubheading Properties
@table @var
@item 'name'
 Set the name for the tcp socket.

@item 'remotehost'
 Set the remote host name for the tcp socket.

@item 'remoteport'
 Set the remote port for the tcp socket.

@item 'timeout'
 Set the timeout value in seconds. Value of -1 means a
 blocking call.

@end table

@subsubheading Outputs
 None

@xseealso{@@octave_tcp/get}
@end deftypefn
@c TCP (Deprecated) @octave_tcp/write
@c -----------------------------------------
@subsection @@octave_tcp/write
@cindex write
@deftypefn {Function File} {@var{numbytes} = } write (@var{obj}, @var{data})
@deftypefnx {Function File} {@var{numbytes} =} write (@var{obj}, @var{data}, @var{datatype})
 Writes @var{data} to TCP instrument

@subsubheading Inputs
@var{obj} is a TCP object.@*
@var{data} data to write.@*
@var{datatype} datatype of data. If not specified, it defaults to "uint8".@*

@subsubheading Outputs
 returns number of bytes written.
@end deftypefn
@c TCP (Deprecated) tcp
@c -----------------------------------------
@subsection tcp
@cindex tcp
@deftypefn {Loadable Function} {@var{tcp} = } tcp ()
@deftypefnx {Loadable Function} {@var{tcp} = } tcp (@var{ipaddress})
@deftypefnx {Loadable Function} {@var{tcp} = } tcp (@var{ipaddress}, @var{port})
@deftypefnx {Loadable Function} {@var{tcp} = } tcp (@var{ipaddress}, @var{port}, @var{timeout})
@deftypefnx {Loadable Function} {@var{tcp} = } tcp (@var{ipaddress}, [@var{propertyname}, @var{propertyvalue}])
@deftypefnx {Loadable Function} {@var{tcp} = } tcp (@var{ipaddress}, @var{port}, [@var{propertyname}, @var{propertyvalue}])

Open tcp interface.

@subsubheading Inputs
@var{ipaddress} - the ip address of type String. If omitted defaults to '127.0.0.1'.@*
@var{port} - the port number to connect. If omitted defaults to 23.@*
@var{timeout} - the interface timeout value. If omitted defaults to blocking call.@*
@var{propname},@var{propvalue} - property name/value pairs.

Known input properties:
@table @asis
@item name
name value
@item timeout
Numeric timeout value or -1 to wait forever
@end table

@subsubheading Outputs
The tcp() shall return instance of @var{octave_tcp} class as the result @var{tcp}.
@subsubheading Properties
The tcp object has the following public properties:
@table @asis
@item name
name assigned to the tcp object
@item type
instrument type 'tcp' (readonly)
@item localport
local port number (readonly)
@item remoteport
remote port number
@item remotehost
remote host
@item status
status of the object 'open' or 'closed' (readonly)
@item timeout
timeout value in seconds used for waiting for data
@item bytesavailable
number of bytes currently available to read (readonly)
@end table 
@end deftypefn
@c TCP (Deprecated) tcp_close
@c -----------------------------------------
@subsection tcp_close
@cindex tcp_close
@deftypefn {Loadable Function} {} tcp_close (@var{tcp})

Close the interface and release a file descriptor.

@subsubheading Inputs
@var{tcp} - instance of @var{octave_tcp} class.

@subsubheading Outputs
None
@end deftypefn
@c TCP (Deprecated) tcp_read
@c -----------------------------------------
@subsection tcp_read
@cindex tcp_read
@deftypefn {Loadable Function} {[@var{data}, @var{count}] = } tcp_read (@var{tcp}, @var{n}, @var{timeout})

Read from tcp interface.

@subsubheading Inputs
@var{tcp} - instance of @var{octave_tcp} class.@*
@var{n} - number of bytes to attempt to read of type Integer@*
@var{timeout} - timeout in ms if different from default of type Integer

@subsubheading Outputs
@var{count} - number of bytes successfully read as an Integer@*
@var{data} - data bytes themselves as uint8 array.
@end deftypefn
@c TCP (Deprecated) tcp_timeout
@c -----------------------------------------
@subsection tcp_timeout
@cindex tcp_timeout
@deftypefn {Loadable Function} {} tcp_timeout (@var{tcp}, @var{timeout})
@deftypefnx {Loadable Function} {@var{t} = } tcp_timeout (@var{tcp})

Set new or get existing tcp interface timeout parameter used for tcp_read() requests. The timeout value is specified in milliseconds.

@subsubheading Inputs
@var{tcp} - instance of @var{octave_tcp} class.@*
@var{timeout} - tcp_read() timeout value in milliseconds. Value of -1 means a blocking call.

@subsubheading Outputs
If @var{timeout} parameter is omitted, the tcp_timeout() shall return current timeout value as the result @var{t}.
@end deftypefn
@c TCP (Deprecated) tcp_write
@c -----------------------------------------
@subsection tcp_write
@cindex tcp_write
@deftypefn {Loadable Function} {@var{n} = } tcp_write (@var{tcp}, @var{data})

Write data to a tcp interface.

@subsubheading Inputs
@var{tcp} - instance of @var{octave_tcp} class.@*
@var{data} - data to be written to the tcp interface. Can be either of String or uint8 type.

@subsubheading Outputs
Upon successful completion, tcp_write() shall return the number of bytes written as the result @var{n}.
@end deftypefn
@c TCP (Deprecated) tcpip
@c -----------------------------------------
@subsection tcpip
@cindex tcpip
@deftypefn {Function File} {@var{tcp} = } tcpip (@var{host}, [@var{port}], [@var{PropertyName}, @var{PropertyValue}...])
 Matlab compatible wrapper to the tcp interface.

 NOTE: tcpip has been deprecated. Use tcpclient instead

@subsubheading Inputs
@var{host} - the host name or ip.@*
@var{port} - the port number to connect. If omitted defaults to 80.@*
@var{PropertyName}, @var{PropertyValue} - Optional property name, value pairs to set on the tcp object.@*

@subsubheading Properties
 Currently the only known properties are "timeout" and "name".

@subsubheading Outputs
 tcpip will return an instance of @var{octave_tcp} class as the result.
@end deftypefn
@c ---------------------------------------------------
@node TCP Client
@section TCP Client
@cindex TCP Client
@c TCP Client @octave_tcpclient/configureTerminator
@c -----------------------------------------
@subsection @@octave_tcpclient/configureTerminator
@cindex configureTerminator
@deftypefn {Function File} {} configureTerminator (@var{tcp}, @var{term})
@deftypefnx {Function File} {} configureTerminator (@var{tcp}, @var{readterm}, @var{writeterm})
 Set terminator on a tcpclient object for ASCII string manipulation

@subsubheading Inputs
@var{tcp} - tcpclient object@*
@var{term} - terminal value for both read and write@*
@var{readterm} = terminal value type for read data@*
@var{writeterm} = terminal value for written data@*

 The terminal can be either strings "cr", "lf" (default), "lf/cr" or an integer between 0 to 255.

@subsubheading Outputs
 None

@xseealso{tcpport}
@end deftypefn
@c TCP Client @octave_tcpclient/flush
@c -----------------------------------------
@subsection @@octave_tcpclient/flush
@cindex flush
@deftypefn {} {@var{data} =} flush (@var{dev})
@deftypefnx {} {@var{data} =} flush (@var{dev}, "input")
@deftypefnx {} {@var{data} =} flush (@var{dev}, "output")
 Flush the tcpclient socket buffers

@subsubheading Inputs
@var{dev} - connected tcpclient device

 If an additional parameter is provided of "input" or "output",
 then only the input or output buffer will be flushed

@subsubheading Outputs
 None

@xseealso{serialport}
@end deftypefn
@c TCP Client @octave_tcpclient/get
@c -----------------------------------------
@subsection @@octave_tcpclient/get
@cindex get
@deftypefn {Function File} {@var{struct} = } get (@var{tcpclient})
@deftypefnx {Function File} {@var{field} = } get (@var{tcpclient}, @var{property})
 Get the properties of tcpclient object.

@subsubheading Inputs
@var{tcpclient} - instance of @var{octave_tcpclient} class.@*
@var{property} - name of property.@*

@subsubheading Outputs
 When @var{property} was specified, return the value of that property.@*
 otherwise return the values of all properties as a structure.@*

@xseealso{@@octave_tcpclient/set}
@end deftypefn
@c TCP Client @octave_tcpclient/read
@c -----------------------------------------
@subsection @@octave_tcpclient/read
@cindex read
@deftypefn {Function File} {@var{data} =} read (@var{obj})
@deftypefnx {Function File} {@var{data} =} read (@var{obj}, @var{size})
@deftypefnx {Function File} {@var{data} =} read (@var{obj}, @var{size}, @var{datatype})
 Reads @var{data} from TCP instrument

@subsubheading Inputs
@var{obj} is a TCP object.@*
@var{size} Number of values to read. (Default: NumBytesAvailable).@*
@var{datatype} datatype of data.@*

@subsubheading Outputs
@var{data} data read.@*

@end deftypefn
@c TCP Client @octave_tcpclient/set
@c -----------------------------------------
@subsection @@octave_tcpclient/set
@cindex set
@deftypefn {Function File} set (@var{obj}, @var{property},@var{value})
@deftypefnx {Function File} set (@var{obj}, @var{property},@var{value},@dots{})
 Set the properties of tcpclient object.

@subsubheading Inputs
 If @var{property} is a cell so must be @var{value}, it sets the values of
 all matching properties.

 The function also accepts property-value pairs.

@subsubheading Properties
@table @var
@item 'Name'
 Set the name for the tcpclient socket.

@item 'UserData'
 Set user data for the tcpclient socket.

@item 'Timeout'
 Set the timeout value in seconds. Value of -1 means a
 blocking call.

@end table

@subsubheading Outputs
 None

@xseealso{@@octave_tcpclient/get}
@end deftypefn
@c TCP Client @octave_tcpclient/write
@c -----------------------------------------
@subsection @@octave_tcpclient/write
@cindex write
@deftypefn {Function File} {@var{numbytes} = } write (@var{obj}, @var{data})
@deftypefnx {Function File} {@var{numbytes} =} write (@var{obj}, @var{data}, @var{datatype})
 Writes @var{data} to TCP instrument

@subsubheading Inputs
@var{obj} is a TCPclient  object.@*
@var{data} data to write.@*
@var{datatype} datatype of data. If not specified, it defaults to "uint8".@*

@subsubheading Outputs
 returns number of bytes written.
@end deftypefn
@c TCP Client tcpclient
@c -----------------------------------------
@subsection tcpclient
@cindex tcpclient
@deftypefn {Loadable Function} {@var{tcpclient} = } tcpclient (@var{ipaddress}, @var{port})
@deftypefnx {Loadable Function} {@var{tcpclient} = } tcpclient (@var{ipaddress}, @var{port}, [@var{propertyname}, @var{propertyvalue}])

Open tcpclient interface.

@subsubheading Inputs
@var{ipaddress} - the ip address of type String.@*
@var{port} - the port number to connect.@*
@var{propname},@var{propvalue} - property name/value pairs.

Known input properties:
@table @asis
@item Name
name value
@item Timeout
Numeric timeout value or -1 to wait forever
@item EnableTransferDelay
Boolean to enable or disable the nagle algorithm for delay transfer.
@item UserData
User data value.
@end table

@subsubheading Outputs
The tcpclient() shall return instance of @var{octave_tcpclient} class as the result @var{tcpclient}.

@subsubheading Properties
The tcpclient object has the following public properties:
@table @asis
@item Name
name assigned to the tcpclient object
@item Type
instrument type 'tcpclient' (readonly)
@item Port
remote port number (Readonly)
@item Address
remote host address (Readonly)
@item Status
status of the object 'open' or 'closed' (readonly)
@item Timeout
timeout value in seconds used for waiting for data
@item NumBytesAvailable
number of bytes currently available to read (readonly)
@item NumBytesWritten
number of bytes currently available to read (readonly)
@item ByteOrder
Byte order  for data (currently not used)
@item Terminator
Terminator value used for string data (currently not used)
@item UserData
User data
@item EnableTransferDelay
Bool for whether transfer delay is enabled. (Read only)
@end table 
@end deftypefn
@c ---------------------------------------------------
@node TCP Server
@section TCP Server
@cindex TCP Server
@c TCP Server @octave_tcpserver/configureTerminator
@c -----------------------------------------
@subsection @@octave_tcpserver/configureTerminator
@cindex configureTerminator
@deftypefn {Function File} {} configureTerminator (@var{tcp}, @var{term})
@deftypefnx {Function File} {} configureTerminator (@var{tcp}, @var{readterm}, @var{writeterm})
 Set terminator on a tcpserver object for ASCII string manipulation

@subsubheading Inputs
@var{tcp} - tcpserver object@*
@var{term} - terminal value for both read and write@*
@var{readterm} = terminal value type for read data@*
@var{writeterm} = terminal value for written data@*

 The terminal can be either strings "cr", "lf" (default), "lf/cr" or an integer between 0 to 255.

@subsubheading Outputs
 None

@xseealso{tcpport}
@end deftypefn
@c TCP Server @octave_tcpserver/flush
@c -----------------------------------------
@subsection @@octave_tcpserver/flush
@cindex flush
@deftypefn {} {@var{data} =} flush (@var{dev})
@deftypefnx {} {@var{data} =} flush (@var{dev}, "input")
@deftypefnx {} {@var{data} =} flush (@var{dev}, "output")
 Flush the tcpserver socket buffers

@subsubheading Inputs
@var{dev} - connected tcpserver device

 If an additional parameter is provided of "input" or "output",
 then only the input or output buffer will be flushed

@subsubheading Outputs
 None

@xseealso{serialport}
@end deftypefn
@c TCP Server @octave_tcpserver/get
@c -----------------------------------------
@subsection @@octave_tcpserver/get
@cindex get
@deftypefn {Function File} {@var{struct} = } get (@var{tcpserver})
@deftypefnx {Function File} {@var{field} = } get (@var{tcpserver}, @var{property})
 Get the properties of tcpserver object.

@subsubheading Inputs
@var{tcpserver} - instance of @var{octave_tcpserver} class.@*
@var{property} - name of property.@*

@subsubheading Outputs
 When @var{property} was specified, return the value of that property.@*
 otherwise return the values of all properties as a structure.@*

@xseealso{@@octave_tcpserver/set}
@end deftypefn
@c TCP Server @octave_tcpserver/read
@c -----------------------------------------
@subsection @@octave_tcpserver/read
@cindex read
@deftypefn {Function File} {@var{data} =} read (@var{obj})
@deftypefnx {Function File} {@var{data} =} read (@var{obj}, @var{size})
@deftypefnx {Function File} {@var{data} =} read (@var{obj}, @var{size}, @var{datatype})
 Reads @var{data} from TCP instrument

@subsubheading Inputs
@var{obj} is a TCP Server object.@*
@var{size} Number of values to read. (Default: NumBytesAvailable).@*
@var{datatype} datatype of data.@*

@subsubheading Outputs
@var{data} data read.@*

@end deftypefn
@c TCP Server @octave_tcpserver/set
@c -----------------------------------------
@subsection @@octave_tcpserver/set
@cindex set
@deftypefn {Function File} set (@var{obj}, @var{property},@var{value})
@deftypefnx {Function File} set (@var{obj}, @var{property},@var{value},@dots{})
 Set the properties of tcpserver object.

@subsubheading Inputs
 If @var{property} is a cell so must be @var{value}, it sets the values of
 all matching properties.

 The function also accepts property-value pairs.

@subsubheading Properties
@table @var
@item 'Name'
 Set the name for the tcpserver socket.

@item 'UserData'
 Set user data for the tcpserver socket.

@item 'Timeout'
 Set the timeout value in seconds. Value of -1 means a
 blocking call.

@end table

@subsubheading Outputs
 None

@xseealso{@@octave_tcpserver/get}
@end deftypefn
@c TCP Server @octave_tcpserver/write
@c -----------------------------------------
@subsection @@octave_tcpserver/write
@cindex write
@deftypefn {Function File} {@var{numbytes} = } write (@var{obj}, @var{data})
@deftypefnx {Function File} {@var{numbytes} =} write (@var{obj}, @var{data}, @var{datatype})
 Writes @var{data} to TCP instrument

@subsubheading Inputs
@var{obj} is a TCPServer object.@*
@var{data} data to write.@*
@var{datatype} datatype of data. If not specified, it defaults to "uint8".@*

@subsubheading Outputs
 returns number of bytes written.
@end deftypefn
@c TCP Server tcpserver
@c -----------------------------------------
@subsection tcpserver
@cindex tcpserver
@deftypefn {Loadable Function} {@var{tcpserver} = } tcpserver (@var{ipaddress}, @var{port})
@deftypefnx {Loadable Function} {@var{tcpserver} = } tcpserver (@var{port})
@deftypefnx {Loadable Function} {@var{tcpserver} = } tcpserver (@dots{}, [@var{propertyname}, @var{propertyvalue}])

Open tcpserver interface.

@subsubheading Inputs
@var{ipaddress} - the ip address of type String.@*
@var{port} - the port number to bind.@*
@var{propname},@var{propvalue} - property name/value pairs.

Known input properties:
@table @asis
@item Name
name value
@item Timeout
Numeric timeout value or -1 to wait forever
@item UserData
User data value.
@end table

@subsubheading Outputs
The tcpserver() shall return instance of @var{octave_tcpserver} class as the result @var{tcpserver}.

@subsubheading Properties
The tcpserver object has the following public properties:
@table @asis
@item Connected
boolean flag for when connected to a client (Readonly)
@item ClientPort
connected client port number (Readonly)
@item ClientAddress
connected client address (Readonly)
@item Name
name assigned to the tcpserver object
@item Type
instrument type 'tcpserver' (readonly)
@item ServerPort
server port number (Readonly)
@item ServerAddress
server address (Readonly)
@item Status
status of the object 'open' or 'closed' (readonly)
@item Timeout
timeout value in seconds used for waiting for data
@item NumBytesAvailable
number of bytes currently available to read (readonly)
@item NumBytesWritten
number of bytes currently available to read (readonly)
@item ByteOrder
Byte order  for data (currently not used)
@item Terminator
Terminator value used for string data (currently not used)
@item UserData
User data
@end table 
@end deftypefn
@c ---------------------------------------------------
@node UDP (Deprecated)
@section UDP (Deprecated)
@cindex UDP (Deprecated)
@c UDP (Deprecated) @octave_udp/fclose
@c -----------------------------------------
@subsection @@octave_udp/fclose
@cindex fclose
@deftypefn {Function File} {@var{res} =} fclose (@var{obj})
 Closes UDP connection @var{obj}
@end deftypefn
@c UDP (Deprecated) @octave_udp/flush
@c -----------------------------------------
@subsection @@octave_udp/flush
@cindex flush
@deftypefn {} {@var{data} =} flush (@var{dev})
@deftypefnx {} {@var{data} =} flush (@var{dev}, "input")
@deftypefnx {} {@var{data} =} flush (@var{dev}, "output")
 Flush the udp socket buffers

@subsubheading Inputs
@var{dev} - open udp device

 If an additional parameter is provided of "input" or "output",
 then only the input or output buffer will be flushed

@subsubheading Outputs
 None

@xseealso{udp}
@end deftypefn
@c UDP (Deprecated) @octave_udp/flushinput
@c -----------------------------------------
@subsection @@octave_udp/flushinput
@cindex flushinput
@deftypefn {Loadable Function} {} flushinput (@var{udp})

 Flush the pending input, which will also make the BytesAvailable property be 0.

@subsubheading Inputs
@var{udp} - instance of @var{octave_udp} class.

@subsubheading Outputs
 None

@xseealso{flushoutput}
@end deftypefn
@c UDP (Deprecated) @octave_udp/flushoutput
@c -----------------------------------------
@subsection @@octave_udp/flushoutput
@cindex flushoutput
@deftypefn {Loadable Function} {} flushoutput (@var{udp})

 Flush the output buffer.

@subsubheading Inputs
@var{udp} - instance of @var{octave_udp} class.

@subsubheading Outputs
 None

@xseealso{flushinput}
@end deftypefn
@c UDP (Deprecated) @octave_udp/fopen
@c -----------------------------------------
@subsection @@octave_udp/fopen
@cindex fopen
@deftypefn {Function File} {@var{res} =} fopen (@var{obj}) (dummy)
 Opens UDP connection @var{obj}
 This currently is a dummy function to improve compatibility to MATLAB

@end deftypefn
@c UDP (Deprecated) @octave_udp/fprintf
@c -----------------------------------------
@subsection @@octave_udp/fprintf
@cindex fprintf
@deftypefn {Function File} {@var{numbytes} =} fprintf (@var{obj}, @var{template} ...)
 Writes formatted string @var{template} using optional parameters to
 UDP instrument

@subsubheading Inputs
@var{obj} is a UDP object.@*
@var{template} Format template string.@*

@subsubheading Outputs
@var{numbytes} is the number of bytes written to the device
@end deftypefn
@c UDP (Deprecated) @octave_udp/fread
@c -----------------------------------------
@subsection @@octave_udp/fread
@cindex fread
@deftypefn {Function File} {@var{data} =} fread (@var{obj})
@deftypefnx {Function File} {@var{data} =} fread (@var{obj}, @var{size})
@deftypefnx {Function File} {@var{data} =} fread (@var{obj}, @var{size}, @var{precision})
@deftypefnx {Function File} {[@var{data},@var{count}] =} fread (@var{obj}, ...)
@deftypefnx {Function File} {[@var{data},@var{count},@var{errmsg}] =} fread (@var{obj}, ...)
 Reads @var{data} from UDP instrument

@subsubheading Inputs
@var{obj} is a UDP object.@*
@var{size} Number of values to read. (Default: 100).@*
@var{precision} precision of data.@*

@subsubheading Outputs
@var{data} data values.@*
@var{count} number of values read.@*
@var{errmsg} read operation error message.@*

@end deftypefn
@c UDP (Deprecated) @octave_udp/fwrite
@c -----------------------------------------
@subsection @@octave_udp/fwrite
@cindex fwrite
@deftypefn {Function File} {@var{numbytes} = } fwrite (@var{obj}, @var{data})
@deftypefnx {Function File} {@var{numbytes} =} fwrite (@var{obj}, @var{data}, @var{precision})
 Writes @var{data} to UDP instrument

@subsubheading Inputs
@var{obj} is a UDP object.@*
@var{data} data to write.@*
@var{precision} precision of data.@*

@subsubheading Outputs
 returns number of bytes written.
@end deftypefn
@c UDP (Deprecated) @octave_udp/get
@c -----------------------------------------
@subsection @@octave_udp/get
@cindex get
@deftypefn {Function File} {@var{struct} = } get (@var{udp})
@deftypefnx {Function File} {@var{field} = } get (@var{udp}, @var{property})
 Get the properties of udp object.

@subsubheading Inputs
@var{udp} - instance of @var{octave_udp} class.@*

@var{property} - name of property.@*

@subsubheading Outputs
 When @var{property} was specified, return the value of that property.@*
 otherwise return the values of all properties as a structure.@*

@xseealso{@@octave_udp/set}
@end deftypefn
@c UDP (Deprecated) @octave_udp/read
@c -----------------------------------------
@subsection @@octave_udp/read
@cindex read
@deftypefn {Function File} {@var{data} =} read (@var{obj})
@deftypefnx {Function File} {@var{data} =} read (@var{obj}, @var{size})
@deftypefnx {Function File} {@var{data} =} read (@var{obj}, @var{size}, @var{datatype})
 Reads @var{data} from UDP instrument

@subsubheading Inputs
@var{obj} is a UDP object.@*
@var{size} Number of values to read. (Default: BytesAvailable).@*
@var{datatype} datatype of data.@*

@subsubheading Outputs
@var{data} data read.@*

@end deftypefn
@c UDP (Deprecated) @octave_udp/set
@c -----------------------------------------
@subsection @@octave_udp/set
@cindex set
@deftypefn {Function File} set (@var{obj}, @var{property},@var{value})
@deftypefnx {Function File} set (@var{obj}, @var{property},@var{value},@dots{})
 Set the properties of udp object.

@subsubheading Inputs
@var{obj} - instance of @var{octave_udp} class.@*
@var{property} - name of property.@*

 If @var{property} is a cell so must be @var{value}, it sets the values of
 all matching properties.

 The function also accepts property-value pairs.

@subsubheading Properties
@table @var
@item 'name'
 Set the name for the udp socket.

@item 'remotehost'
 Set the remote host name for the udp socket.

@item 'remoteport'
 Set the remote port for the udp socket.

@item 'timeout'
 Set the timeout value in seconds. Value of -1 means a
 blocking call.

@end table

@subsubheading Outputs
 None

@xseealso{@@octave_udp/get}
@end deftypefn
@c UDP (Deprecated) @octave_udp/write
@c -----------------------------------------
@subsection @@octave_udp/write
@cindex write
@deftypefn {Function File} {@var{numbytes} = } write (@var{obj}, @var{data})
@deftypefnx {Function File} {@var{numbytes} = } write (@var{obj}, @var{data}, @var{destinationAddress}, @var{destinationPort}))
@deftypefnx {Function File} {@var{numbytes} =} write (@var{obj}, @var{data}, @var{datatype})
@deftypefnx {Function File} {@var{numbytes} =} write (@var{obj}, @var{data}, @var{datatype}, @var{destinationAddress}, @var{destinationPort})
 Writes @var{data} to UDP instrument

@subsubheading Inputs
@var{obj} is a UDP object.@*
@var{data} data to write.@*
@var{datatype} datatype of data. If not specified defaults to uint8.@*
@var{destinationAddress} ipaddress to send to. If not specified, use the remote address.@*
@var{destinationPort} port to send to. If not specified, use the remote port.@*

@subsubheading Outputs
 returns number of bytes written.
@end deftypefn
@c UDP (Deprecated) udp
@c -----------------------------------------
@subsection udp
@cindex udp
@deftypefn {Loadable Function} {@var{udp} = } udp ()
@deftypefnx {Loadable Function} {@var{udp} = } udp (@var{remoteipaddress}, @var{remoteport})
@deftypefnx {Loadable Function} {@var{udp} = } udp (@var{remoteipaddress}, @var{remoteport}, [@var{propertyname}, @var{propertyvalue} ...])

Open udp interface.

@subsubheading Inputs
@var{remoteipaddress} - the ip address of type String. If omitted defaults to '127.0.0.1'.@* 
@var{remoteport} - the port number to connect. If omitted defaults to 23.@* 
@var{localport} - the local port number to bind. If omitted defaults to 0@* 
@var{propertyname}, @var{propertyvalue} - property name/value pair

@subsubheading Outputs
The udp() shall return instance of @var{octave_udp} class as the result @var{udp}.

@subsubheading Properties
The udp object has the following public properties:
@table @asis
@item name
name assigned to the udp object
@item type
instrument type 'udp' (readonly)
@item localport
local port number (readonly)
@item localhost
local host address (readonly)
@item remoteport
remote port number
@item remotehost
remote host
@item status
status of the object 'open' or 'closed' (readonly)
@item timeout
timeout value in seconds used for waiting for data
@item bytesavailable
number of bytes currently available to read (readonly)
@end table 
@end deftypefn
@c UDP (Deprecated) udp_close
@c -----------------------------------------
@subsection udp_close
@cindex udp_close
@deftypefn {Loadable Function} {} udp_close (@var{udp})

Close the interface and release a file descriptor.

@subsubheading Inputs
@var{udp} - instance of @var{octave_udp} class.

@subsubheading Inputs
None
@end deftypefn
@c UDP (Deprecated) udp_demo
@c -----------------------------------------
@subsection udp_demo
@cindex udp_demo
@deftypefn {Function File} {@var{result} =} udp_demo ()
 Run test SNTP demonstration for udp class

@xseealso{udp}
@end deftypefn
@c UDP (Deprecated) udp_read
@c -----------------------------------------
@subsection udp_read
@cindex udp_read
@deftypefn {Loadable Function} {[@var{data}, @var{count}] = } udp_read (@var{udp}, @var{n}, @var{timeout})

Read from udp interface.

@subsubheading Inputs
@var{udp} - instance of @var{octave_udp} class.@*
@var{n} - number of bytes to attempt to read of type Integer@*
@var{timeout} - timeout in ms if different from default of type Integer

@subsubheading Outputs
The udp_read() shall return number of bytes successfully read in @var{count} as Integer and the bytes themselves in @var{data} as uint8 array.
@end deftypefn
@c UDP (Deprecated) udp_timeout
@c -----------------------------------------
@subsection udp_timeout
@cindex udp_timeout
@deftypefn {Loadable Function} {} udp_timeout (@var{udp}, @var{timeout})
@deftypefnx {Loadable Function} {@var{t} = } udp_timeout (@var{udp})

Set new or get existing udp interface timeout parameter used for udp_read() requests. The timeout value is specified in milliseconds.

@subsubheading Inputs
@var{udp} - instance of @var{octave_udp} class.@*
@var{timeout} - udp_read() timeout value in milliseconds. Value of -1 means a blocking call.

@subsubheading Outputs
If @var{timeout} parameter is omitted, the udp_timeout() shall return current timeout value as the result @var{t}.
@end deftypefn
@c UDP (Deprecated) udp_write
@c -----------------------------------------
@subsection udp_write
@cindex udp_write
@deftypefn {Loadable Function} {@var{n} = } udp_write (@var{udp}, @var{data})

Write data to a udp interface.

@subsubheading Inputs
@var{udp} - instance of @var{octave_udp} class.@*
@var{data} - data to be written to the udp interface. Can be either of String or uint8 type.

@subsubheading Outputs
Upon successful completion, udp_write() shall return the number of bytes written as the result @var{n}.
@end deftypefn
@c ---------------------------------------------------
@node UDP Port
@section UDP Port
@cindex UDP Port
@c UDP Port @octave_udpport/configureMulticast
@c -----------------------------------------
@subsection @@octave_udpport/configureMulticast
@cindex configureMulticast
@deftypefn {} {@var{data} =} configureMulticast((@var{dev}, @var{address})
@deftypefnx {} {@var{data} =} configureMulticast((@var{dev}, @var{"off"})
 Configure udpport device to receive multicast data

@subsubheading Inputs
@var{dev} - open udpport device

 If @var{address}  is 'off' disable udp multicast. Otherwise it is the multicast address to use.

@subsubheading Outputs
 None

@xseealso{udpport}
@end deftypefn
@c UDP Port @octave_udpport/configureTerminator
@c -----------------------------------------
@subsection @@octave_udpport/configureTerminator
@cindex configureTerminator
@deftypefn {Function File} {} configureTerminator (@var{udp}, @var{term})
@deftypefnx {Function File} {} configureTerminator (@var{udp}, @var{readterm}, @var{writeterm})
 Set terminator for ASCII string manipulation

@subsubheading Inputs
@var{udp} - udpport object@*
@var{term} - terminal value for both read and write@*
@var{readterm} = terminal value type for read data@*
@var{writeterm} = terminal value for written data@*

 The terminal can be either strings "cr", "lf" (default), "lf/cr" or an integer between 0 to 255.

@subsubheading Outputs
 None

@xseealso{udpport}
@end deftypefn
@c UDP Port @octave_udpport/flush
@c -----------------------------------------
@subsection @@octave_udpport/flush
@cindex flush
@deftypefn {} {@var{data} =} flush (@var{dev})
@deftypefnx {} {@var{data} =} flush (@var{dev}, "input")
@deftypefnx {} {@var{data} =} flush (@var{dev}, "output")
 Flush the udpport socket buffers

@subsubheading Inputs
@var{dev} - open udpport device

 If an additional parameter is provided of "input" or "output",
 then only the input or output buffer will be flushed

@subsubheading Outputs
 None

@xseealso{udpport}
@end deftypefn
@c UDP Port @octave_udpport/fprintf
@c -----------------------------------------
@subsection @@octave_udpport/fprintf
@cindex fprintf
@deftypefn {Function File} {@var{numbytes} =} fprintf (@var{obj}, @var{template} ...)
 Writes formatted string @var{template} using optional parameters to
 UDP instrument

@subsubheading Inputs
@var{obj} is a UDPPort object.@*
@var{template} Format template string.@*

@subsubheading Outputs
@var{numbytes} is the number of bytes written to the device
@end deftypefn
@c UDP Port @octave_udpport/fread
@c -----------------------------------------
@subsection @@octave_udpport/fread
@cindex fread
@deftypefn {Function File} {@var{data} =} fread (@var{obj})
@deftypefnx {Function File} {@var{data} =} fread (@var{obj}, @var{size})
@deftypefnx {Function File} {@var{data} =} fread (@var{obj}, @var{size}, @var{precision})
@deftypefnx {Function File} {[@var{data},@var{count}] =} fread (@var{obj}, ...)
@deftypefnx {Function File} {[@var{data},@var{count},@var{errmsg}] =} fread (@var{obj}, ...)
 Reads @var{data} from UDP instrument

@subsubheading Inputs
@var{obj} is a UDP port object.@*
@var{size} Number of values to read. (Default: 100).@*
@var{precision} precision of data.@*

@subsubheading Outputs
@var{data} data values.@*
@var{count} number of values read.@*
@var{errmsg} read operation error message.@*

@end deftypefn
@c UDP Port @octave_udpport/fwrite
@c -----------------------------------------
@subsection @@octave_udpport/fwrite
@cindex fwrite
@deftypefn {Function File} {@var{numbytes} = } fwrite (@var{obj}, @var{data})
@deftypefnx {Function File} {@var{numbytes} =} fwrite (@var{obj}, @var{data}, @var{precision})
 Writes @var{data} to UDP instrument

@subsubheading Inputs
@var{obj} is a UDP port object.@*
@var{data} data to write.@*
@var{precision} precision of data.@*

@subsubheading Outputs
 returns number of bytes written.
@end deftypefn
@c UDP Port @octave_udpport/get
@c -----------------------------------------
@subsection @@octave_udpport/get
@cindex get
@deftypefn {Function File} {@var{struct} = } get (@var{udpport})
@deftypefnx {Function File} {@var{field} = } get (@var{udpport}, @var{property})
 Get the properties of udpport object.

@subsubheading Inputs
@var{udpport} - instance of @var{octave_udpport} class.@*

@var{property} - name of property.@*

@subsubheading Outputs
 When @var{property} was specified, return the value of that property.@*
 otherwise return the values of all properties as a structure.@*

@xseealso{@@octave_udpport/set}
@end deftypefn
@c UDP Port @octave_udpport/read
@c -----------------------------------------
@subsection @@octave_udpport/read
@cindex read
@deftypefn {Function File} {@var{data} =} read (@var{obj})
@deftypefnx {Function File} {@var{data} =} read (@var{obj}, @var{size})
@deftypefnx {Function File} {@var{data} =} read (@var{obj}, @var{size}, @var{datatype})
 Reads @var{data} from UDP instrument

@subsubheading Inputs
@var{obj} is a UDP object.@*
@var{size} Number of values to read. (Default: BytesAvailable).@*
@var{datatype} datatype of data.@*

@subsubheading Outputs
@var{data} data read.@*

@end deftypefn
@c UDP Port @octave_udpport/set
@c -----------------------------------------
@subsection @@octave_udpport/set
@cindex set
@deftypefn {Function File} set (@var{obj}, @var{property},@var{value})
@deftypefnx {Function File} set (@var{obj}, @var{property},@var{value},@dots{})
 Set the properties of udpport object.

@subsubheading Inputs
@var{obj} - instance of @var{octave_udpport} class.@*
@var{property} - name of property.@*

 If @var{property} is a cell so must be @var{value}, it sets the values of
 all matching properties.

 The function also accepts property-value pairs.

@subsubheading Properties
@table @var
@item 'Name'
 Set the name for the udpport socket.

@item 'UserData'
 Set the user data of the object.

@item 'Timeout'
 Set the timeout value in seconds. Value of -1 means a
 blocking call.

@end table

@subsubheading Outputs
 None

@xseealso{@@octave_udpport/get}
@end deftypefn
@c UDP Port @octave_udpport/write
@c -----------------------------------------
@subsection @@octave_udpport/write
@cindex write
@deftypefn {Function File} {@var{numbytes} = } write (@var{obj}, @var{data})
@deftypefnx {Function File} {@var{numbytes} = } write (@var{obj}, @var{data}, @var{destinationAddress}, @var{destinationPort}))
@deftypefnx {Function File} {@var{numbytes} =} write (@var{obj}, @var{data}, @var{datatype})
@deftypefnx {Function File} {@var{numbytes} =} write (@var{obj}, @var{data}, @var{datatype}, @var{destinationAddress}, @var{destinationPort})
 Writes @var{data} to UDP instrument

@subsubheading Inputs
@var{obj} is a UDPPort object.@*
@var{data} data to write.@*
@var{datatype} datatype of data. If not specified defaults to uint8.@*
@var{destinationAddress} ipaddress to send to. If not specified, use the previously used remote address.@*
@var{destinationPort} port to send to. If not specified, use the remote port.@*

@subsubheading Outputs
 returns number of bytes written.
@end deftypefn
@c UDP Port @octave_udpport/writeline
@c -----------------------------------------
@subsection @@octave_udpport/writeline
@cindex writeline
@deftypefn {} {} writeline (@var{dev}, @var{data})
@deftypefnx {} {} writeline (@var{dev}, @var{data}, @var{destaddr}, @var{destport})
 Write data to a udpport including terminator value

@subsubheading Inputs
@var{dev} - connected device

@var{data} - ASCII data to write

@var{destaddr} - Destination address

@var{destport} - Destination port

 Where the address and port is not specified, the previously used address and port is used.

@subsubheading Outputs
 None

@xseealso{flushoutput}
@end deftypefn
@c UDP Port udpport
@c -----------------------------------------
@subsection udpport
@cindex udpport
@deftypefn {Loadable Function} {@var{udp} = } udpport ()
@deftypefnx {Loadable Function} {@var{udp} = } udpport (@var{propertyname}, @var{propertyvalue} ...)

Open udpport interface.

@subsubheading Inputs
@var{propertyname}, @var{propertyvalue} - property name/value pair

Known input properties:
@table @asis
@item Name
name assigned to the udp object
@item LocalPort
local port number
@item LocalHost
local host address
@item Timeout
timeout value in seconds used for waiting for data
@item EnablePortSharing
Boolean if the socket has port sharing enabled (readonly)
@end table 

@subsubheading Outputs
The udpport() shall return instance of @var{octave_udp} class as the result @var{udp}.

@subsubheading Properties
The udp object has the following public properties:
@table @asis
@item Name
name assigned to the udp object
@item Type
instrument type 'udpport' (readonly)
@item LocalPort
local port number (readonly)
@item LocalHost
local host address (readonly)
@item Status
status of the object 'open' or 'closed' (readonly)
@item Timeout
timeout value in seconds used for waiting for data
@item NumBytesAvailable
number of bytes currently available to read (readonly)
@item MulticastGroup
multicast group socket  is subscribed to (readonly)
@item EnableMultcast
Boolean if the socket has any multicast group it is subscribed to (readonly)
@item EnablePortSharing
Boolean if the socket has port sharing enabled (readonly)
@item Terminator
Terminator value used for string data (currently not used)
@end table 
@end deftypefn
@c ---------------------------------------------------
@node USBTMC
@section USBTMC
@cindex USBTMC
@c USBTMC @octave_usbtmc/fclose
@c -----------------------------------------
@subsection @@octave_usbtmc/fclose
@cindex fclose
@deftypefn {Function File} {@var{res} =} fclose (@var{obj})
 Closes USBTMC connection @var{obj}

@subsubheading Inputs
@var{obj} is a usbtmc object.@*
@end deftypefn
@c USBTMC @octave_usbtmc/fopen
@c -----------------------------------------
@subsection @@octave_usbtmc/fopen
@cindex fopen
@deftypefn {Function File} {@var{res} =} fopen (@var{obj}) (dummy)
 Opens USBTMC connection @var{obj}
 This currently is a dummy function to improve compatibility to MATLAB

@end deftypefn
@c USBTMC @octave_usbtmc/fread
@c -----------------------------------------
@subsection @@octave_usbtmc/fread
@cindex fread
@deftypefn {Function File} {@var{data} =} fread (@var{obj})
@deftypefnx {Function File} {@var{data} =} fread (@var{obj}, @var{size})
@deftypefnx {Function File} {@var{data} =} fread (@var{obj}, @var{size}, @var{precision})
@deftypefnx {Function File} {[@var{data},@var{count}] =} fread (@var{obj}, ...)
@deftypefnx {Function File} {[@var{data},@var{count},@var{errmsg}] =} fread (@var{obj}, ...)
 Reads @var{data} from usbtmc instrument

@subsubheading Inputs
@var{obj} is a usbtmc object.@*
@var{size} Number of values to read. (Default: 100).@*
@var{precision} precision of data.@*

@subsubheading Outputs
@var{data} The read data.@*
@var{count} values read.@*
@var{errmsg} read operation error message.@*

@end deftypefn
@c USBTMC @octave_usbtmc/fwrite
@c -----------------------------------------
@subsection @@octave_usbtmc/fwrite
@cindex fwrite
@deftypefn {Function File} {@var{numbytes} = } fwrite (@var{obj}, @var{data})
@deftypefnx {Function File} {@var{numbytes} =} fwrite (@var{obj}, @var{data}, @var{precision})
 Writes @var{data} to an usbtmc instrument

@subsubheading Inputs
@var{obj} is a usbtmc object.@*
@var{data} data to write.@*
@var{precision} precision of data.@*

@subsubheading Outputs
 returns number of bytes written.
@end deftypefn
@c USBTMC usbtmc
@c -----------------------------------------
@subsection usbtmc
@cindex usbtmc
@deftypefn {Loadable Function} {@var{usbtmc} = } usbtmc (@var{path})

Open usbtmc interface.

@subsubheading Inputs
@var{path} - the interface path of type String. If omitted defaults to '/dev/usbtmc0'.

@subsubheading Outputs
The usbtmc() shall return instance of @var{octave_usbtmc} class as the result @var{usbtmc}.
@end deftypefn
@c USBTMC usbtmc_close
@c -----------------------------------------
@subsection usbtmc_close
@cindex usbtmc_close
@deftypefn {Loadable Function} {} usbtmc_close (@var{usbtmc})

Close the interface and release a file descriptor.

@subsubheading Inputs
@var{usbtmc} - instance of @var{octave_usbtmc} class.
@subsubheading Outputs
None
@end deftypefn
@c USBTMC usbtmc_read
@c -----------------------------------------
@subsection usbtmc_read
@cindex usbtmc_read
@deftypefn {Loadable Function} {[@var{data}, @var{count}] = } usbtmc_read (@var{usbtmc}, @var{n})

Read from usbtmc slave device.

@subsubheading Inputs
@var{usbtmc} - instance of @var{octave_usbtmc} class.@*
@var{n} - number of bytes to attempt to read of type Integer.

@subsubheading Outputs
@var{count} - the number of bytes successfully read as an Integer.@*
@var{data} - the read bytes as a uint8 array.
@end deftypefn
@c USBTMC usbtmc_write
@c -----------------------------------------
@subsection usbtmc_write
@cindex usbtmc_write
@deftypefn {Loadable Function} {@var{n} = } usbtmc_write (@var{usbtmc}, @var{data})

Write data to a usbtmc slave device.

@subsubheading Inputs
@var{usbtmc} - instance of @var{octave_usbtmc} class.@*
@var{data} - data, of type uint8, to be written to the slave device.

@subsubheading Outputs
Upon successful completion, usbtmc_write() shall return the number of bytes written as the result @var{n}.
@end deftypefn
@c ---------------------------------------------------
@node VXI11
@section VXI11
@cindex VXI11
@c VXI11 @octave_vxi11/fclose
@c -----------------------------------------
@subsection @@octave_vxi11/fclose
@cindex fclose
@deftypefn {Function File} {@var{res} =} fclose (@var{obj})
 Closes VXI11 connection @var{obj}
@end deftypefn
@c VXI11 @octave_vxi11/fopen
@c -----------------------------------------
@subsection @@octave_vxi11/fopen
@cindex fopen
@deftypefn {Function File} {@var{res} =} fopen (@var{obj}) (dummy)
 Opens VXI11 connection @var{obj}
 This currently is a dummy function to improve compatibility to MATLAB

@end deftypefn
@c VXI11 @octave_vxi11/fread
@c -----------------------------------------
@subsection @@octave_vxi11/fread
@cindex fread
@deftypefn {Function File} {@var{data} =} fread (@var{obj})
@deftypefnx {Function File} {@var{data} =} fread (@var{obj}, @var{size})
@deftypefnx {Function File} {@var{data} =} fread (@var{obj}, @var{size}, @var{precision})
@deftypefnx {Function File} {[@var{data},@var{count}] =} fread (@var{obj}, ...)
@deftypefnx {Function File} {[@var{data},@var{count},@var{errmsg}] =} fread (@var{obj}, ...)
 Reads @var{data} from vxi11 instrument

@subsubheading Inputs
@var{obj} is a vxi11 object.@*
@var{size} Number of values to read. (Default: 100).@*
@var{precision} precision of data.@*

@subsubheading Outputs
@var{data} The read data.@*
@var{count} values read.@*
@var{errmsg} read operation error message.@*

@end deftypefn
@c VXI11 @octave_vxi11/fwrite
@c -----------------------------------------
@subsection @@octave_vxi11/fwrite
@cindex fwrite
@deftypefn {Function File} {@var{numbytes} = } fwrite (@var{obj}, @var{data})
@deftypefnx {Function File} {@var{numbytes} =} fwrite (@var{obj}, @var{data}, @var{precision})
 Writes @var{data} to vxi11 instrument

@subsubheading Inputs
@var{obj} is a vxi11 object.@*
@var{data} data to write.@*
@var{precision} precision of data.@*

@subsubheading Outputs
 returns number of bytes written.
@end deftypefn
@c VXI11 vxi11
@c -----------------------------------------
@subsection vxi11
@cindex vxi11
@deftypefn {Loadable Function} {@var{vxi11} = } vxi11 (@var{ip},@var{instr})

Open vxi11 interface.

@var{ip} - the ip address of type String. If omitted defaults to '127.0.0.1'.
@var{instr} - the instrument name of type String. If omitted defaults to 'inst0'.

The vxi11() shall return instance of @var{octave_vxi11} class as the result @var{vxi11}.
@end deftypefn
@c VXI11 vxi11_close
@c -----------------------------------------
@subsection vxi11_close
@cindex vxi11_close
@deftypefn {Loadable Function} {} vxi11_close (@var{vxi11})

Close the interface and release a file descriptor.

@var{vxi11} - instance of @var{octave_vxi11} class.
@end deftypefn
@c VXI11 vxi11_read
@c -----------------------------------------
@subsection vxi11_read
@cindex vxi11_read
@deftypefn {Loadable Function} {[@var{data}, @var{count}] = } vxi11_read (@var{vxi11}, @var{n})

Read from vxi11 slave device.

@var{vxi11} - instance of @var{octave_vxi11} class.@*
@var{n} - number of bytes to attempt to read of type Integer.

The vxi11_read() shall return number of bytes successfully read in @var{count} as Integer and the bytes themselves in @var{data} as uint8 array.
@end deftypefn
@c VXI11 vxi11_write
@c -----------------------------------------
@subsection vxi11_write
@cindex vxi11_write
@deftypefn {Loadable Function} {@var{n} = } vxi11_write (@var{vxi11}, @var{data})

Write data to a vxi11 slave device.

@var{vxi11} - instance of @var{octave_vxi11} class.@*
@var{data} - data to be written to the slave device. Can be either of String or uint8 type.

Upon successful completion, vxi11_write() shall return the number of bytes written as the result @var{n}.
@end deftypefn