-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME
129 lines (89 loc) · 4.21 KB
/
README
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
LabJack LJM C/C++ Examples
https://labjack.com/support/software/examples/ljm/c
Support for Windows, Mac, and Linux.
This examples package includes:
- .c/.cpp example programs
- utility .h headers
- a Python build system for Mac/Linux
- a Visual Studio 2008 build system for Windows
- Windows .exe executable files
#### Examples Organization
Examples folder:
LJM_Utilities.h
Contains general-purpose functions which help to simplify the logic of
the example programs.
For example, the `WriteNameOrDie` function is a wrapper function for
`LJM_eWriteName` that simply calls `LJM_eWriteName`, and if any error
occurs, it prints the error using `LJM_ErrorToString` then exits with an
error status.
LJM_StreamUtilities.h
Contains stream-related helper functions.
LabJackMModbusMap.h
Contains definitions describing the available device registers.
basic/
Contains examples showing the LJM Easy functions for performing
device operations. Also contains a looping read/write example.
more/
1-wire/
Contains a 1-Wire communication demonstration with the DS1822
sensor.
ain/
Contains examples showing how to perform analog input readings and
configurations.
asynch/
Contains a UART loopback test.
config/
Contains examples showing how to read and write device
configurations, including device name and power configurations.
dio/
Contains examples showing how to read and write digital IOs.
dio_ef/
Contains a demonstration of PWM output and counter input.
ethernet/
Contains examples showing how to read and write Ethernet
configurations.
i2c/
Contains a demonstration of I2C communication.
list_all/
Contains examples of displaying what LabJack devices are available
using LJM_ListAll.
lua/
Contains examples for loading and controlling lua scripts with LJM.
spi/
Contains a demonstration of SPI communication.
stream/
Contains stream examples, including burst stream, externally-clocked
stream, triggered stream, and stream out.
testing/
Contains a speed test and other tests.
utilities/
Contains utility programs, including a device info displayer, a
thermocouple example, and demonstrations
of functions such as LJM_WriteRaw/LJM_ReadRaw, LJM_NamesToAddresses,
LJM_ErrorToString, and the LJM library config functions, and a
dynamic runtime linking example for Windows.
watchdog/
Contains examples showing how to read and write watchdog
configurations.
wifi/
Contains examples showing how to read and write WiFi configurations
and properties.
#### Build systems
Windows:
The `examples\visual_studio_2008` directory contains a .sln and a .vcproj
file for each example program.
Newer versions of Visual Studio work with these .sln and .vcproj files,
though you will need to run the automatic upgrade process when opening them.
For Visual Studio 2017, you may get the following error:
Error C1083 Cannot open include file: 'stdio.h': No such file or directory
In this case, you need to switch the project SDK version from 8.1 to 10:
1. Open the Properties window for the project (e.g. in the Solution
Explorer, right click on the project - not the solution)
2. Change Configuration Properties -> General -> Target Platform Version
to something like 10.0.14393.0
Mac/Linux:
Each directory in `examples/` contains a `make.sh` script that will run the
corresponding SConstruct file. Additionally, the script
`examples/make_all.sh` will call all the `make.sh` scripts.
SConstruct is a Python-based build system. A local copy is included in
`scons-local-3.1.1`, though you will need Python installed.