Streaming functions are not prototyped in ADC10w.h

Post general discussions on using our drivers to write your own software here
Post Reply
vadimrok

Streaming functions are not prototyped in ADC10w.h

Post by vadimrok »

Hello!

ADC-12, W2K/Visual C++ 6.0, USB connection

I am trying to use streaming feature but some functions and variables are not prototyped in ADC10w.h (like BM_STREAM or adc10_run for example).
I downloade latest software (beta) but ADC10w.h is still dated 2001 and
does not contain any streaming-related functions.

Any ideas?

User avatar
markspencer
Site Admin
Site Admin
Posts: 598
Joined: Wed May 07, 2003 9:45 am

Post by markspencer »

Hi,

Here is the updated version of the ADC10w.h file. For you convenience I have emailed it to you.

Code: Select all

#ifdef __cplusplus
#define PREF1 extern "C"
#else
#define PREF1
#endif

#if defined (WIN32)
#define HUGE
#define PREF2 __declspec(dllexport) __stdcall

#elif defined (WINDOWS)
#define HUGE		huge
#define PREF2 _export far pascal

#elif defined (DOS)
#define HUGE		huge
#define PREF2 far pascal

#else
#error Operating system not defined
#endif

#define MAX_ADC10_UNITS 	3
#define MAX_ADC10_VALUE 	255
#define MAX_ADC12_VALUE		4095

#ifndef CM_DEFINED
#define CM_DEFINED
typedef enum {CM_AVERAGE, CM_MINIMUM, CM_MAXIMUM, CM_SUM, CM_MAX} COMBINATION_METHOD;
typedef enum {BM_SINGLE, BM_WINDOW, BM_STREAM} METHOD;
#endif

PREF1 short PREF2 adc10_get_driver_version (void);

PREF1 short PREF2 adc10_open_unit (short port, short type);

PREF1 void PREF2 adc10_close_unit (short port);

PREF1 short PREF2 adc10_get_unit_info (char * str, short str_lth, short line, short port);

PREF1 short PREF2 adc10_set_unit (short port);

PREF1   unsigned long PREF2 adc10_set_interval (unsigned long us_for_block,
					   unsigned long ideal_no_of_samples);

PREF1   void PREF2 adc10_set_trigger (unsigned short enabled,
					unsigned short auto_trigger,
					unsigned short auto_ms,
				    unsigned short falling,
				    unsigned short threshold,
				    unsigned short delay);

PREF1   unsigned long PREF2 adc10_get_values (unsigned short HUGE * buffer, unsigned long no_of_values);

PREF1   unsigned long PREF2 adc10_get_times_and_values (long HUGE * times, unsigned short HUGE * buffer, unsigned long no_of_values);

PREF1   short PREF2 adc10_get_value (void);

PREF1 void PREF2 adc10_get_value_and_time (unsigned long *sample_time, unsigned short *sample);


PREF1 unsigned long PREF2 adc10_get_combined_values
	(
	COMBINATION_METHOD  mode,   /* Combination modes (CM_XXX) */
	unsigned short readings_for_channels/* No of readings */
	);

PREF1 void PREF2 adc10_run (unsigned long no_of_values, unsigned short method);

PREF1 void PREF2 adc10_stop (void);
PREF1 short PREF2 adc10_ready(void);
PREF1 short PREF2 adc10_is_streaming (void);
Best regards,
Regards,

Mark Spencer

vadimrok

Streaming functions are not prototyped in ADC10w.h

Post by vadimrok »

Thanks!

You actually e-mailed me the wrong file: ADC11 instead of ADC10. The file you pasted in your reply is the correct one so I will be using it. Another question: even if the header file is right, is the library file (ADC10ms.lib) up to date?

User avatar
markspencer
Site Admin
Site Admin
Posts: 598
Joined: Wed May 07, 2003 9:45 am

Post by markspencer »

Hi,

I have tested the adc10ms.lib file and there is a linking error with the stop function. This means that you are able to start the unit, but you cannot stop the adc and restart it again unless you close your program down.

I have put a problem report in for this, so that it will get rectified.

If you have access to Borland C++, the adc1032.lib file is correct and will link all the functions.

Best regards,
Regards,

Mark Spencer

vadimrok

Streaming functions are not prototyped in ADC10w.h

Post by vadimrok »

Please notify me as soon as the library is updated. Unfortunately I can not use a Borland compiler.

Thanks in advance

vadimrok

Post by vadimrok »

Hello again!

There is a problem with adc10_run function. Every time I call it I receive an errror:
Unreleased global
File adc10usb.c line 848
or something similar

It seems to me that your USB stuff is rather unpolished and not production-ready, at least for MS Visual c++ 6.0

User avatar
markspencer
Site Admin
Site Admin
Posts: 598
Joined: Wed May 07, 2003 9:45 am

Post by markspencer »

Hi,

The only time I can get the message you specified to be reported is by trying to call function run more than once. This is linked to the adc10_stop not being able to be used. The runfunction only has to be called once to stream.

I will inform you as soon as the adc10ms.lib file has been updated.

Best regards,
Regards,

Mark Spencer

Post Reply