EasyManua.ls Logo

Advantech ADAM-6000 series - Page 89

Advantech ADAM-6000 series
156 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
ADAMTCP_ReadReg
Description:
Read the holding register value at a specified range described in parameters.
Syntax:
int ADAMTCP_ReadReg(SOCKET conn_socket, WORD wStartAddress, WORD wCount, WORD
wData[ ])
Parameter:
conn_socket[in]: the handle that represent the connection socket
wStartAddress[in]: the starting address that to be read
wCount[in]: how many holdings register to be read
wData[out]: a unsigned 16 bits array that stored the read holding register
Return:
Please refer to Chapter 6-2-3 “Return Codes” for more detail information
Example:
// Read input registers demo program
//--- In this demo program, reading 16 register starting at register 0(address 1)
//--- The IP address for ADAM-6000 module is 172.16.2.200 in this demo program.
//--- Change the IP Address to match your ADAM-6000 module
#include <windows.h>
#include <winsock2.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "adv5ktcp.h"
#define DEFAULT_PORT 502

Related product manuals