#include "AdsDef.h"
Go to the source code of this file.
Functions | |
long | AdsAddRoute (AmsNetId ams, const char *ip) |
void | AdsDelRoute (AmsNetId ams) |
long | AdsPortCloseEx (long port) |
long | AdsPortOpenEx () |
long | AdsGetLocalAddressEx (long port, AmsAddr *pAddr) |
long | AdsSyncReadReqEx2 (long port, const AmsAddr *pAddr, uint32_t indexGroup, uint32_t indexOffset, uint32_t bufferLength, void *buffer, uint32_t *bytesRead) |
long | AdsSyncReadDeviceInfoReqEx (long port, const AmsAddr *pAddr, char *devName, AdsVersion *version) |
long | AdsSyncReadStateReqEx (long port, const AmsAddr *pAddr, uint16_t *adsState, uint16_t *devState) |
long | AdsSyncReadWriteReqEx2 (long port, const AmsAddr *pAddr, uint32_t indexGroup, uint32_t indexOffset, uint32_t readLength, void *readData, uint32_t writeLength, const void *writeData, uint32_t *bytesRead) |
long | AdsSyncWriteReqEx (long port, const AmsAddr *pAddr, uint32_t indexGroup, uint32_t indexOffset, uint32_t bufferLength, const void *buffer) |
long | AdsSyncWriteControlReqEx (long port, const AmsAddr *pAddr, uint16_t adsState, uint16_t devState, uint32_t bufferLength, const void *buffer) |
long | AdsSyncAddDeviceNotificationReqEx (long port, const AmsAddr *pAddr, uint32_t indexGroup, uint32_t indexOffset, const AdsNotificationAttrib *pAttrib, PAdsNotificationFuncEx pFunc, uint32_t hUser, uint32_t *pNotification) |
long | AdsSyncDelDeviceNotificationReqEx (long port, const AmsAddr *pAddr, uint32_t hNotification) |
long | AdsSyncGetTimeoutEx (long port, uint32_t *timeout) |
long | AdsSyncSetTimeoutEx (long port, uint32_t timeout) |
Copyright (c) 2015 - 2016 Beckhoff Automation GmbH & Co. KG
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
long AdsAddRoute | ( | AmsNetId | ams, |
const char * | ip | ||
) |
Add new ams route to target system
[in] | ams | address of the target system |
[in] | ip | address of the target system |
void AdsDelRoute | ( | AmsNetId | ams | ) |
Delete ams route that had previously been added with AdsAddRoute().
[in] | ams | address of the target system |
long AdsGetLocalAddressEx | ( | long | port, |
AmsAddr * | pAddr | ||
) |
Returns the local NetId and port number.
[in] | port | port number of an Ads port that had previously been opened with AdsPortOpenEx(). |
[out] | pAddr | Pointer to the structure of type AmsAddr. |
long AdsPortCloseEx | ( | long | port | ) |
The connection (communication port) to the message router is closed. The port to be closed must previously have been opened via an AdsPortOpenEx() call.
[in] | port | port number of an Ads port that had previously been opened with AdsPortOpenEx(). |
long AdsPortOpenEx | ( | ) |
Establishes a connection (communication port) to the message router. The port number returned by AdsPortOpenEx() is required as parameter for further AdsLib function calls.
long AdsSyncAddDeviceNotificationReqEx | ( | long | port, |
const AmsAddr * | pAddr, | ||
uint32_t | indexGroup, | ||
uint32_t | indexOffset, | ||
const AdsNotificationAttrib * | pAttrib, | ||
PAdsNotificationFuncEx | pFunc, | ||
uint32_t | hUser, | ||
uint32_t * | pNotification | ||
) |
A notification is defined within an ADS server (e.g. PLC). When a certain event occurs a function (the callback function) is invoked in the ADS client (C program).
[in] | port | port number of an Ads port that had previously been opened with AdsPortOpenEx(). |
[in] | pAddr | Structure with NetId and port number of the ADS server. |
[in] | indexGroup | Index Group. |
[in] | indexOffset | Index Offset. |
[in] | pAttrib | Pointer to the structure that contains further information. |
[in] | pFunc | Pointer to the structure describing the callback function. |
[in] | hUser | 32-bit value that is passed to the callback function. |
[out] | pNotification | Address of the variable that will receive the handle of the notification. |
long AdsSyncDelDeviceNotificationReqEx | ( | long | port, |
const AmsAddr * | pAddr, | ||
uint32_t | hNotification | ||
) |
A notification defined previously is deleted from an ADS server.
[in] | port | port number of an Ads port that had previously been opened with AdsPortOpenEx(). |
[in] | pAddr | Structure with NetId and port number of the ADS server. |
[in] | hNotification | Address of the variable that contains the handle of the notification. |
long AdsSyncGetTimeoutEx | ( | long | port, |
uint32_t * | timeout | ||
) |
Read the configured timeout for the ADS functions. The standard value is 5000 ms.
[in] | port | port number of an Ads port that had previously been opened with AdsPortOpenEx(). |
[out] | timeout | Buffer to store timeout value in ms. |
long AdsSyncReadDeviceInfoReqEx | ( | long | port, |
const AmsAddr * | pAddr, | ||
char * | devName, | ||
AdsVersion * | version | ||
) |
Reads the identification and version number of an ADS server.
[in] | port | port number of an Ads port that had previously been opened with AdsPortOpenEx(). |
[in] | pAddr | Structure with NetId and port number of the ADS server. |
[out] | devName | Pointer to a character string of at least 16 bytes, that will receive the name of the ADS device. |
[out] | version | Address of a variable of type AdsVersion, which will receive the version number, revision number and the build number. |
long AdsSyncReadReqEx2 | ( | long | port, |
const AmsAddr * | pAddr, | ||
uint32_t | indexGroup, | ||
uint32_t | indexOffset, | ||
uint32_t | bufferLength, | ||
void * | buffer, | ||
uint32_t * | bytesRead | ||
) |
Reads data synchronously from an ADS server.
[in] | port | port number of an Ads port that had previously been opened with AdsPortOpenEx(). |
[in] | pAddr | Structure with NetId and port number of the ADS server. |
[in] | indexGroup | Index Group. |
[in] | indexOffset | Index Offset. |
[in] | bufferLength | Length of the data in bytes. |
[out] | buffer | Pointer to a data buffer that will receive the data. |
[out] | bytesRead | pointer to a variable. If successful, this variable will return the number of actually read data bytes. |
long AdsSyncReadStateReqEx | ( | long | port, |
const AmsAddr * | pAddr, | ||
uint16_t * | adsState, | ||
uint16_t * | devState | ||
) |
Reads the ADS status and the device status from an ADS server.
[in] | port | port number of an Ads port that had previously been opened with AdsPortOpenEx(). |
[in] | pAddr | Structure with NetId and port number of the ADS server. |
[out] | adsState | Address of a variable that will receive the ADS status (see data type ADSSTATE). |
[out] | devState | Address of a variable that will receive the device status. |
long AdsSyncReadWriteReqEx2 | ( | long | port, |
const AmsAddr * | pAddr, | ||
uint32_t | indexGroup, | ||
uint32_t | indexOffset, | ||
uint32_t | readLength, | ||
void * | readData, | ||
uint32_t | writeLength, | ||
const void * | writeData, | ||
uint32_t * | bytesRead | ||
) |
Writes data synchronously into an ADS server and receives data back from the ADS server.
[in] | port | port number of an Ads port that had previously been opened with AdsPortOpenEx(). |
[in] | pAddr | Structure with NetId and port number of the ADS server. |
[in] | indexGroup | Index Group. |
[in] | indexOffset | Index Offset. |
[in] | readLength | Length, in bytes, of the read buffer readData. |
[out] | readData | Buffer for data read from the ADS server. |
[in] | writeLength | Length of the data, in bytes, send to the ADS server. |
[in] | writeData | Buffer with data send to the ADS server. |
[out] | bytesRead | pointer to a variable. If successful, this variable will return the number of actually read data bytes. |
long AdsSyncSetTimeoutEx | ( | long | port, |
uint32_t | timeout | ||
) |
Alters the timeout for the ADS functions. The standard value is 5000 ms.
[in] | port | port number of an Ads port that had previously been opened with AdsPortOpenEx(). |
[in] | timeout | Timeout in ms. |
long AdsSyncWriteControlReqEx | ( | long | port, |
const AmsAddr * | pAddr, | ||
uint16_t | adsState, | ||
uint16_t | devState, | ||
uint32_t | bufferLength, | ||
const void * | buffer | ||
) |
Changes the ADS status and the device status of an ADS server.
[in] | port | port number of an Ads port that had previously been opened with AdsPortOpenEx(). |
[in] | pAddr | Structure with NetId and port number of the ADS server. |
[in] | adsState | New ADS status. |
[in] | devState | New device status. |
[in] | bufferLength | Length of the additional data, in bytes, send to the ADS server. |
[in] | buffer | Buffer with additional data send to the ADS server. |
long AdsSyncWriteReqEx | ( | long | port, |
const AmsAddr * | pAddr, | ||
uint32_t | indexGroup, | ||
uint32_t | indexOffset, | ||
uint32_t | bufferLength, | ||
const void * | buffer | ||
) |
Writes data synchronously to an ADS server.
[in] | port | port number of an Ads port that had previously been opened with AdsPortOpenEx(). |
[in] | pAddr | Structure with NetId and port number of the ADS server. |
[in] | indexGroup | Index Group. |
[in] | indexOffset | Index Offset. |
[in] | bufferLength | Length of the data, in bytes, send to the ADS server. |
[in] | buffer | Buffer with data send to the ADS server. |