Promotic

WriteToSocketEx - method of the PmaData object

Description:
It is an extension of the WriteToSocket method.
Syntax:
Boolean WriteToSocketEx(Long nType, Long nSubType, Long nFrom, Long nCount)
Parameters:
nType(Long) Subtype of the data protocol
nSubType(Long) Version of the data protocol subtype
nFrom(Long) Index (zero-based index) of the variable in the PmaData object. From this variable (including) the data is sent
nCount(Long) The number of variables in the object that are sent
Return value:
true - The method successfully queued the request for sending data to the server. After data transfer the onEndOfTransfer event is triggered.
false - The method hasn't queued the request for sending data. Probably the previous message about sending/receiving by sockets of this object hasn't been finished yet. The onEndOfTransfer event is not triggered.
Note:
This method is not functional for PmFree.

It allows the user to specify the subtype of the data protocol by which will communicate it with the server and for example the value and number of values of the object from which the data sent to the network will be read from the object. The exact meaning of the nFrom and nCount parameters can depend on the nType and nSubType parameters.

Supported subtypes of the protocol:

nType nSubType meaning
0 0 protocol for transmission of the whole PmaData object. Parameters nFrom and nCount are ignored.
1 1 this allows to enter by the nFrom and nCount parameters from which value and how many values of the object have to be sent
See also:
Example:
JavaScriptVBScriptSelect and copy to clipboard

var oData = pMe.Pm("/Data");
oData.WriteToSocketEx(1, 1, 0, 3);
// or
var bDone = oData.WriteToSocketEx(1, 1, 0, 3);   // bDone = true or false
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r.o.