00001 # MinGW {#mingw}
00002
00003 The following instructions were performed with x86 Minimalist GNU for Windows (MinGW) installed from http:
00004
00005 For brevity, these instructions assume the default installation location of "C:\Program Files (x86)\Galil\gclib".
00006
00007 ## Copy Files
00008 Copy "gclib\examples\mingw" to a convenient, writable location, e.g. "C:\temp". Run `C:\temp\mingw\copy_source.bat` to copy all files.
00009
00010 ## x_simple.c
00011
00012 ### Edit GOpen() call as necessary
00013 In a text editor, open *x_simple.c*. Find the GOpen() call and update the address to match the desired hardware. See the documentation for GOpen() for address formatting options.
00014
00015 ### Compile
00016
00017 * Launch the MinGW terminal, e.g. *Start -> All Programs -> MinGW-W64 project -> i686-4.9.1-posix-dwarf-rt_v3-rev3 -> Run Terminal*.
00018 * Navigate to the directory with the files above.
00019 * Compile the code.
00020
00021
00022 C:\temp\mingw\>gcc x_simple.c -L. -lgclibo -lgclib -o simple.exe
00023
00024 ### Execute
00025
00026 C:\temp\mingw>simple.exe
00027 rc: 0
00028 version: 85.60.138
00029 rc: 0
00030 rc: 0
00031 info: 10.1.3.17, DMC4020 Rev 1.2b, 291
00032 rc: 0
00033 response: 1584328.0000
00034 :
00035
00036
00037 ## x_examples.cpp
00038
00039 ### Review and Modify source
00040 * In a text editor, open *x_examples.cpp*. Find the GOpen() call and update the address to match the desired hardware. See the documentation for GOpen() for address formatting options.
00041 * Find the `#if 0` preprocessor block enclosing the example calls. Change to `#if 1` to run the examples. Comment out the function calls to be avoided. Note some calls attempt to move motors and not all functions are compatible with all Galil products.
00042
00043 ### Compile
00044
00045 * Launch the MinGW terminal, e.g. *Start -> All Programs -> MinGW-W64 project -> i686-4.9.1-posix-dwarf-rt_v3-rev3 -> Run Terminal*.
00046 * Navigate to the directory with the files above.
00047 * Compile the code.
00048
00049
00050 C:\temp\mingw>g++ *.cpp -L. -lgclibo -lgclib -o examples.exe
00051
00052
00053 ### Execute
00054
00055 C:\temp\mingw>examples.exe
00056 Library version: 41.35.34
00057
00058 192.168.0.43, DMC4020 Rev 1.2b, 291
00059
00060
00061 ************************************************************************
00062 Example GRead() and GWrite() usage
00063 ************************************************************************
00064
00065 Read 155 QR bytes.
00066
00067 ************************************************************************
00068 Example GCommand() usage
00069 ************************************************************************
00070 Revision report, ^R^V
00071 DMC4020 Rev 1.2b
00072 :
00073
00074 Command Values
00075 val is 10
00076 val is 11
00077 val is 3.1415
00078 val is 9.869
00079
00080 Command Trimming
00081 > 95653016.0000
00082 :<
00083 > 95653016.0000<
00084 >95653016.0000<
00085
00086 Receiving Binary Data
00087 QR read 155 bytes
00088
00089 Error handling
00090 QD correctly trapped, not allowed, try GArrayDownload()
00091 DL correctly trapped, not allowed, try GProgramDownload()
00092
00093 Modifying timeout
00094 Burning program...OK
00095
00096 ************************************************************************
00097 Example GProgramDownload() and GProgramUpload() usage
00098 ************************************************************************
00099 GProgramDownload() correctly errored. Can't fit with level 3 compression
00100 Program Downloaded with compression level 4
00101 Uploading program:
00102 #A;i=0;i=i+1;i=i+1;i=i+1;i=i+1;i=i+1;i=i+1;i=i+1;i=i+1;i=i+1;i=i+1;i=i+1;i
00103 i=i+1;i=i+1;i=i+1;i=i+1;i=i+1;i=i+1;i=i+1;i=i+1;EN
00104
00105 Program executed as expected
00106 ************************************************************************
00107 Example GArrayDownload() and GArrayUpload() usage
00108 ************************************************************************
00109 2.0000, 4.0000, 6.0000, 8.0000, 10.0000, 12.0000, 14.0000, 16.0000, 18.000
00110 0000
00111
00112 2.0000, 1.0000, 3.0000, 5.0000, 10.0000, 12.0000, 14.0000, 16.0000, 18.000
00113 0000
00114
00115 3.0000, 5.0000, 10.0000
00116
00117 ************************************************************************
00118 Example GRecord() usage
00119 ************************************************************************
00120
00121 QR-based data record
00122 38564
00123 393216000
00124
00125 DR-based data record
00126 38670
00127 38772
00128 38874
00129 38976
00130 39078
00131 39180
00132 39282
00133 39384
00134 39486
00135 39588
00136 39690
00137
00138 QR-based data record with offsets
00139 39692
00140 39692
00141
00142 ************************************************************************
00143 Example GMessage() usage
00144 ************************************************************************
00145 0.0000
00146 1.0000
00147 2.0000
00148 3.0000
00149 4.0000
00150 5.0000
00151 6.0000
00152 7.0000
00153 8.0000
00154 9.0000
00155
00156 ************************************************************************
00157 Example GInterrupt() usage
00158 ************************************************************************
00159 "UI 8" executed.
00160
00161 ************************************************************************
00162 Example GMotionComplete() usage
00163 ************************************************************************
00164
00165 Position: 0, 0
00166 Beginning independent motion... Motion Complete on A
00167 Position: 8000, 0
00168
00169 Position: 0, 0
00170 Beginning vector motion... Motion Complete on vector plane S
00171 Position: 6000, 0
00172
00173
00174 examples.cpp executed OK
00175 main() is finished. Press Enter to exit: