public interface ADSLibrary
extends com.sun.jna.Library
ADS return codes can be found in the Beckhoff Information System. A search for "ADS return codes" will find many pages each with a link to the actual page listing the codes. They keep re-organizing the info system so a simple link here would probably break.
| Modifier and Type | Interface and Description |
|---|---|
static class |
ADSLibrary.AmsPort |
static class |
ADSLibrary.DeviceState
Possible states for an ADS device.
|
static class |
ADSLibrary.ErrorCode
ADS error codes.
|
static class |
ADSLibrary.IndexGroup
The index group numbers meaningful to ADS.
|
static class |
ADSLibrary.TransMode
Transmission modes for ADS notifications.
|
| Modifier and Type | Method and Description |
|---|---|
long |
AdsAddRoute(AmsNetId ams,
String ip)
Add a new local AMS route to a target system.
|
void |
AdsDelRoute(AmsNetId ams)
Delete a local AMS route that had previously been added with AdsAddRoute().
|
long |
AdsGetLocalAddressEx(long port,
AmsAddr pAddr)
Returns the local NetId and port number.
|
long |
AdsPortCloseEx(long port)
The connection (communication port) to the message router is
closed.
|
long |
AdsPortOpenEx()
Establishes a connection (communication port) to the message
router.
|
void |
AdsSetLocalAddress(AmsNetId ams)
Change local NetId.
|
long |
AdsSyncAddDeviceNotificationReqEx(long port,
AmsAddr pAddr,
int indexGroup,
int indexOffset,
AdsNotificationAttrib pAttrib,
PAdsNotificationFuncEx pFunc,
int hUser,
int[] pNotification)
A notification is defined within an ADS server (e.g.
|
long |
AdsSyncDelDeviceNotificationReqEx(long port,
AmsAddr pAddr,
int hNotification)
A notification defined previously is deleted from an ADS server.
|
long |
AdsSyncGetTimeoutEx(long port,
int[] timeout)
Read the configured timeout for the ADS functions.
|
long |
AdsSyncReadDeviceInfoReqEx(long port,
AmsAddr pAddr,
String devName,
AdsVersion version)
Reads the identification and version number of an ADS server.
|
long |
AdsSyncReadReqEx2(long port,
AmsAddr pAddr,
int indexGroup,
int indexOffset,
int bufferLength,
byte[] buffer,
int[] bytesRead)
Reads data synchronously from an ADS server.
|
long |
AdsSyncReadStateReqEx(long port,
AmsAddr pAddr,
short[] adsState,
short[] devState)
Reads the ADS status and the device status from an ADS server.
|
long |
AdsSyncReadWriteReqEx2(long port,
AmsAddr pAddr,
int indexGroup,
int indexOffset,
int readLength,
byte[] readData,
int writeLength,
byte[] writeData,
int[] bytesRead)
Writes data synchronously into an ADS server and receives data back from the ADS server.
|
long |
AdsSyncSetTimeoutEx(long port,
int timeout)
Alters the timeout for the ADS functions.
|
long |
AdsSyncWriteControlReqEx(long port,
AmsAddr pAddr,
short adsState,
short devState,
int bufferLength,
byte[] buffer)
Changes the ADS status and the device status of an ADS server.
|
long |
AdsSyncWriteReqEx(long port,
AmsAddr pAddr,
int indexGroup,
int indexOffset,
int bufferLength,
byte[] buffer)
Writes data synchronously to an ADS server.
|
long AdsAddRoute(AmsNetId ams, String ip)
ams - (In) AMS address of the target system.ip - (In) IP address of the target system.void AdsDelRoute(AmsNetId ams)
ams - (In) address of the target systemlong AdsPortCloseEx(long port)
port - (In) port number of an Ads port that had previously been opened with AdsPortOpenEx().long AdsPortOpenEx()
long AdsGetLocalAddressEx(long port,
AmsAddr pAddr)
port - (In) port number of an Ads port that had previously been opened with AdsPortOpenEx().pAddr - (Out) Reference to the structure of type AmsAddr.void AdsSetLocalAddress(AmsNetId ams)
ams - (In) local AmsNetIdlong AdsSyncReadReqEx2(long port,
AmsAddr pAddr,
int indexGroup,
int indexOffset,
int bufferLength,
byte[] buffer,
int[] bytesRead)
port - (In) port number of an Ads port that had previously been opened with AdsPortOpenEx().pAddr - (In) Structure with NetId and port number of the ADS server.indexGroup - (In) Index Group.indexOffset - (In) Index Offset.bufferLength - (In) Length of the data in bytes.buffer - (Out) Pointer to a data buffer that will receive the data.bytesRead - (Out) Pointer to a variable. If successful, this variable will return the number of actually read data bytes.long AdsSyncReadDeviceInfoReqEx(long port,
AmsAddr pAddr,
String devName,
AdsVersion version)
port - (In) port number of an Ads port that had previously been opened with AdsPortOpenEx().pAddr - (In) Structure with NetId and port number of the ADS server.devName - (Out) Pointer to a character string of at least 16 bytes, that will receive the name of the ADS device.version - (Out) Address of a variable of type AdsVersion, which will receive the version number, revision number and the build number.long AdsSyncReadStateReqEx(long port,
AmsAddr pAddr,
short[] adsState,
short[] devState)
port - (In) port number of an Ads port that had previously been opened with AdsPortOpenEx().pAddr - (In) Structure with NetId and port number of the ADS server.adsState - (Out) Address of a variable that will receive the ADS status. Search for "ADSSTATE ADS DLL" in the infosystem.devState - (Out) Address of a variable that will receive the device status.long AdsSyncReadWriteReqEx2(long port,
AmsAddr pAddr,
int indexGroup,
int indexOffset,
int readLength,
byte[] readData,
int writeLength,
byte[] writeData,
int[] bytesRead)
port - (In) port number of an Ads port that had previously been opened with AdsPortOpenEx().pAddr - (In) Structure with NetId and port number of the ADS server.indexGroup - (In) Index Group.indexOffset - (In) Index Offset.readLength - (In) Length, in bytes, of the read buffer readData.readData - (Out) Buffer for data read from the ADS server.writeLength - (In) Length of the data, in bytes, send to the ADS server.writeData - (In) Buffer with data send to the ADS server.bytesRead - (Out) pointer to a variable. If successful, this variable will return the number of actually read data bytes.long AdsSyncWriteReqEx(long port,
AmsAddr pAddr,
int indexGroup,
int indexOffset,
int bufferLength,
byte[] buffer)
port - (In) port number of an Ads port that had previously been opened with AdsPortOpenEx().pAddr - (In) Structure with NetId and port number of the ADS server.indexGroup - (In) Index Group.indexOffset - (In) Index Offset.bufferLength - (In) Length, in bytes, of the read buffer readData.buffer - (Out) Buffer for data read from the ADS server.long AdsSyncWriteControlReqEx(long port,
AmsAddr pAddr,
short adsState,
short devState,
int bufferLength,
byte[] buffer)
port - (In) port number of an Ads port that had previously been opened with AdsPortOpenEx().pAddr - (In) Structure with NetId and port number of the ADS server.adsState - (In) New ADS status.devState - (In) New device status.bufferLength - (In) Length of the additional data, in bytes, send to the ADS server.buffer - (In) Buffer with additional data send to the ADS server.long AdsSyncAddDeviceNotificationReqEx(long port,
AmsAddr pAddr,
int indexGroup,
int indexOffset,
AdsNotificationAttrib pAttrib,
PAdsNotificationFuncEx pFunc,
int hUser,
int[] pNotification)
port - (In) port number of an Ads port that had previously been opened with AdsPortOpenEx().pAddr - (In) Structure with NetId and port number of the ADS server.indexGroup - (In) Index Group.indexOffset - (In) Index Offset.pAttrib - (In) Pointer to the structure that contains further information.pFunc - (In) Pointer to the structure describing the callback function.hUser - (In) 32-bit value that is passed to the callback function.pNotification - (Out) Address of the variable that will receive the handle of the notification.long AdsSyncDelDeviceNotificationReqEx(long port,
AmsAddr pAddr,
int hNotification)
port - (In) port number of an Ads port that had previously been opened with AdsPortOpenEx().pAddr - (In) Structure with NetId and port number of the ADS server.hNotification - (In) The handle of the notification.long AdsSyncGetTimeoutEx(long port,
int[] timeout)
port - (In) port number of an Ads port that had previously been opened with AdsPortOpenEx().timeout - (Out) Buffer to store timeout value in ms.long AdsSyncSetTimeoutEx(long port,
int timeout)
port - (In) port number of an Ads port that had previously been opened with AdsPortOpenEx().timeout - (In) Timeout in ms.Copyright © 2023 LSST. All rights reserved.