General > 8051 Development Tools
Server51
jairo:
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
vitaliy:
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
}
jairo:
This is not coded within Micro-IDE, right? Is this VB?
Thanks!
vitaliy:
This is Visual C++ code
jairo:
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!
Navigation
[0] Message Index
[#] Next page
Go to full version