readwrite

Writes data to an ADS device and then reads data from this device.

 readwrite(
    sNetId, 
    nPort, 
    nIndexGroup, 
    nIndexOffset, 
    cbRdLen, 
    pwrData, 
    pCallback, 
    userState, 
    ajaxTimeout, 
    ajaxTimeoutCallback, 
    async
  );

Parameters

sNetId

Type: String
NetID of the target AMS Router.

nPort

Type: Number
Port of the target AMS Router.

nIndexGroup

Type: Number
The indexGroup

nIndexOffset

Type: Number
The indexOffset

cbRdLen

Type: Number
Length of data to read.

pwrData

Type: Base64 encoded binary string
The binary data to write.

pCallback

Type: Function pointer
The callback function for asynchronous AJAX requests.
Function pointer signature: function( TcAdsWebService.Response, userState)

If successfull, the TcAdsWebService.Response.reader property contains the data in the order in which the data was requested.

userState

Type: Every
User data which will be passed through.

ajaxTimeout

Type: Number
The timeout value for AJAX requests in milliseconds.

ajaxTimeoutCallback

Type: Function pointer
The callback function for AJAX timeouts.
Function pointer signature: function()

async

Type: Bool
Determines whether asynchronous request should be used or not.

Returns

If the async parameter is set to false, this function will return a TcAdsWebService.Response object.
Otherwise it returns nothing.

If successfull, the TcAdsWebService.Response.reader property contains the data in the order in which the data was requested.