EasyManua.ls Logo

AMX NETLINX PROGRAMMING LANGUAGE - Data_Event

AMX NETLINX PROGRAMMING LANGUAGE
246 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...
Reserved Identifiers
111
NetLinx Programming Language Reference Guide
Keywords & Run-Time Library Functions (Cont.)
CREATE_MULTI_BUFFER
(Cont.)
Strings from a device longer than 255 bytes will be broken up into multiple
"multi" strings within the buffer. For instance, if 300 characters are received
from a port, the multi buffer will contain:
"$FF,<index>, 255,<first 255 characters>,$FF,45,
<last 45 characters>"
The recommended replacement for CREATE_MULTI_BUFFER and
GET_MULTI_BUFFER_STRING is to use a DeviceSet and a DATA_EVENT to
capture strings from multiple devices. An example is shown below:
DEFINE_DEVICE
Dev1 = 1:1:0
Dev2 = 1:2:0
Dev3 = 1:3:0
DEFINE_VARIABLE
DEV DeviceSet[] = {Dev1, Dev2, Dev3}
INTEGER DeviceIndex
CHAR DeviceString[1000]
DEFINE_EVENT
DATA_EVENT[DeviceSet]
{
STRING:
{
DeviceIndex = GET_LAST(DeviceSet)
DeviceString = DATA.TEXT
}
}
See GET_MULTI_BUFFER_STRING, page 131, for more information.
DATA_EVENT This keyword defines a data event handler. This type of handler processes
COMMAND, STRING, ONLINE, OFFLINE and ONERROR events. It can only be
used in the DEFINE_EVENT section of the program.
DATA_EVENT[DEVICE]
{
COMMAND:
{
// Command processing goes here
}
STRING:
{
// String processing goes here
}
ONLINE:
{
// OnLine processing goes here
}
OFFLINE:
{
// OffLine processing goes here
}
ONERROR:
{
// OnError processing goes here
}
}
See the Event Handlers section on page 61 for more information on
DATA_EVENT handlers.

Table of Contents

Related product manuals