BiPOM Forum

General => Microcontroller Development Systems => 8051 Development Tools => Topic started by: jairo on June 16, 2006, 09:38:07 am

Title: Server51
Post by: jairo on June 16, 2006, 09:38:07 am
What would be a good approach to getting Server51 AND the tlc2543 example, to work together.  

In other words, how could I, through Server51, get the temperature readings off thermocouples through the VC++ dlls?


Any help is appreciated
Title: Re: Server51
Post by: vitaliy on June 17, 2006, 01:04:58 am
CClientAPI::ReadAnalog

Form
long ReadAnalog(short DeviceType, short Channel, short * pVal)
Return value is ERRCODE value.

Description
Reads the analog input value from ADC board .
DeviceType value is a type of Analog-to-Digital converter
that is installed on the board

DEVICE_TLC2543.

Available values of Channel are:

ANALOG_CHANNEL1
ANALOG_CHANNEL2
ANALOG_CHANNEL3
ANALOG_CHANNEL4
ANALOG_CHANNEL5
ANALOG_CHANNEL6
ANALOG_CHANNEL7
ANALOG_CHANNEL8
ANALOG_CHANNEL9
ANALOG_CHANNEL10
ANALOG_CHANNEL11
ANALOG_CHANNEL12

DEVICE_MAX127, DEVICE_MAX128
Channel defines a number of physical analog input of ADC board.
Available values of Channel are 0,1,2,3,4,5,6, 7.
pVal is a pointer to the variable that receives analog input information.

Example

// Create an object

CClientAPI obj;

short Value;

if ( !obj.InitPort())

{

// Get the analog input value of channel #4

ERRCODE ec=board.ReadAnalog(DEVICE_TLC2543, ANALOG_CHANNEL4, &Value);

if ( !ec )

// Good request

else

// Bad request

}

Title: Re: Server51
Post by: jairo on June 20, 2006, 08:28:50 am
This is not coded within Micro-IDE, right?  Is this VB?

Thanks!
Title: Re: Server51
Post by: vitaliy on June 20, 2006, 09:06:54 am
This is Visual C++ code
Title: Re: Server51
Post by: jairo on June 20, 2006, 11:42:37 am
Do you have any sample code I could use, like a Visual Basic solution file (project) so that I can see how this is implemented because I\'m having a lot of problems.

For example:
main.cpp:

#include <CClientAPI.h>


int main()
{
   CClientAPI obj;
   obj.initPort();
   ....
   ....
   return 0;
}


Thanks!
Title: Re: Server51
Post by: vitaliy on June 20, 2006, 12:01:25 pm
Please visit http://www.bipom.com/clientapi.shtm
and download
http://www.bipom.com/files/clientapi/vc++.zip
Title: Re: Server51
Post by: jairo on June 20, 2006, 12:21:33 pm
I had already downloaded, but thanks!.

I realize the example you gave is straight from the ClientAPI.htm help file, however, it still doesn\'t really help me understand and there isn\'t any sample code in the zip file you mentioned.

To be more specific of the problems I\'m having, when I include the ClientAPI.h file in my main cpp

#include "ClientAPI.h"

I get a bunch of errors, the first of which says:

c:\\documents and settings\\...\\comms_defn.h(110) : error C2146: syntax error : missing \';\' before identifier \'baud\'

which points to DWORD.  I don\'t think it recognizes DWORD.  Do you have any ideas how I could fix this?

I\'m using MS Visual Studio 2005

Thanks!

Title: Re: Server51
Post by: vitaliy on June 22, 2006, 03:23:03 am
I have created simple Visual C++ 6.0 project to read TLC2543 analog channel #4  using Server51.
Please download
http://www.bipom.com/support/S51TLC2453.zip