This repository was archived by the owner on Jun 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAdwin.c
More file actions
1589 lines (1325 loc) · 61.5 KB
/
Adwin.c
File metadata and controls
1589 lines (1325 loc) · 61.5 KB
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
/******************************************************************************************************
* Collection of subroutines for the control of the ADwin measurement data acquisition
*
* Created : 22.08.1996 from Martin Hotze
*
* Modified: 01.04.1998 from HPB
*******************************************************************
* Version 1.00 M.S. 13.06.2001 Same function names as other adwin-developer driver
* Version 1.01 M.S. 07.08.2001 DeviceNo is now a variable (earlier version it was a define)
* Version 1.02 M.S. 17.05.2002 Five new functions (Get_Known_DeviceNo, Get_Known_USB_SerialNo, ADwin_Debug_Mode_Off,
* ADwin_Debug_Mode_On, GetFifo_Packed_Short, GetFifo_Packed_Long)
* Version 1.03 M.S. 18.07.2003 The function "GetFifo_Packed_Long " is deleted, because it was not working in the requested way.
* Version 1.04 M.S. 24.11.2003 In function "Set_Globaldelay" and "Get_Globaldelay" changed long->short from ProcessNo
* In function "GetData_Packed_Short", "GetData_Packed_Long", "GetData_Packed_Float" and "GetData_Packed_Double"
* changed the return value from (long)->(short), now "(short)LoadDLLIfNeeded()"
* Version 1.05 M.S. 05.05.2004 Two undocumented functions added: 'Get_Dev_ID' and 'GetConnectionTyp'
* Version 1.06 M.S. 21.02.2005 'Free_Mem' updated for processor T11
* Version 1.07 M.S. 31.01.2007 'Get_Last_Error_Text' useless Variable 'dllLoadError' deleted and IF-condition angepasst
* Version 1.08 M.S. 16.02.2009 New function 'File2Data'
* Version 1.09 M.S. 18.12.2009 Additional comment for function Get_Dev_ID
* Version 1.10 M.S. 01.12.2010 Support now 64Bit code generation. Testet with Adwin.cpp under VS2008.Net
* Depending on the compiler setting, UNICODE or ANSI is used in function LoadLibrary and MessageBox.
* Error constanst changed:
* kFailedToLoadDLLError 1->4000
* kCouldNotFindFunction 1->4001
* Version 1.11 M.S. 08.12.2010 Default DeviceNo changed from 0x150 (336) to 1.
* Version 1.12 M.S. 12.06.2015 New functions Free_Mem also for T12
* This Version supports new T12 functions, also working on older processors
* - Get_FPar_All_Double
* - Get_FPar_Block_Double
* - Get_FPar_Double
* - Set_FPar_Double
*
* Function of the DLL ADwin32(32-bit, respectively)
* =====================================================================
* Attention! the file "ADWIN32.DLL" respectively have to be included in a
* subdirectory that can be accessed by Windows ( at best in " \windows" or "\winnt")
* in order to use these functions the program "ADwin9.btl" (or ADwin4.btl or ADwin5.btl or ADwin8.btl
* respectively) has to be loaded to
* the ADwin system!
* The DLL ADwin32.dll respectively include all functions necessary for
* the data transfer between PC and the ADwin system.
*
* To Change from ADwin.c ->ADwin.cpp use #include "stdafx.h"
*******************************************************************************************************/
//#include "stdafx.h" // necessary for MFC projects
#include "windows.h"
#include "Adwin.h"
//internal error codes only for this c driver
#define kFailedToLoadDLLError 4000 //It was not possible to load the adwin32.dll or adwin64.dll
#define kCouldNotFindFunction 4001 //The called function is not available in the adwin32.dll or adwin64.dll which is used.
/* The variable "DeviceNo" is declared and inizialized to the default value of "1".
This variable is responsible for all accesses to the ADwin-system(s). */
short DeviceNo = 1; // Device number
int FirstTime = 1;
static HINSTANCE DLLHandle;
long (FAR PASCAL *Clear_Process_Ptr)(short ProcessNo, short Device_No);
long (FAR PASCAL *Boot_Ptr)(char my_FAR *Filename, short Device_No, long Memsize, short msgbox);
short (FAR PASCAL *Load_Process_Ptr)(char my_FAR *Filename, short Device_No, short msgbox);
short (FAR PASCAL *Start_Process_Ptr)(short Index, short Device_No);
short (FAR PASCAL *Stop_Process_Ptr)(short Index, short Device_No);
short (FAR PASCAL *Set_Par_Ptr)(short Index, long Value, short Device_No);
short (FAR PASCAL *Set_FPar_Ptr)(short Index, float Value, short Device_No);
long (FAR PASCAL *Get_Par_Ptr)(short Index, short Device_No);
float (FAR PASCAL *Get_FPar_Ptr)(short Index, short Device_No);
short (FAR PASCAL *Set_FPar_Double_Ptr)(short Index, double Value, short Device_No);
double (FAR PASCAL *Get_FPar_Double_Ptr)(short Index, short Device_No);
short (FAR PASCAL *Get_Data_Ptr)(void *Data, short typ, short DataNo, long Startindex, long Count ,short Device_No);
short (FAR PASCAL *Set_Data_Ptr)(void *Data, short typ, short DataNo, long Startindex, long Count ,short Device_No);
short (FAR PASCAL *Save_Fast_Ptr)(char my_FAR *Filename, short DataNo, long Startindex, long Count, short Mode, short Device_No);
short (FAR PASCAL *File2Data_Ptr)(char *Filename, short typ, short DataNo, long Startindex, short Device_No);
short (FAR PASCAL *Get_Fifo_Ptr)(void *Data, short typ, short FifoNo, long Count ,short Device_No);
short (FAR PASCAL *Set_Fifo_Ptr)(void *Data, short typ, short FifoNo, long Count ,short Device_No);
long (FAR PASCAL *Get_Fifo_Count_Ptr)(short FifoNo, short Device_No);
long (FAR PASCAL *Get_Fifo_Empty_Ptr)(short FifoNo, short Device_No);
short (FAR PASCAL *Fifo_Clear_Ptr)(short FifoNo, short Device_No);
short (FAR PASCAL *Get_ADC_Ptr)(short Channel, short Device_No);
short (FAR PASCAL *Set_DAC_Ptr)(short Channel, unsigned short Value, short Device_No);
long (FAR PASCAL *Get_Digin_Ptr)(short Device_No);
short (FAR PASCAL *Set_Digout_Ptr)(short Value, short Device_No);
long (FAR PASCAL *Get_Digout_Ptr)(short Device_No);
short (FAR PASCAL *Auslastung_Ptr)(short Device_No);
short (FAR PASCAL *Workload_Ptr)(long Priority, short Device_No);
short (FAR PASCAL *ADTest_Version_Ptr)(short Device_No, short msgbox);
long (FAR PASCAL *AD_Memory_Ptr)(short Device_No);
long (FAR PASCAL *AD_Memory_all_Ptr)(short Mem_Spec,short Device_No);
long (FAR PASCAL *AD_Memory_all_byte_Ptr)(short Mem_Spec,short Device_No);
short (FAR PASCAL *AD_Net_Connect_Ptr)(char my_FAR *Protocol, char my_FAR *Address, char my_FAR *Endpoint, char my_FAR *Password, long Message);
short (FAR PASCAL *AD_Net_Disconnect_Ptr)(void);
short (FAR PASCAL *ADProzessorTyp_Ptr)(short Device_No);
long (FAR PASCAL *AD_GetErrorCode_Ptr)(void);
char (FAR PASCAL *AD_GetErrorText_Ptr)(long ErrorCode, char *text, long lenght);
short (FAR PASCAL *Get_ADBPar_All_Ptr)(short Startindex, short Count, long *Array, short Device_No);
short (FAR PASCAL *Get_ADBFPar_All_Ptr)(short Startindex, short Count, float *Array, short Device_No);
short (FAR PASCAL *Get_ADBFPar_All_Double_Ptr)(short Startindex, short Count, double *Array, short Device_No);
long (FAR PASCAL *Get_Data_Length_Ptr)(short DataNo, short Device_No);
long (FAR PASCAL *ADSetLanguage_Ptr)(long language);
long (FAR PASCAL *GetData_String_Ptr)(char *Data, long MaxCount,short DataNo, short Device_No);
long (FAR PASCAL *String_Length_Ptr)(short DataNo, short Device_No);
long (FAR PASCAL *SetData_String_Ptr)(char *Data,short DataNo, short Device_No);
short (FAR PASCAL *GetData_Packed_Ptr)(void *Data, short Typ, short DataNo, long Startindex, long Count, short Device_No);
short (FAR PASCAL *Get_List_Ptr)(void *Destination,short typ, short Startindex, short proc,long Count, short Device_No);
short (FAR PASCAL *Set_List_Ptr)(void *Source,short typ,short Startindex, long Count, short Device_No);
short (FAR PASCAL *Start_Ptr)(short Index, short Device_No);
short (FAR PASCAL *Stop_Ptr)(short Index, short Device_No);
short (FAR PASCAL *Get_Known_Deviceno_Ptr)(short *Devices, long *Count_Devices);
long (FAR PASCAL *Get_Known_USB_SerialNo_Ptr)(long *SerialNo);
int (FAR PASCAL *ADwin_Debug_Mode_On_Ptr)(char my_FAR *Filename, long Size);
int (FAR PASCAL *ADwin_Debug_Mode_Off_Ptr)(void);
//05.05.04 MS
long (FAR PASCAL *Get_Dev_ID_Ptr)(short Device_No, long *value);
long (FAR PASCAL *Get_Connection_Type_Ptr)(short Device_No);
/* Error message from the DLL On(1)/Off(0) */
short message=1; /* Error message if funktion fails */
/* Iserv, ADBPrLoad and Test. 0 = don't show error message */
/* 1 = show error message */
/*************************************************/
/* Load DLL and get the address of the function */
/*************************************************/
int LoadDLLIfNeeded(void)
{
//If adwin32.dll handle exist, don't load pointers again
if (DLLHandle)
return 0;
//Depending on the compiler setting x86/x64 the correct adwin32.dll or adwin64.dll will be loaded.
#ifdef _WIN64
#ifdef UNICODE
DLLHandle = LoadLibrary(L"adwin64.dll");
#else
DLLHandle = LoadLibrary("adwin64.dll");
#endif // !UNICODE
#else
#ifdef UNICODE
DLLHandle = LoadLibrary(L"adwin32.dll");
#else
DLLHandle = LoadLibrary("adwin32.dll");
#endif // !UNICODE
#endif
if (DLLHandle == NULL) {
return kFailedToLoadDLLError;
}
if ((Boot_Ptr = (long (FAR PASCAL *)(char my_FAR *, short, long, short))GetProcAddress(DLLHandle,"ADboot"))==0)
goto FunctionNotFoundError;
if ((Load_Process_Ptr = (short (FAR PASCAL *)(char my_FAR *, short, short))GetProcAddress(DLLHandle,"ADBload"))==0)
goto FunctionNotFoundError;
if ((Start_Process_Ptr = (short (FAR PASCAL *)(short, short))GetProcAddress(DLLHandle,"ADB_Start"))==0)
goto FunctionNotFoundError;
if ((Stop_Process_Ptr = (short (FAR PASCAL *)(short, short))GetProcAddress(DLLHandle,"ADB_Stop"))==0)
goto FunctionNotFoundError;
if ((Set_Par_Ptr = (short (FAR PASCAL *)(short, long, short))GetProcAddress(DLLHandle,"Set_ADBPar"))==0)
goto FunctionNotFoundError;
if ((Set_FPar_Ptr = (short (FAR PASCAL *)(short, float, short))GetProcAddress(DLLHandle,"Set_ADBFPar"))==0)
goto FunctionNotFoundError;
if ((Set_FPar_Double_Ptr = (short (FAR PASCAL *)(short, double, short))GetProcAddress(DLLHandle,"Set_ADBFPar_Double"))==0)
goto FunctionNotFoundError;
if ((Get_Par_Ptr = (long (FAR PASCAL *)(short, short))GetProcAddress(DLLHandle,"Get_ADBPar"))==0)
goto FunctionNotFoundError;
if ((Get_FPar_Ptr = (float (FAR PASCAL *)(short, short))GetProcAddress(DLLHandle,"Get_ADBFPar"))==0)
goto FunctionNotFoundError;
if ((Get_FPar_Double_Ptr = (double (FAR PASCAL *)(short, short))GetProcAddress(DLLHandle,"Get_ADBFPar_Double"))==0)
goto FunctionNotFoundError;
if ((Get_Data_Ptr = (short (FAR PASCAL *)(void*, short, short, long, long, short))GetProcAddress(DLLHandle,"Get_Data"))==0)
goto FunctionNotFoundError;
if ((Set_Data_Ptr = (short (FAR PASCAL *)(void*, short, short, long, long, short))GetProcAddress(DLLHandle,"Set_Data"))==0)
goto FunctionNotFoundError;
if ((Save_Fast_Ptr = (short (FAR PASCAL *)(char my_FAR *, short, long, long, short, short))GetProcAddress(DLLHandle,"SaveFast"))==0)
goto FunctionNotFoundError;
if ((File2Data_Ptr = (short (FAR PASCAL *)(char my_FAR *, short, short, long, short ))GetProcAddress(DLLHandle,"File2Data"))==0)
goto FunctionNotFoundError;
if ((Get_Fifo_Ptr = (short (FAR PASCAL *)(void*, short, short, long, short))GetProcAddress(DLLHandle,"Get_Fifo"))==0)
goto FunctionNotFoundError;
if ((Set_Fifo_Ptr = (short (FAR PASCAL *)(void*, short, short, long, short))GetProcAddress(DLLHandle,"Set_Fifo"))==0)
goto FunctionNotFoundError;
if ((Get_Fifo_Count_Ptr = (long (FAR PASCAL *)(short, short))GetProcAddress(DLLHandle,"Get_Fifo_Count"))==0)
goto FunctionNotFoundError;
if ((Get_Fifo_Empty_Ptr = (long (FAR PASCAL *)(short, short))GetProcAddress(DLLHandle,"Get_Fifo_Empty"))==0)
goto FunctionNotFoundError;
if ((Fifo_Clear_Ptr = (short (FAR PASCAL *)(short, short))GetProcAddress(DLLHandle,"Clear_Fifo"))==0)
goto FunctionNotFoundError;
if ((Get_ADC_Ptr = (short (FAR PASCAL *)(short, short))GetProcAddress(DLLHandle,"Get_ADC"))==0)
goto FunctionNotFoundError;
if ((Set_DAC_Ptr = (short (FAR PASCAL *)(short, unsigned short, short))GetProcAddress(DLLHandle,"Set_DAC"))==0)
goto FunctionNotFoundError;
if ((Get_Digin_Ptr = (long (FAR PASCAL *)(short))GetProcAddress(DLLHandle,"Get_Digin"))==0)
goto FunctionNotFoundError;
if ((Set_Digout_Ptr = (short (FAR PASCAL *)(short, short))GetProcAddress(DLLHandle,"Set_Digout"))==0)
goto FunctionNotFoundError;
if ((Get_Digout_Ptr = (long (FAR PASCAL *)(short))GetProcAddress(DLLHandle,"Get_Digout"))==0)
goto FunctionNotFoundError;
if ((Auslastung_Ptr = (short (FAR PASCAL *)(short))GetProcAddress(DLLHandle,"AD_Auslastung"))==0)
goto FunctionNotFoundError;
if ((Workload_Ptr = (short (FAR PASCAL *)(long, short))GetProcAddress(DLLHandle,"AD_Workload"))==0)
goto FunctionNotFoundError;
if ((ADTest_Version_Ptr = (short (FAR PASCAL *)(short, short))GetProcAddress(DLLHandle,"ADTest_Version"))==0)
goto FunctionNotFoundError;
if ((AD_Memory_Ptr = (long (FAR PASCAL *)(short))GetProcAddress(DLLHandle,"AD_Memory"))==0)
goto FunctionNotFoundError;
if ((AD_Memory_all_Ptr = (long (FAR PASCAL *)(short, short))GetProcAddress(DLLHandle,"AD_Memory_all"))==0)
goto FunctionNotFoundError;
if ((AD_Net_Connect_Ptr = (short (FAR PASCAL *)(char my_FAR *, char my_FAR *, char my_FAR *, char my_FAR *, long))GetProcAddress(DLLHandle,"AD_Net_Connect"))==0)
goto FunctionNotFoundError;
if ((AD_Net_Disconnect_Ptr = (short (FAR PASCAL *)(void))GetProcAddress(DLLHandle,"AD_Net_Disconnect"))==0)
goto FunctionNotFoundError;
if ((AD_GetErrorCode_Ptr = (long (FAR PASCAL *)(void))GetProcAddress(DLLHandle,"ADGetErrorCode"))==0)
goto FunctionNotFoundError;
if ((AD_GetErrorText_Ptr = (char (FAR PASCAL *)(long, char *, long))GetProcAddress(DLLHandle,"ADGetErrorText"))==0)
goto FunctionNotFoundError;
if ((Get_ADBPar_All_Ptr = (short (FAR PASCAL *)(short, short, long *, short))GetProcAddress(DLLHandle,"Get_ADBPar_All"))==0)
goto FunctionNotFoundError;
if ((Get_ADBFPar_All_Double_Ptr = (short (FAR PASCAL *)(short, short, double *, short))GetProcAddress(DLLHandle,"Get_ADBFPar_All_Double"))==0)
goto FunctionNotFoundError;
if ((Get_ADBFPar_All_Ptr = (short (FAR PASCAL *)(short, short, float *, short))GetProcAddress(DLLHandle,"Get_ADBFPar_All"))==0)
goto FunctionNotFoundError;
if ((Get_Data_Length_Ptr = (long (FAR PASCAL *)(short, short))GetProcAddress(DLLHandle,"Get_Data_Length"))==0)
goto FunctionNotFoundError;
if ((ADSetLanguage_Ptr = (long (FAR PASCAL *)(long))GetProcAddress(DLLHandle,"ADSetLanguage"))==0)
goto FunctionNotFoundError;
if ((GetData_String_Ptr = (long (FAR PASCAL *)(char *, long, short, short))GetProcAddress(DLLHandle,"Get_Data_String"))==0)
goto FunctionNotFoundError;
if ((String_Length_Ptr = (long (FAR PASCAL *)(short, short))GetProcAddress(DLLHandle,"Get_Data_String_Length"))==0)
goto FunctionNotFoundError;
if ((SetData_String_Ptr = (long (FAR PASCAL *)(char *, short, short))GetProcAddress(DLLHandle,"Set_Data_String"))==0)
goto FunctionNotFoundError;
if ((GetData_Packed_Ptr = (short (FAR PASCAL *)(void *, short, short, long, long, short))GetProcAddress(DLLHandle,"Get_Data_packed"))==0)
goto FunctionNotFoundError;
if ((ADProzessorTyp_Ptr = (short (FAR PASCAL *)(short Device_No))GetProcAddress(DLLHandle,"ProzessorTyp"))==0)
goto FunctionNotFoundError;
if ((Clear_Process_Ptr = (long (FAR PASCAL *)(short, short))GetProcAddress(DLLHandle,"Clear_Process"))==0)
goto FunctionNotFoundError;
if ((Get_List_Ptr = (short (FAR PASCAL *)(void *, short, short, short, long, short))GetProcAddress(DLLHandle,"Get_List"))==0)
goto FunctionNotFoundError;
if ((Set_List_Ptr = (short (FAR PASCAL *)(void *, short, short, long, short))GetProcAddress(DLLHandle,"Set_List"))==0)
goto FunctionNotFoundError;
if ((Start_Ptr = (short (FAR PASCAL *)(short, short))GetProcAddress(DLLHandle,"Start"))==0)
goto FunctionNotFoundError;
if ((Stop_Ptr = (short (FAR PASCAL *)(short, short))GetProcAddress(DLLHandle,"Stop"))==0)
goto FunctionNotFoundError;
if ((Get_Known_Deviceno_Ptr = (short (FAR PASCAL *)(short *, long *))GetProcAddress(DLLHandle,"Get_Known_Deviceno"))==0)
goto FunctionNotFoundError;
if ((Get_Known_USB_SerialNo_Ptr = (long (FAR PASCAL *)(long *))GetProcAddress(DLLHandle,"Get_Known_USB_SerialNo"))==0)
goto FunctionNotFoundError;
if ((ADwin_Debug_Mode_On_Ptr = (int (FAR PASCAL *)(char my_FAR *, long))GetProcAddress(DLLHandle,"adwin_debug_mode_on"))==0)
goto FunctionNotFoundError;
if ((ADwin_Debug_Mode_Off_Ptr = (int (FAR PASCAL *)(void))GetProcAddress(DLLHandle,"adwin_debug_mode_off"))==0)
goto FunctionNotFoundError;
if ((Get_Dev_ID_Ptr = (long (FAR PASCAL *)(short, long *))GetProcAddress(DLLHandle,"get_dev_id"))==0)
goto FunctionNotFoundError;
if ((Get_Connection_Type_Ptr = (long (FAR PASCAL *)(short))GetProcAddress(DLLHandle,"ADGetConnectionTyp"))==0)
goto FunctionNotFoundError;
if ((AD_Memory_all_byte_Ptr = (long (FAR PASCAL *)(short, short))GetProcAddress(DLLHandle,"AD_Memory_all_byte"))==0)
goto FunctionNotFoundError;
return 0;
/* Error handling */
FunctionNotFoundError:
if (FirstTime==1)
{
#ifdef UNICODE
MessageBox(NULL, L"You need a new Version of your ADwin32.dll!\nAt least ADwin32.dll from 14.5.2001!\nYour ADwin32.dll will removed!", L"ADwin32.dll to old!", MB_ICONWARNING);
#else
MessageBox(NULL, "You need a new Version of your ADwin32.dll!\nAt least ADwin32.dll from 14.5.2001!\nYour ADwin32.dll will removed!", "ADwin32.dll to old!", MB_ICONWARNING);
#endif // !UNICODE
FirstTime = 0; /* No more messages */
}
FreeLibrary(DLLHandle); /* Remove the DLL */
DLLHandle = 0;
return kCouldNotFindFunction;
}
/*****************************************/
/* Connection code to the DLL functions */
/*****************************************/
/* Down-loads the operating system (BTL-file) to the ADwin-System */
/* ============================================================================== */
long Iserv(char my_FAR *Filename, long Memsize)
{
long dllLoadError;
if ((dllLoadError = (long)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Boot_Ptr)(Filename, DeviceNo, Memsize, message); /* Boot the ADwin card */
}
/* Down-loads the operating system (BTL-file) to the ADwin-System */
/* ============================================================================== */
long Boot(char my_FAR *Filename, long Memsize)
{
long dllLoadError;
if ((dllLoadError = (long)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (Iserv(Filename, Memsize)); /* Boot the ADwin card */
}
long ADboot(char my_FAR *Filename, short DeviceNo1, long Memsize)
{
long dllLoadError;
if ((dllLoadError = (long)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Boot_Ptr)(Filename, DeviceNo1, Memsize, message); /* Boot the ADwin card */
}
/* Loads an ADbasic-process (a bin file generated by ADbasic) to the ADwin board */
/* ============================================================================== */
short ADBPrLoad(char my_FAR *Filename)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Load_Process_Ptr)(Filename, DeviceNo, message); /* Load bin file */
}
/* Loads an ADbasic-process (a bin file generated by ADbasic) to the ADwin board */
/* ============================================================================== */
short ADBload(char my_FAR *Filename,short DeviceNo1,short msgbox)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Load_Process_Ptr)(Filename, DeviceNo1, msgbox); /* Load bin file */
}
/* Loads an ADbasic-process (a bin file generated by ADbasic) to the ADwin board */
/* ============================================================================== */
short Load_Process(char my_FAR *Filename)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Load_Process_Ptr)(Filename, DeviceNo, message); /* Load bin file */
}
/* Starts process number "ProcessNo" on the ADwin-System */
/* ============================================================================== */
short ADBStart (short ProcessNo)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Start_Process_Ptr)(ProcessNo, DeviceNo); /* Start process */
}
/* Starts process number "ProcessNo" on the ADwin-System */
/* ============================================================================== */
short Start_Process(short ProcessNo)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Start_Process_Ptr)(ProcessNo, DeviceNo); /* Start process */
}
/* Stops process number "ProcessNo" on the ADwin-System */
/* ============================================================================== */
short ADBStop (short ProcessNo)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Stop_Process_Ptr)(ProcessNo, DeviceNo); /* Stop process */
}
/* Stops process number "ProcessNo" on the ADwin-System */
/* ============================================================================== */
short Stop_Process(short ProcessNo)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Stop_Process_Ptr)(ProcessNo, DeviceNo); /* Stop process */
}
/* Sets a parameter (PAR_"Index") on the ADwin-System to "Value" */
/* ============================================================================== */
short SetPar (short Index, long Value)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Set_Par_Ptr)(Index, Value, DeviceNo); /* Set parameter */
}
/* Sets a parameter (PAR_"Index") on the ADwin-System to "Value" */
/* ============================================================================== */
short Set_Par (short Index, long Value)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Set_Par_Ptr)(Index, Value, DeviceNo); /* Set parameter */
}
/* Sets a float parameter (FPAR_"Index") on the ADwin-System to "Value" */
/* ============================================================================== */
short SetFPar (short Index, float Value)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Set_FPar_Ptr)(Index, Value, DeviceNo); /* Set float parameter */
}
/* Sets a parameter (FPAR_"Index") on the ADwin-System to "Value" */
/* ============================================================================== */
short Set_FPar (short Index, float Value)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Set_FPar_Ptr)(Index, Value, DeviceNo); /* Set float parameter */
}
/* Returns double value of parameter (FPAR_"Index") from the ADwin-System */
/* ============================================================================== */
short Set_FPar_Double(short Index, double Value)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Set_FPar_Double_Ptr)(Index, Value, DeviceNo); /* Set Double parameter */
}
/* Returns the value of parameter (PAR_"Index") from the ADwin-System */
/* ============================================================================== */
long GetPar(short Index)
{
long dllLoadError;
if ((dllLoadError = (long)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Get_Par_Ptr)(Index,DeviceNo); /* Get parameter */
}
/* Returns the value of parameter (PAR_"Index") from the ADwin-System */
/* ============================================================================== */
long Get_Par(short Index)
{
long dllLoadError;
if ((dllLoadError = (long)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Get_Par_Ptr)(Index,DeviceNo); /* Get parameter */
}
/* Returns float value of parameter (FPAR_"Index") from the ADwin-System */
/* ============================================================================== */
float GetFPar(short Index)
{
int dllLoadError;
if ((dllLoadError = LoadDLLIfNeeded())!=0)
return (float)dllLoadError;
return (*Get_FPar_Ptr)(Index, DeviceNo); /* Get float parameter */
}
/* Returns float value of parameter (FPAR_"Index") from the ADwin-System */
/* ============================================================================== */
float Get_FPar(short Index)
{
int dllLoadError;
if ((dllLoadError = LoadDLLIfNeeded())!=0)
return (float)dllLoadError;
return (*Get_FPar_Ptr)(Index, DeviceNo); /* Get float parameter */
}
/* Returns double value of parameter (FPAR_"Index") from the ADwin-System */
/* ============================================================================== */
double Get_FPar_Double(short Index)
{
int dllLoadError;
if ((dllLoadError = LoadDLLIfNeeded())!=0)
return (double)dllLoadError;
return (*Get_FPar_Double_Ptr)(Index, DeviceNo); /* Get float parameter */
}
/* If T12: Gets all 80 ADwin double parameters (FPar_1 - FPar_80) into a double array */
/* If T9..T11: Gets all 80 ADwin float parameters (FPar_1 - FPar_80) into a double array */
/* ============================================================================== */
short Get_FPar_All_Double (double Array[])
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Get_ADBFPar_All_Double_Ptr)(1, 80, Array, DeviceNo); /* Get float parameter */
}
/* Gets a block of ADwin double parameters into a double array */
/* ============================================================================== */
short Get_FPar_Block_Double(double Array[], short Startindex, short Count)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Get_ADBFPar_All_Double_Ptr)(Startindex, Count, Array, DeviceNo);
}
/* Element/e aus einem ADbasic Datensatz vom Transputer holen.
Übergabe in short ARRAY / wird in Doku nicht mehr beschrieben */
/* ==============================================================================*/
short GetData(short DataNo, short Data[], long Startindex, long Count )
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Get_Data_Ptr)(Data, TYPE_SHORT, DataNo, Startindex, Count, DeviceNo); /* Datensatz holen / get array of data */
}
/* Returns array-element(s) of long-type from ADwin-System-array (DATA_"DataNo") */
/* ============================================================================== */
short GetlData(short DataNo, long Data[], long Startindex, long Count)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Get_Data_Ptr)(Data, TYPE_LONG, DataNo, Startindex, Count, DeviceNo);
}
/* Returns array-element(s) of long-type from ADwin-System-array (DATA_"DataNo") */
/* ============================================================================== */
short GetData_Long (short DataNo, long Data[], long Startindex, long Count)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Get_Data_Ptr)(Data, TYPE_LONG, DataNo, Startindex, Count, DeviceNo);
}
/* Returns array-element(s) of double-type from ADwin-System-array (DATA_"DataNo") */
/* ============================================================================== */
short GetData_Double (short DataNo, double Data[],long Startindex, long Count)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Get_Data_Ptr)(Data, TYPE_DOUBLE, DataNo, Startindex, Count, DeviceNo);
}
/* Returns array-element(s) of float-type from ADwin-System-array (DATA_"DataNo") */
/* ============================================================================== */
short GetfData(short DataNo, float Data[], long Startindex, long Count)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Get_Data_Ptr)(Data, TYPE_FLOAT, DataNo, Startindex, Count, DeviceNo);
}
/* Returns array-element(s) of float-type from ADwin-System-array (DATA_"DataNo") */
/* ============================================================================== */
short GetData_Float (short DataNo, float Data[], long Startindex, long Count)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Get_Data_Ptr)(Data, TYPE_FLOAT, DataNo, Startindex, Count, DeviceNo);
}
/* Sets array-element(s) of ADwin-System from short-array */
/* ============================================================================== */
short SetData(short DataNo, short Data[], long Startindex, long Count)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Set_Data_Ptr)(Data, TYPE_SHORT, DataNo, Startindex, Count, DeviceNo);
}
/* Sets array-element(s) of ADwin-System from long-array */
/* ============================================================================== */
short SetlData(short DataNo, long Data[], long Startindex, long Count)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Set_Data_Ptr)(Data, TYPE_LONG, DataNo, Startindex, Count, DeviceNo);
}
/* Sets array-element(s) of ADwin-System from long-array */
/* ============================================================================== */
short SetData_Long(short DataNo, long Data[], long Startindex, long Count)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Set_Data_Ptr)(Data, TYPE_LONG, DataNo, Startindex, Count, DeviceNo);
}
/* Sets array-element(s) of ADwin-System from double-array */
/* ============================================================================== */
short SetData_Double(short DataNo, double Data[], long Startindex, long Count)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Set_Data_Ptr)(Data, TYPE_DOUBLE, DataNo, Startindex, Count, DeviceNo);
}
/* Sets array-element(s) of ADwin-System from float-array */
/* ============================================================================== */
short SetfData(short DataNo, float Data[], long Startindex, long Count)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Set_Data_Ptr)(Data, TYPE_FLOAT, DataNo, Startindex, Count, DeviceNo);
}
/* Sets array-element(s) of ADwin-System from float-array */
/* =============================================================================== */
short SetData_Float(short DataNo, float Data[], long Startindex, long Count)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Set_Data_Ptr)(Data, TYPE_FLOAT, DataNo, Startindex, Count, DeviceNo);
}
/* Writes array-elements of ADwin-System immediately to harddisk */
/* ============================================================================ */
short Data2File(char my_FAR *Filename, short DataNo, long Startindex, long Count, short Mode)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Save_Fast_Ptr)(Filename, DataNo, Startindex, Count, Mode, DeviceNo);
}
/* Writes a file immediately from harddisk to array-elements of ADwin-System */
/* ============================================================================ */
short File2Data(char my_FAR *Filename, short DataType, short DataNo, long Startindex)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
//Hint: DataType constant
// TYPE_LONG; 2= long
// TYPE_FLOAT; 5= float
// TYPE_DOUBLE; 6= double
return (*File2Data_Ptr)(Filename, DataType, DataNo, Startindex, DeviceNo);
}
/* Fetching the short-element(s) from a ADwin-System FIFO */
/* ============================================================================== */
short GetFifo(short FifoNo, short Data[], long Count)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Get_Fifo_Ptr)(Data, TYPE_SHORT, FifoNo, Count, DeviceNo);
}
/* Fetching the long-element(s) from a ADwin-System FIFO */
/* ============================================================================== */
short GetlFifo(short FifoNo, long Data[], long Count)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Get_Fifo_Ptr)(Data, TYPE_LONG, FifoNo, Count, DeviceNo);
}
/* Fetching the long-element(s) from a ADwin-System FIFO */
/* ============================================================================== */
short GetFifo_Long(short FifoNo, long Data[], long Count)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Get_Fifo_Ptr)(Data, TYPE_LONG, FifoNo, Count, DeviceNo);
}
/* Fetching the double-element(s) from a ADwin-System FIFO */
/* ============================================================================== */
short GetFifo_Double(short FifoNo, double Data[], long Count)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Get_Fifo_Ptr)(Data, TYPE_DOUBLE, FifoNo, Count, DeviceNo);
}
/* Fetching the float-element(s) from a ADwin-System FIFO */
/* ============================================================================== */
short GetfFifo(short FifoNo, float Data[], long Count)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Get_Fifo_Ptr)(Data, TYPE_FLOAT, FifoNo, Count, DeviceNo);
}
/* Fetching the float-element(s) from a ADwin-System FIFO */
/* ============================================================================== */
short GetFifo_Float(short FifoNo, float Data[], long Count)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Get_Fifo_Ptr)(Data, TYPE_FLOAT, FifoNo, Count, DeviceNo);
}
/* Sets FIFO-element(s) of ADwin-System from short-array */
/* ============================================================================== */
short SetFifo(short FifoNo, short Data[], long Count)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Set_Fifo_Ptr)(Data, TYPE_SHORT, FifoNo, Count, DeviceNo);
}
/* Sets FIFO-element(s) of ADwin-System from long-array */
/* ============================================================================== */
short SetlFifo(short FifoNo, long Data[], long Count)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Set_Fifo_Ptr)(Data, TYPE_LONG, FifoNo, Count, DeviceNo);
}
/* Sets FIFO-element(s) of ADwin-System from long-array */
/* ============================================================================== */
short SetFifo_Long(short FifoNo, long Data[], long Count)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Set_Fifo_Ptr)(Data, TYPE_LONG, FifoNo, Count, DeviceNo);
}
/* Sets FIFO-element(s) of ADwin-System from double-array */
/* ============================================================================== */
short SetFifo_Double(short FifoNo, double Data[], long Count)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Set_Fifo_Ptr)(Data, TYPE_DOUBLE, FifoNo, Count, DeviceNo);
}
/* Sets FIFO-element(s) of ADwin-System from float-array */
/* ============================================================================== */
short SetfFifo(short FifoNo, float Data[], long Count)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Set_Fifo_Ptr)(Data, TYPE_FLOAT, FifoNo, Count, DeviceNo);
}
/* Sets FIFO-element(s) of ADwin-System from float-array */
/* ============================================================================== */
short SetFifo_Float(short FifoNo, float Data[], long Count)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Set_Fifo_Ptr)(Data, TYPE_FLOAT, FifoNo, Count, DeviceNo);
}
/* Getting the number of elements in the FIFO */
/* ============================================================================== */
long GetFifoCount(short FifoNo)
{
long dllLoadError;
if ((dllLoadError = (long)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Get_Fifo_Count_Ptr)(FifoNo, DeviceNo);
}
/* Getting the number of elements in the FIFO */
/* ============================================================================== */
long Fifo_Full(short FifoNo)
{
long dllLoadError;
if ((dllLoadError = (long)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Get_Fifo_Count_Ptr)(FifoNo, DeviceNo);
}
/* Returns number of free elements in FIFO */
/* ============================================================================== */
long GetFifoEmpty(short FifoNo)
{
long dllLoadError;
if ((dllLoadError = (long)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Get_Fifo_Empty_Ptr)(FifoNo, DeviceNo);
}
/* Returns number of free elements in FIFO */
/* ============================================================================== */
long Fifo_Empty (short FifoNo)
{
long dllLoadError;
if ((dllLoadError = (long)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Get_Fifo_Empty_Ptr)(FifoNo, DeviceNo);
}
/* Initiats read and write pointer of FIFO */
/* ============================================================================== */
short ClearFifo (short FifoNo)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Fifo_Clear_Ptr)(FifoNo, DeviceNo);
}
/* Initiats read and write pointer of FIFO */
/* ============================================================================== */
short Fifo_Clear (short FifoNo)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Fifo_Clear_Ptr)(FifoNo, DeviceNo);
}
/* Returns measured value of analog input channel */
/* ============================================================================== */
unsigned short ADC(short Value)
{
unsigned short dllLoadError;
if ((dllLoadError = (unsigned short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Get_ADC_Ptr)(Value, DeviceNo); /* Messergebnis abholen */
}
/* Sets analog output "Channel" to value "Value" (in digits) */
/* ============================================================================== */
short SetDAC(short Channel, unsigned short Value)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Set_DAC_Ptr)(Channel, Value, DeviceNo);
}
/* Sets analog output "Channel" to value "Value" (in digits) */
/* ============================================================================== */
short DAC(short Channel, unsigned short Value)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Set_DAC_Ptr)(Channel, Value, DeviceNo);
}
/* Returns state of digital inputs (bits 0...15) */
/* ============================================================================== */
long DigIn()
{
long dllLoadError;
if ((dllLoadError = (long)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Get_Digin_Ptr)(DeviceNo); /* Ergebnis abholen */
}
/* Returns state of digital inputs (bits 0...15) */
/* ============================================================================== */
long Get_Digin()
{
long dllLoadError;
if ((dllLoadError = (long)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Get_Digin_Ptr)(DeviceNo); /* Ergebnis abholen */
}
/* Outputs the value which is found in "Value" on the digital outputs */
/* ============================================================================== */
short SetDigOut (short Value)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Set_Digout_Ptr)(Value, DeviceNo);
}
/* Outputs the value which is found in "Value" on the digital outputs */
/* ============================================================================== */
short Set_Digout (short Value)
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Set_Digout_Ptr)(Value, DeviceNo);
}
/* Returning the value of the digital outputs */
/* ============================================================================== */
long DigOut()
{
long dllLoadError;
if ((dllLoadError = (long)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Get_Digout_Ptr)(DeviceNo); /* Ergebnis abholen */
}
/* Returning the value of the digital outputs */
/* ============================================================================== */
long Get_Digout()
{
long dllLoadError;
if ((dllLoadError = (long)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Get_Digout_Ptr)(DeviceNo); /* Ergebnis abholen */
}
/* Returns how busy the CPU is (processor usage in percent) */
/* ============================================================================== */
short Auslast()
{
short dllLoadError;
if ((dllLoadError = (short)LoadDLLIfNeeded())!=0)
return dllLoadError;
return (*Auslastung_Ptr)(DeviceNo); /* Ergebnis abholen */
}
/* Returns how busy the CPU is (processor usage in percent) */