-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathLabJackM.h
executable file
·2225 lines (1982 loc) · 98.6 KB
/
LabJackM.h
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
/**
* Name: LabJackM.h
* Desc: Header file describing C-style exposed
* API functions for the LabJackM Library
* Auth: LabJack Corp.
**/
#ifndef LAB_JACK_M_HEADER
#define LAB_JACK_M_HEADER
#define LJM_VERSION 1.2200
// Format: xx.yyzz
// xx is the major version (left of the decimal).
// yy is the minor version (the two places to the right of the decimal).
// zz is the revision version (the two places to the right of the minor
// version).
/******************************************************************************
* How To Use This Library:
*
* See the LJM User's Guide: labjack.com/support/ljm/users-guide
*
* Check out the example files for examples of workflow
*
* To write/read other Modbus addresses, check out labjack.com/support/modbus
*
*****************************************************************************/
#define LJM_ERROR_CODE static const int
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _WIN32
#define LJM_ERROR_RETURN int __stdcall
#define LJM_LONG_LONG_RETURN long long __stdcall
#define LJM_VOID_RETURN void __stdcall
#define LJM_ERROR_STRING const char * __stdcall
#define LJM_DOUBLE_RETURN double __stdcall
#else
#ifdef __APPLE__
#define LJM_ERROR_RETURN int
#define LJM_LONG_LONG_RETURN long long
#define LJM_VOID_RETURN void
#define LJM_ERROR_STRING const char *
#define LJM_DOUBLE_RETURN double
#else // Linux
#ifdef LABJACK_LJM_ATTRIBUTE_VISIBILITY_DEFAULT
#define LJM_ERROR_RETURN __attribute__((__visibility__("default"))) int
#define LJM_LONG_LONG_RETURN __attribute__((__visibility__("default"))) long long
#define LJM_VOID_RETURN __attribute__((__visibility__("default"))) void
#define LJM_ERROR_STRING __attribute__((__visibility__("default"))) const char *
#define LJM_DOUBLE_RETURN __attribute__((__visibility__("default"))) double
#else
#define LJM_ERROR_RETURN int
#define LJM_LONG_LONG_RETURN long long
#define LJM_VOID_RETURN void
#define LJM_ERROR_STRING const char *
#define LJM_DOUBLE_RETURN double
#endif
#endif
#endif
/*************
* Constants *
*************/
// Read/Write direction constants:
static const int LJM_READ = 0;
static const int LJM_WRITE = 1;
// Data Types:
// These do automatic endianness conversion, if needed by the local machine's
// processor.
static const int LJM_UINT16 = 0; // C type of unsigned short
static const int LJM_UINT32 = 1; // C type of unsigned int
static const int LJM_INT32 = 2; // C type of int
static const int LJM_FLOAT32 = 3; // C type of float
// Advanced users data types:
// These do not do any endianness conversion.
static const int LJM_BYTE = 99; // Contiguous bytes. If the number of LJM_BYTEs is
// odd, the last, (least significant) byte is 0x00.
// For example, for 3 LJM_BYTES of values
// [0x01, 0x02, 0x03], LJM sends the contiguous byte
// array [0x01, 0x02, 0x03, 0x00]
static const int LJM_STRING = 98; // Same as LJM_BYTE, but LJM automatically appends
// a null-terminator.
static const unsigned int LJM_STRING_MAX_SIZE = 49;
// Max LJM_STRING size not including the automatic null-terminator
// Max LJM_STRING size with the null-terminator
enum { LJM_STRING_ALLOCATION_SIZE = 50 };
// LJM_NamesToAddresses uses this when a register name is not found
static const int LJM_INVALID_NAME_ADDRESS = -1;
enum { LJM_MAX_NAME_SIZE = 256 };
// 18 = 6 * 2 (number of byte chars) + 5 (number of colons) + 1 (null-terminator)
enum { LJM_MAC_STRING_SIZE = 18 };
// 16 is INET_ADDRSTRLEN
enum { LJM_IPv4_STRING_SIZE = 16 };
static const int LJM_BYTES_PER_REGISTER = 2;
// Device types:
enum {
LJM_dtANY = 0,
LJM_dtT4 = 4,
LJM_dtT7 = 7,
LJM_dtT8 = 8,
LJM_dtDIGIT = 200,
LJM_dtTSERIES = 84
};
// Connection types:
enum {
LJM_ctANY = 0,
LJM_ctANY_TCP = LJM_ctANY,
LJM_ctUSB = 1,
// TCP
LJM_ctTCP = 2,
LJM_ctNETWORK_TCP = LJM_ctTCP,
LJM_ctETHERNET = 3,
LJM_ctETHERNET_TCP = LJM_ctETHERNET,
LJM_ctWIFI = 4,
LJM_ctWIFI_TCP = LJM_ctWIFI,
// UDP
LJM_ctANY_UDP = 11,
LJM_ctNETWORK_UDP = 5,
LJM_ctETHERNET_UDP = 6,
LJM_ctWIFI_UDP = 7,
// TCP or UDP
LJM_ctNETWORK_ANY = 8,
LJM_ctETHERNET_ANY = 9,
LJM_ctWIFI_ANY = 10
};
// Network constants:
static const int LJM_TCP_PORT = 502;
static const int LJM_ETHERNET_UDP_PORT = 52362;
static const int LJM_WIFI_UDP_PORT = 502;
static const int LJM_NO_IP_ADDRESS = 0;
static const int LJM_NO_PORT = 0;
// Identifier types:
static const char * const LJM_DEMO_MODE = "-2";
static const int LJM_idANY = 0;
// LJM_AddressesToMBFB Constants
enum { LJM_DEFAULT_FEEDBACK_ALLOCATION_SIZE = 62 };
static const int LJM_USE_DEFAULT_MAXBYTESPERMBFB = 0;
// LJM_MBFBComm Constants;
static const int LJM_DEFAULT_UNIT_ID = 1;
// LJM_ListAll Constants
enum { LJM_LIST_ALL_SIZE = 128 };
// Timeout Constants. Times in milliseconds.
static const int LJM_NO_TIMEOUT = 0;
static const int LJM_DEFAULT_USB_SEND_RECEIVE_TIMEOUT_MS = 2600;
static const int LJM_DEFAULT_ETHERNET_OPEN_TIMEOUT_MS = 1000;
static const int LJM_DEFAULT_ETHERNET_SEND_RECEIVE_TIMEOUT_MS = 2600;
static const int LJM_DEFAULT_WIFI_OPEN_TIMEOUT_MS = 1000;
static const int LJM_DEFAULT_WIFI_SEND_RECEIVE_TIMEOUT_MS = 4000;
// Stream Constants
static const int LJM_DUMMY_VALUE = -9999;
static const int LJM_SCAN_NOT_READ = -8888;
static const int LJM_GND = 199;
/*****************************************************************************
* Return Values *
* Success: *
* Constant: LJME_NOERROR *
* Description: The function executed without error. *
* Range: 0 *
* *
* Warnings: *
* Prefix: LJME_ *
* Description: Some or all outputs might be valid. *
* Range: 200-399 *
* *
* Modbus Errors: *
* Prefix: LJME_MBE *
* Description: Errors corresponding to official Modbus errors which are *
* returned from the device. *
* Note: To find the original Modbus error in base 10, subtract 1200. *
* Ranges: 1200-1216 *
* *
* Library Errors: *
* Prefix: LJME_ *
* Description: Errors where all outputs are null, invalid, 0, or 9999. *
* Range: 1220-1399 *
* *
* Device Errors: *
* Description: Errors returned from the firmware on the device. *
* Range: 2000-2999 *
* *
* User Area: *
* Description: Errors defined by users. *
* Range: 3900-3999 *
* */
// Success
LJM_ERROR_CODE LJME_NOERROR = 0;
// Warnings:
LJM_ERROR_CODE LJME_WARNINGS_BEGIN = 200;
LJM_ERROR_CODE LJME_WARNINGS_END = 399;
LJM_ERROR_CODE LJME_FRAMES_OMITTED_DUE_TO_PACKET_SIZE = 201;
// Functions:
// LJM_AddressesToMBFB:
// Problem: This indicates that the length (in bytes) of the Feedback
// command being created was greater than the value passed as
// MaxBytesPerMBFB. As a result, the command returned is a valid
// Feedback command that includes some of the frames originally
// specified, but not all of them. You can check the NumFrames
// pointer to find out how many frames were included.
// Solutions:
// 1) Pass a larger value for MaxBytesPerMBFB and make sure
// aMBFBCommand has memory allocated of size MaxBytesPerMBFB.
// The default size for MaxBytesPerMBFB is 64.
// 2) Split the command into multiple commands.
// Any other function that creates a Feedback command:
// Problem: The Feedback command being created was too large for
// the device to handle on this connection type.
// Solution: Split the command into multiple commands.
LJM_ERROR_CODE LJME_DEBUG_LOG_FAILURE = 202;
LJM_ERROR_CODE LJME_USING_DEFAULT_CALIBRATION = 203;
// Problem: LJM has detected the device has one or more invalid calibration
// constants and is using the default calibration constants. Readings may
// inaccurate.
// Solution: Contact LabJack support.
LJM_ERROR_CODE LJME_DEBUG_LOG_FILE_NOT_OPEN = 204;
// Modbus Errors:
LJM_ERROR_CODE LJME_MODBUS_ERRORS_BEGIN = 1200;
LJM_ERROR_CODE LJME_MODBUS_ERRORS_END = 1216;
LJM_ERROR_CODE LJME_MBE1_ILLEGAL_FUNCTION = 1201;
LJM_ERROR_CODE LJME_MBE2_ILLEGAL_DATA_ADDRESS = 1202;
LJM_ERROR_CODE LJME_MBE3_ILLEGAL_DATA_VALUE = 1203;
LJM_ERROR_CODE LJME_MBE4_SLAVE_DEVICE_FAILURE = 1204;
LJM_ERROR_CODE LJME_MBE5_ACKNOWLEDGE = 1205;
LJM_ERROR_CODE LJME_MBE6_SLAVE_DEVICE_BUSY = 1206;
LJM_ERROR_CODE LJME_MBE8_MEMORY_PARITY_ERROR = 1208;
LJM_ERROR_CODE LJME_MBE10_GATEWAY_PATH_UNAVAILABLE = 1210;
LJM_ERROR_CODE LJME_MBE11_GATEWAY_TARGET_NO_RESPONSE = 1211;
// Library Errors:
LJM_ERROR_CODE LJME_LIBRARY_ERRORS_BEGIN = 1220;
LJM_ERROR_CODE LJME_LIBRARY_ERRORS_END = 1399;
LJM_ERROR_CODE LJME_UNKNOWN_ERROR = 1221;
LJM_ERROR_CODE LJME_INVALID_DEVICE_TYPE = 1222;
LJM_ERROR_CODE LJME_INVALID_HANDLE = 1223;
LJM_ERROR_CODE LJME_DEVICE_NOT_OPEN = 1224;
LJM_ERROR_CODE LJME_STREAM_NOT_INITIALIZED = 1225;
LJM_ERROR_CODE LJME_DEVICE_DISCONNECTED = 1226;
LJM_ERROR_CODE LJME_DEVICE_NOT_FOUND = 1227;
LJM_ERROR_CODE LJME_APERIODIC_STREAM_OUT_NOT_INITIALIZED = 1228;
LJM_ERROR_CODE LJME_DEVICE_ALREADY_OPEN = 1229;
LJM_ERROR_CODE LJME_DEVICE_CURRENTLY_CLAIMED_BY_ANOTHER_PROCESS = 1230;
LJM_ERROR_CODE LJME_CANNOT_CONNECT = 1231;
LJM_ERROR_CODE LJME_STREAM_OUT_INDEX_OUT_OF_RANGE = 1232;
LJM_ERROR_CODE LJME_SOCKET_LEVEL_ERROR = 1233;
LJM_ERROR_CODE LJME_SCAN_RATE_INCONSISTENT = 1234;
LJM_ERROR_CODE LJME_CANNOT_OPEN_DEVICE = 1236;
LJM_ERROR_CODE LJME_CANNOT_DISCONNECT = 1237;
LJM_ERROR_CODE LJME_WINSOCK_FAILURE = 1238;
LJM_ERROR_CODE LJME_RECONNECT_FAILED = 1239;
LJM_ERROR_CODE LJME_CONNECTION_HAS_YIELDED_RECONNECT_FAILED = 1240;
LJM_ERROR_CODE LJME_USB_FAILURE = 1241;
/* LJM does not support U3, U6, UE9, or U12 devices */
LJM_ERROR_CODE LJME_U3_NOT_SUPPORTED_BY_LJM = 1243;
LJM_ERROR_CODE LJME_U6_NOT_SUPPORTED_BY_LJM = 1246;
LJM_ERROR_CODE LJME_UE9_NOT_SUPPORTED_BY_LJM = 1249;
LJM_ERROR_CODE LJME_INVALID_ADDRESS = 1250;
LJM_ERROR_CODE LJME_INVALID_CONNECTION_TYPE = 1251;
LJM_ERROR_CODE LJME_INVALID_DIRECTION = 1252;
LJM_ERROR_CODE LJME_INVALID_FUNCTION = 1253;
// Function: LJM_MBFBComm
// Problem: The aMBFB buffer passed as an input parameter
// did not have a function number corresponding to Feedback.
// Solution: Make sure the 8th byte of your buffer is 76 (base 10).
// (For example, aMBFB[7] == 76 should evaluate to true.)
LJM_ERROR_CODE LJME_INVALID_NUM_REGISTERS = 1254;
LJM_ERROR_CODE LJME_INVALID_PARAMETER = 1255;
LJM_ERROR_CODE LJME_INVALID_PROTOCOL_ID = 1256;
// Problem: The Protocol ID was not in the proper range.
LJM_ERROR_CODE LJME_INVALID_TRANSACTION_ID = 1257;
// Problem: The Transaction ID was not in the proper range.
LJM_ERROR_CODE LJME_NUM_WRITES_LARGER_THAN_AVAILABLE_SPACE = 1258;
// Problem: tried to write more values than are available in write-out queue
LJM_ERROR_CODE LJME_UNKNOWN_VALUE_TYPE = 1259;
LJM_ERROR_CODE LJME_MEMORY_ALLOCATION_FAILURE = 1260;
// Problem: A memory allocation attempt has failed, probably due to a
// lack of available memory.
LJM_ERROR_CODE LJME_NO_COMMAND_BYTES_SENT = 1261;
// Problem: No bytes could be sent to the device.
// Possibilities:
// * The device was previously connected, but was suddenly
// disconnected.
LJM_ERROR_CODE LJME_INCORRECT_NUM_COMMAND_BYTES_SENT = 1262;
// Problem: The expected number of bytes could not be sent to the device.
// Possibilities:
// * The device was disconnected while bytes were being sent.
LJM_ERROR_CODE LJME_NO_RESPONSE_BYTES_RECEIVED = 1263;
// Problem: No bytes could be received from the device.
// Possibilities:
// * The device was previously connected, but was suddenly
// disconnected.
// * The timeout length was too short for the device to respond.
LJM_ERROR_CODE LJME_INCORRECT_NUM_RESPONSE_BYTES_RECEIVED = 1264;
// Problem: The expected number of bytes could not be received from the
// device.
// Possibilities:
// * The device was previously connected, but was suddenly
// disconnected.
// * The device needs a firmware update.
LJM_ERROR_CODE LJME_MIXED_FORMAT_IP_ADDRESS = 1265;
// Functions: LJM_OpenS and LJM_Open
// Problem: The string passed as an identifier contained an IP address
// that was ambiguous.
// Solution: Make sure the IP address is in either decimal format
// (i.e. "192.168.1.25") or hex format (i.e. "0xC0.A8.0.19").
LJM_ERROR_CODE LJME_UNKNOWN_IDENTIFIER = 1266;
LJM_ERROR_CODE LJME_NOT_IMPLEMENTED = 1267;
LJM_ERROR_CODE LJME_INVALID_INDEX = 1268;
// Problem: An error internal to the LabJackM Library has occurred.
// Solution: Please report this error to LabJack.
LJM_ERROR_CODE LJME_INVALID_LENGTH = 1269;
LJM_ERROR_CODE LJME_ERROR_BIT_SET = 1270;
LJM_ERROR_CODE LJME_INVALID_MAXBYTESPERMBFB = 1271;
// Functions:
// LJM_AddressesToMBFB:
// Problem: This indicates the MaxBytesPerMBFB value was
// insufficient for any Feedback command.
// Solution: Pass a larger value for MaxBytesPerMBFB and make sure
// aMBFBCommand has memory allocated of size MaxBytesPerMBFB.
// The default size for MaxBytesPerMBFB is 64.
LJM_ERROR_CODE LJME_NULL_POINTER = 1272;
// Problem: The Library has received an invalid pointer.
// Solution: Make sure that any functions that have pointers in their
// parameter list are valid pointers that point to allocated memory.
LJM_ERROR_CODE LJME_NULL_OBJ = 1273;
// Functions:
// LJM_OpenS and LJM_Open:
// Problem: The Library failed to parse the input parameters.
// Solution: Check the validity of your inputs and if the problem
// persists, please contact LabJack support.
LJM_ERROR_CODE LJME_RESERVED_NAME = 1274;
// LJM_OpenS and LJM_Open:
// Problem: The string passed as Identifier was a reserved name.
// Solution: Use a different name for your device. You can also connect
// by passing the device's serial number or IP address, if
// applicable.
LJM_ERROR_CODE LJME_UNPARSABLE_DEVICE_TYPE = 1275;
// LJM_OpenS:
// Problem: This Library could not parse the DeviceType.
// Solution: Check the LJM_OpenS documentation and make sure the
// DeviceType does not contain any unusual characters.
LJM_ERROR_CODE LJME_UNPARSABLE_CONNECTION_TYPE = 1276;
// LJM_OpenS:
// Problem: This Library could not parse the ConnectionType.
// Solution: Check the LJM_OpenS documentation and make sure the
// ConnectionType does not contain any unusual characters.
LJM_ERROR_CODE LJME_UNPARSABLE_IDENTIFIER = 1277;
// LJM_OpenS and LJM_Open:
// Problem: This Library could not parse the Identifier.
// Solution: Check the LJM_OpenS documentation and make sure the
// Identifier does not contain any unusual characters.
LJM_ERROR_CODE LJME_PACKET_SIZE_TOO_LARGE = 1278;
// Problems: The packet being sent to the device contained too many bytes.
// Note: Some LabJack devices need two bytes appended to any Modbus packets
// sent to a device. The packet size plus these two appended bytes
// could have exceeded the packet size limit.
// Solution: Send a smaller packet, i.e. break your packet up into multiple
// packets.
LJM_ERROR_CODE LJME_TRANSACTION_ID_ERR = 1279;
// Problem: LJM received an unexpected Modbus Transaction ID.
LJM_ERROR_CODE LJME_PROTOCOL_ID_ERR = 1280;
// Problem: LJM received an unexpected Modbus Protocol ID.
LJM_ERROR_CODE LJME_LENGTH_ERR = 1281;
// Problem: LJM received a packet with an unexpected Modbus Length.
LJM_ERROR_CODE LJME_UNIT_ID_ERR = 1282;
// Problem: LJM received a packet with an unexpected Modbus Unit ID.
LJM_ERROR_CODE LJME_FUNCTION_ERR = 1283;
// Problem: LJM received a packet with an unexpected Modbus Function.
LJM_ERROR_CODE LJME_STARTING_REG_ERR = 1284;
// Problem: LJM received a packet with an unexpected Modbus address.
LJM_ERROR_CODE LJME_NUM_REGS_ERR = 1285;
// Problem: LJM received a packet with an unexpected Modbus number of
// registers.
LJM_ERROR_CODE LJME_NUM_BYTES_ERR = 1286;
// Problem: LJM received a packet with an unexpected Modbus number of bytes.
LJM_ERROR_CODE LJME_CONFIG_FILE_NOT_FOUND = 1289;
LJM_ERROR_CODE LJME_CONFIG_PARSING_ERROR = 1290;
LJM_ERROR_CODE LJME_INVALID_NUM_VALUES = 1291;
LJM_ERROR_CODE LJME_CONSTANTS_FILE_NOT_FOUND = 1292;
LJM_ERROR_CODE LJME_INVALID_CONSTANTS_FILE = 1293;
LJM_ERROR_CODE LJME_INVALID_NAME = 1294;
// Problem: LJM received a name that was not found/matched in the constants
// file or was otherwise an invalid name.
// Solution: Use LJM_ErrorToString to find the invalid name(s).
LJM_ERROR_CODE LJME_OVERSPECIFIED_PORT = 1296;
// Functions: LJM_Open, LJM_OpenS
// Problem: LJM received an Identifier that specified a port/pipe, but
// connection type was not specified.
LJM_ERROR_CODE LJME_INTENT_NOT_READY = 1297;
// Please contact LabJack support if the problem is not apparent.
LJM_ERROR_CODE LJME_ATTR_LOAD_COMM_FAILURE = 1298;
/**
* Name: LJME_ATTR_LOAD_COMM_FAILURE
* Functions: LJM_Open, LJM_OpenS
* Desc: Indicates that a device was found and opened, but communication with
* that device failed, so the device was closed. The handle returned is
* not a valid handle. This communication failure can mean the device is
* in a non-responsive state or has out-of-date firmware.
* Solutions: a) Power your device off, then back on, i.e. unplug it then plug
* it back in.
* b) Make sure your device(s) have up-to-date firmware.
**/
LJM_ERROR_CODE LJME_INVALID_CONFIG_NAME = 1299;
// Functions: LJM_WriteLibraryConfigS, LJM_WriteLibraryConfigStringS,
// LJM_ReadLibraryConfigS, LJM_ReadLibraryConfigStringS
// Problem: An unknown string has been passed in as Parameter.
// Solution: Please check the documentation in this header file for the
// configuration parameter you are trying to read or write. Not all
// config parameters can be read, nor can all config parameters be
// written.
LJM_ERROR_CODE LJME_ERROR_RETRIEVAL_FAILURE = 1300;
// Problem: A device has reported an error and LJM failed to to retrieve the
// error code from the device.
// Solution: Please make sure the device has current firmware and that this
// is a current of LJM. If the problem persists, please contact LabJack
// support.
LJM_ERROR_CODE LJME_LJM_BUFFER_FULL = 1301;
LJM_ERROR_CODE LJME_COULD_NOT_START_STREAM = 1302;
LJM_ERROR_CODE LJME_STREAM_NOT_RUNNING = 1303;
LJM_ERROR_CODE LJME_UNABLE_TO_STOP_STREAM = 1304;
LJM_ERROR_CODE LJME_INVALID_VALUE = 1305;
LJM_ERROR_CODE LJME_SYNCHRONIZATION_TIMEOUT = 1306;
LJM_ERROR_CODE LJME_OLD_FIRMWARE = 1307;
LJM_ERROR_CODE LJME_CANNOT_READ_OUT_ONLY_STREAM = 1308;
LJM_ERROR_CODE LJME_NO_SCANS_RETURNED = 1309;
LJM_ERROR_CODE LJME_TEMPERATURE_OUT_OF_RANGE = 1310;
LJM_ERROR_CODE LJME_VOLTAGE_OUT_OF_RANGE = 1311;
LJM_ERROR_CODE LJME_FUNCTION_DOES_NOT_SUPPORT_THIS_TYPE = 1312;
// Desc: The function does not support the given data type. For example,
// LJM_eReadName and LJM_eReadAddress do not support reading
// LJM_STRING values, which are too large.
LJM_ERROR_CODE LJME_INVALID_INFO_HANDLE = 1313;
LJM_ERROR_CODE LJME_NO_DEVICES_FOUND = 1314;
// Desc: An Open/OpenS call was called - with any device type, any
// connection type, and any identifier - but no devices were found.
LJM_ERROR_CODE LJME_AUTO_IPS_FILE_NOT_FOUND = 1316;
LJM_ERROR_CODE LJME_AUTO_IPS_FILE_INVALID = 1317;
LJM_ERROR_CODE LJME_INVALID_INTERVAL_HANDLE = 1318;
LJM_ERROR_CODE LJME_NAMED_MUTEX_PERMISSION_DENIED = 1319;
LJM_ERROR_CODE LJME_DIGITAL_AUTO_RECOVERY_ERROR_DETECTED = 1320;
// Desc: During stream, the device buffer overflowed, causing auto-recovery
// to occur. However, the first channel of stream was not compatible with
// auto-recovery. To avoid this error, either:
// 1. Use one of the following channels as the first stream channel:
// An analog input (AIN0, AIN1, ...)
// FIO_STATE
// EIO_STATE
// CIO_STATE
// MIO_STATE
// EIO_CIO_STATE
// CIO_MIO_STATE
// or:
// 2. Ensure that the first stream channel cannot return 0xFFFF and set
// LJM_STREAM_DIGITAL_AUTO_RECOVERY_ERROR_DETECTION_DISABLED to 1.
// See labjack.com/digital-auto-recovery-error-detection
LJM_ERROR_CODE LJME_NEGATIVE_RECEIVE_BUFFER_SIZE = 1321;
// Problem: During stream, the receive buffer size
// was negative. This is probably because
// LJM_STREAM_TCP_RECEIVE_BUFFER_SIZE was set to too large a number to be represented
// by the signed data type being used, int.
// Solution: Use a smaller LJM_STREAM_TCP_RECEIVE_BUFFER_SIZE.
/*******************************
* Device Management Functions *
*******************************/
/**
* Name: LJM_ListAll, LJM_ListAllS
* Desc: Scans for LabJack devices, returning arrays describing the devices
* found, allowing LJM_dtANY and LJM_ctANY to be used
* Para: DeviceType, filters which devices will be returned (LJM_dtT7,
* LJM_dtDIGIT, etc.). LJM_dtANY is allowed.
* ConnectionType, filters by connection type (LJM_ctUSB or LJM_ctTCP).
* LJM_ctANY is allowed.
* NumFound, a pointer that returns the number of devices found
* aDeviceTypes, an array that must be preallocated to size
* LJM_LIST_ALL_SIZE, returns the device type for each of the
* NumFound devices
* aConnectionTypes, an array that must be preallocated to size
* LJM_LIST_ALL_SIZE, returns the connect type for each of the
* NumFound devices
* aSerialNumbers, an array that must be preallocated to size
* LJM_LIST_ALL_SIZE, returns the serial number for each of the
* NumFound devices
* aIPAddresses, an array that must be preallocated to size
* LJM_LIST_ALL_SIZE, returns the IPAddresses for each of the
* NumFound devices, but only if ConnectionType is TCP-based. For
* each corresponding device for which aConnectionTypes[i] is not
* TCP-based, aIPAddresses[i] will be LJM_NO_IP_ADDRESS.
* Note: These functions only show what devices could be opened. To actually
* open a device, use LJM_Open or LJM_OpenS.
* Note: These functions will ignore NULL pointers, except for NumFound.
**/
LJM_ERROR_RETURN LJM_ListAll(int DeviceType, int ConnectionType,
int * NumFound, int * aDeviceTypes, int * aConnectionTypes,
int * aSerialNumbers, int * aIPAddresses);
LJM_ERROR_RETURN LJM_ListAllS(const char * DeviceType, const char * ConnectionType,
int * NumFound, int * aDeviceTypes, int * aConnectionTypes,
int * aSerialNumbers, int * aIPAddresses);
/**
* Name: LJM_ListAllExtended
* Desc: Advanced version of LJM_ListAll that performs an additional query of
* arbitrary registers on the device.
* Para: DeviceType, filters which devices will be returned (LJM_dtT7,
* LJM_dtDIGIT, etc.). LJM_dtANY is allowed.
* ConnectionType, filters by connection type (LJM_ctUSB or LJM_ctTCP).
* LJM_ctANY is allowed.
* NumAddresses, the number of addresses to query. Also the size of
* aAddresses and aNumRegs.
* aAddresses, the addresses to query for each device that is found.
* aNumRegs, the number of registers to query for each address.
* Each aNumRegs[i] corresponds to aAddresses[i].
* MaxNumFound, the maximum number of devices to find. Also the size of
* aDeviceTypes, aConnectionTypes, aSerialNumbers, and aIPAddresses.
* NumFound, a pointer that returns the number of devices found
* aDeviceTypes, an array that must be preallocated to size
* MaxNumFound, returns the device type for each of the
* NumFound devices
* aConnectionTypes, an array that must be preallocated to size
* MaxNumFound, returns the connect type for each of the
* NumFound devices
* aSerialNumbers, an array that must be preallocated to size
* MaxNumFound, returns the serial number for each of the
* NumFound devices
* aIPAddresses, an array that must be preallocated to size
* MaxNumFound, returns the IPAddresses for each of the
* NumFound devices, but only if ConnectionType is TCP-based. For
* each corresponding device for which aConnectionTypes[i] is not
* TCP-based, aIPAddresses[i] will be LJM_NO_IP_ADDRESS.
* aBytes, an array that must be preallocated to size:
* MaxNumFound * <the sum of aNumRegs> * LJM_BYTES_PER_REGISTER,
* which will contain the query bytes sequentially. A device
* represented by index i would have an aBytes index of:
* (i * <the sum of aNumRegs> * LJM_BYTES_PER_REGISTER).
* Note: These functions only show what devices could be opened. To actually
* open a device, use LJM_Open or LJM_OpenS.
* Note: These functions will ignore NULL pointers, except for NumFound and
* aBytes.
**/
LJM_ERROR_RETURN LJM_ListAllExtended(int DeviceType, int ConnectionType,
int NumAddresses, const int * aAddresses, const int * aNumRegs,
int MaxNumFound, int * NumFound, int * aDeviceTypes, int * aConnectionTypes,
int * aSerialNumbers, int * aIPAddresses, unsigned char * aBytes);
/**
* Name: LJM_OpenS
* Desc: Opens a LabJack device.
* Para: DeviceType, a string containing the type of the device to be connected,
* optionally prepended by "LJM_dt". Possible values include "ANY",
* "T4", "T7", and "T8".
* ConnectionType, a string containing the type of the connection desired,
* optionally prepended by "LJM_ct". Possible values include "ANY",
* "USB", "TCP", "ETHERNET", and "WIFI".
* Identifier, a string identifying the device to be connected or
* "LJM_idANY"/"ANY". This can be a serial number, IP address, or
* device name. Device names may not contain periods.
* Handle, the new handle that represents a device connection upon success
* Retr: LJME_NOERROR, if a device was successfully opened.
* LJME_ATTR_LOAD_COMM_FAILURE, if a device was found, but there was a
* communication failure.
* Note: Input parameters are not case-sensitive.
* Note: Empty strings passed to DeviceType, ConnectionType, or Identifier
* indicate the same thing as LJM_dtANY, LJM_ctANY, or LJM_idANY,
* respectively.
**/
LJM_ERROR_RETURN LJM_OpenS(const char * DeviceType, const char * ConnectionType,
const char * Identifier, int * Handle);
/**
* Name: LJM_Open
* Desc: See the description for LJM_OpenS. The only difference between
* LJM_Open and LJM_OpenS is the first two parameters.
* Para: DeviceType, a constant corresponding to the type of device to open,
* such as LJM_dtT7, or LJM_dtANY.
* ConnectionType, a constant corresponding to the type of connection to
* open, such as LJM_ctUSB, or LJM_ctANY.
**/
LJM_ERROR_RETURN LJM_Open(int DeviceType, int ConnectionType,
const char * Identifier, int * Handle);
/**
* Name: LJM_GetHandleInfo
* Desc: Takes a device handle as input and returns details about that device.
* Para: Handle, a valid handle to an open device.
* DeviceType, the output device type corresponding to a constant such as
* LJM_dtT7.
* ConnectionType, the output device type corresponding to a constant
* such as LJM_ctUSB.
* SerialNumber, the output serial number of the device.
* IPAddress, the output integer representation of the device's IP
* address when ConnectionType is TCP-based. If ConnectionType is not
* TCP-based, this will be LJM_NO_IP_ADDRESS. Note that this can be
* converted to a human-readable string with the LJM_NumberToIP
* function.
* Port, the output port if the device connection is TCP-based, or the pipe
* if the device connection is USB-based.
* MaxBytesPerMB, the maximum packet size in number of bytes that can be
* sent to or received from this device. Note that this can change
* depending on connection type and device type.
* Note: This function returns device information loaded during an open call
* and therefore does not initiate communications with the device. In
* other words, it is fast but will not represent changes to serial
* number or IP address since the device was opened.
* Warn: This function ignores null pointers
**/
LJM_ERROR_RETURN LJM_GetHandleInfo(int Handle, int * DeviceType,
int * ConnectionType, int * SerialNumber, int * IPAddress, int * Port,
int * MaxBytesPerMB);
/**
* Name: LJM_Close
* Desc: Closes the connection to the device.
* Para: Handle, a valid handle to an open device.
**/
LJM_ERROR_RETURN LJM_Close(int Handle);
/**
* Name: LJM_CloseAll
* Desc: Closes all connections to all devices
**/
LJM_ERROR_RETURN LJM_CloseAll(void);
/**
* Name: LJM_CleanInfo
* Desc: Cleans/deallocates an InfoHandle.
* Para: InfoHandle, The info handle to clean/deallocate.
* Note: Calling LJM_CleanInfo on the same handle twice will return the error
* LJME_INVALID_INFO_HANDLE.
**/
LJM_ERROR_RETURN LJM_CleanInfo(int InfoHandle);
/******************************
* Easy Read/Write Functions *
******************************/
// Easy Functions: All type, either reading or writing, single address
/**
* Name: LJM_eReadAddress, LJM_eReadName
* LJM_eWriteAddress, LJM_eWriteName
* Desc: Creates and sends a Modbus operation, then receives and parses the
* response.
* Para: Handle, a valid handle to an open device
* (Address), an address to read/write
* (Type), the type corresponding to Address
* (Name), a name to read/write
* Value, a value to write or read
* Note: These functions may take liberties in deciding what kind of Modbus
* operation to create. For more control of what kind of packets may be
* sent/received, please see the LJM_WriteLibraryConfigS function.
**/
LJM_ERROR_RETURN LJM_eWriteAddress(int Handle, int Address, int Type, double Value);
LJM_ERROR_RETURN LJM_eReadAddress(int Handle, int Address, int Type, double * Value);
LJM_ERROR_RETURN LJM_eWriteName(int Handle, const char * Name, double Value);
LJM_ERROR_RETURN LJM_eReadName(int Handle, const char * Name, double * Value);
// Easy Functions: All type, either reading or writing, multiple addresses
/**
* Name: LJM_eReadAddresses, LJM_eReadNames
* LJM_eWriteAddresses, LJM_eWriteNames
* Desc: Creates and sends a Modbus operation, then receives and parses the
* response.
* Para: Handle, a valid handle to an open device.
* NumFrames, the total number of reads/writes to perform.
* (aAddresses), an array of size NumFrames of the addresses to
* read/write for each frame.
* (aTypes), an array of size NumFrames of the data types corresponding
* to each address in aAddresses.
* (aNames), an array of size NumFrames of the names to read/write for
* each frame.
* aValues, an array of size NumFrames that represents the values to
* write from or read to.
* ErrorAddress, a pointer to an integer, which in the case of a relevant
* error, gets updated to contain the device-reported address that
* caused an error.
* Note: Reads/writes are compressed into arrays for consecutive addresses that
* line up, based on type. See the LJM_ALLOWS_AUTO_CONDENSE_ADDRESSES
* configuration.
* Note: These functions may take liberties in deciding what kind of Modbus
* operation to create. For more control of what kind of packets may be
* sent/received, please see the LJM_WriteLibraryConfigS function.
**/
LJM_ERROR_RETURN LJM_eReadAddresses(int Handle, int NumFrames,
const int * aAddresses, const int * aTypes, double * aValues,
int * ErrorAddress);
LJM_ERROR_RETURN LJM_eReadNames(int Handle, int NumFrames,
const char ** aNames, double * aValues, int * ErrorAddress);
LJM_ERROR_RETURN LJM_eWriteAddresses(int Handle, int NumFrames,
const int * aAddresses, const int * aTypes, const double * aValues,
int * ErrorAddress);
LJM_ERROR_RETURN LJM_eWriteNames(int Handle, int NumFrames,
const char ** aNames, const double * aValues, int * ErrorAddress);
// Easy Functions: All type, reading and writing, multiple values to one address
/**
* Name: LJM_eReadAddressArray, LJM_eReadNameArray
* LJM_eWriteAddressArray, LJM_eWriteNameArray
* Desc: Performs a Modbus operation to either read or write an array.
* Para: Handle, a valid handle to an open device.
* (Address), the address to read an array from or write an array to.
* (Type), the data type of Address.
* (Name), the register name to read an array from or write an array to.
* NumValues, the size of the array to read or write.
* aValues, an array of size NumValues that represents the values to
* write from or read to.
* ErrorAddress, a pointer to an integer, which in the case of a relevant
* error, gets updated to contain the device-reported address that
* caused an error.
* Note: If NumValues is large enough, these functions will automatically split
* writes and reads into multiple packets based on the current device's
* effective data packet size. Using both non-buffer and buffer registers
* in one function call is not supported.
**/
LJM_ERROR_RETURN LJM_eReadAddressArray(int Handle, int Address, int Type,
int NumValues, double * aValues, int * ErrorAddress);
LJM_ERROR_RETURN LJM_eReadNameArray(int Handle, const char * Name,
int NumValues, double * aValues, int * ErrorAddress);
LJM_ERROR_RETURN LJM_eWriteAddressArray(int Handle, int Address, int Type,
int NumValues, const double * aValues, int * ErrorAddress);
LJM_ERROR_RETURN LJM_eWriteNameArray(int Handle, const char * Name,
int NumValues, const double * aValues, int * ErrorAddress);
// Easy Functions: Reading and writing using bytes
/**
* Name: LJM_eReadAddressByteArray, LJM_eReadNameByteArray
* LJM_eWriteAddressByteArray, LJM_eWriteNameByteArray
* Desc: Performs a Modbus operation to either read or write a byte array.
* Para: Handle, a valid handle to an open device.
* (Address), the address to read an array from or write a byte array to.
* (Name), the register name to read an array from or write a byte array
* to.
* NumBytes, the size of the byte array to read or write.
* aBytes, a byte array of size NumBytes that represents the values to
* write from or read to.
* ErrorAddress, a pointer to an integer, which in the case of a relevant
* error, gets updated to contain the device-reported address that
* caused an error.
* Note: These functions will append a 0x00 byte to aBytes for odd-numbered
* NumBytes.
* Note: If NumBytes is large enough, these functions will automatically split
* writes and reads into multiple packets based on the current device's
* effective data packet size. Using both non-buffer and buffer registers
* in one function call is not supported.
**/
LJM_ERROR_RETURN LJM_eReadAddressByteArray(int Handle, int Address,
int NumBytes, char * aBytes, int * ErrorAddress);
LJM_ERROR_RETURN LJM_eReadNameByteArray(int Handle, const char * Name,
int NumBytes, char * aBytes, int * ErrorAddress);
LJM_ERROR_RETURN LJM_eWriteAddressByteArray(int Handle, int Address,
int NumBytes, const char * aBytes, int * ErrorAddress);
LJM_ERROR_RETURN LJM_eWriteNameByteArray(int Handle, const char * Name,
int NumBytes, const char * aBytes, int * ErrorAddress);
// Easy Functions: All type, reading and writing, multiple addresses with
// multiple values for each
/**
* Name: LJM_eAddresses, LJM_eNames
* Desc: Performs Modbus operations that write/read data.
* Para: Handle, a valid handle to an open device.
* NumFrames, the total number of reads/writes frames to perform.
* (aAddresses), an array of size NumFrames of the addresses to
* read/write for each frame.
* (aTypes), an array of size NumFrames of the data types corresponding
* to each address in aAddresses.
* (aNames), an array of size NumFrames of the names to read/write for
* each frame.
* aWrites, an array of size NumFrames of the direction/access type
* (LJM_READ or LJM_WRITE) for each frame.
* aNumValues, an array of size NumFrames giving the number of values to
* read/write for each frame.
* aValues, an array that represents the values to write or read. The
* size of this array must be the sum of aNumValues.
* ErrorAddress, a pointer to an integer, which in the case of a relevant
* error, gets updated to contain the device-reported address that
* caused an error.
* Note: Reads/writes are compressed into arrays for consecutive addresses that
* line up, based on type. See the LJM_ALLOWS_AUTO_CONDENSE_ADDRESSES
* configuration.
* Note: These functions may take liberties in deciding what kind of Modbus
* operation to create. For more control of what kind of packets may be
* sent/received, please see the LJM_WriteLibraryConfigS function.
**/
LJM_ERROR_RETURN LJM_eAddresses(int Handle, int NumFrames,
const int * aAddresses, const int * aTypes, const int * aWrites,
const int * aNumValues, double * aValues, int * ErrorAddress);
LJM_ERROR_RETURN LJM_eNames(int Handle, int NumFrames, const char ** aNames,
const int * aWrites, const int * aNumValues, double * aValues,
int * ErrorAddress);
/**
* Name: LJM_eReadNameString, LJM_eReadAddressString
* Desc: Reads a 50-byte string from a device.
* Para: Handle, a valid handle to an open device.
* (Name), the name of the registers to read, which must be of type
* LJM_STRING.
* (Address), the address of the registers to read an LJM_STRING from.
* String, A string that is updated to contain the result of the read.
* Must be allocated to size LJM_STRING_ALLOCATION_SIZE or
* greater prior to calling this function.
* Note: This is a convenience function for LJM_eNames/LJM_eAddressess.
* Note: LJM_eReadNameString checks to make sure that Name is in the constants
* file and describes registers that have a data type of LJM_STRING,
* but LJM_eReadAddressString does not perform any data type checking.
**/
LJM_ERROR_RETURN LJM_eReadNameString(int Handle, const char * Name,
char * String);
LJM_ERROR_RETURN LJM_eReadAddressString(int Handle, int Address,
char * String);
/**
* Name: LJM_eWriteNameString, LJM_eWriteAddressString
* Desc: Writes a 50-byte string to a device.
* Para: Handle, a valid handle to an open device.
* (Name), the name of the registers to write to, which must be of type
* LJM_STRING
* (Address), the address of the registers to write an LJM_STRING to
* String, The string to write. Must null-terminate at length
* LJM_STRING_ALLOCATION_SIZE or less.
* Note: This is a convenience function for LJM_eNames/LJM_eAddressess
* Note: LJM_eWriteNameString checks to make sure that Name is in the constants
* file and describes registers that have a data type of LJM_STRING,
* but LJM_eWriteAddressString does not perform any data type checking.
**/
LJM_ERROR_RETURN LJM_eWriteNameString(int Handle, const char * Name,
const char * String);
LJM_ERROR_RETURN LJM_eWriteAddressString(int Handle, int Address,
const char * String);
/*********************
* Stream Functions *
*********************/
/**
* Name: LJM_eStreamStart
* Desc: Initializes a stream object and begins streaming. This includes
* creating a buffer in LJM that collects data from the device.
* Para: Handle, a valid handle to an open device.
* ScansPerRead, Number of scans returned by each call to the
* LJM_eStreamRead function. This is not tied to the maximum packet
* size for the device.
* NumAddresses, The size of aScanList. The number of addresses to scan.
* aScanList, Array of Modbus addresses to collect samples from, per scan.
* ScanRate, input/output pointer. Sets the desired number of scans per
* second. Upon successful return of this function, gets updated to
* the actual scan rate that the device will scan at.
* Note: Address configuration such as range, resolution, and differential
* voltages are handled by writing to the device.
* Note: Check your device's documentation for which addresses are valid for
* aScanList.
**/
LJM_ERROR_RETURN LJM_eStreamStart(int Handle, int ScansPerRead,
int NumAddresses, const int * aScanList, double * ScanRate);
/**
* Name: LJM_eStreamRead
* Desc: Returns data from an initialized and running LJM stream buffer. Waits
* for data to become available, if necessary.
* Para: Handle, a valid handle to an open device.
* aData, Output data array. Returns all addresses interleaved. Must be
* large enough to hold (ScansPerRead * NumAddresses) values.
* ScansPerRead and NumAddresses are set when stream is set up with
* LJM_eStreamStart. The data returned is removed from the LJM stream
* buffer.
* DeviceScanBacklog, The number of scans left in the device buffer, as
* measured from when data was last collected from the device. This
* should usually be near zero and not growing for healthy streams.
* LJMScanBacklog, The number of scans left in the LJM buffer, as
* measured from after the data returned from this function is
* removed from the LJM buffer. This should usually be near zero and
* not growing for healthy streams.
* Note: Returns LJME_NO_SCANS_RETURNED if LJM_STREAM_SCANS_RETURN is
* LJM_STREAM_SCANS_RETURN_ALL_OR_NONE.
**/
LJM_ERROR_RETURN LJM_eStreamRead(int Handle, double * aData,
int * DeviceScanBacklog, int * LJMScanBacklog);
/**
* Name: LJM_SetStreamCallback
* Desc: Sets a callback that is called by LJM when the stream has collected
* ScansPerRead scans or if an error has occurred.
* Para: Handle, a valid handle to an open device.
* Callback, the callback function for LJM's stream thread to call
* when stream data is ready, which should call LJM_eStreamRead to
* acquire data.
* Arg, the user-defined argument that is passed to Callback when it is
* invoked.
* Note: LJM_SetStreamCallback should be called after LJM_eStreamStart.
* Note: To disable the previous callback for stream reading, pass 0 or NULL as
* Callback.
* Note: LJM_SetStreamCallback may not be called from within a
* LJM_StreamReadCallback.
**/
typedef void (*LJM_StreamReadCallback)(void *);
LJM_ERROR_RETURN LJM_SetStreamCallback(int Handle,
LJM_StreamReadCallback Callback, void * Arg);
/**
* Name: LJM_eStreamStop
* Desc: Stops LJM from streaming any more data from the device, while leaving
* any collected data in the LJM buffer to be read. Stops the device from
* streaming.
* Para: Handle, a valid handle to an open device.
**/
LJM_ERROR_RETURN LJM_eStreamStop(int Handle);
/**
* Name: LJM_StreamBurst
* Desc: Initializes a stream burst and collects data. This function combines
* LJM_eStreamStart, LJM_eStreamRead, and LJM_eStreamStop, as well as some
* other device initialization.
* Para: Handle, a valid handle to an open device.
* NumAddresses, The size of aScanList. The number of addresses to scan.