Data_Event - AMX NETLINX PROGRAMMING LANGUAGE Manual

Programming language
Table of Contents

Advertisement

Keywords & Run-Time Library Functions (Cont.)
CREATE_MULTI_BUFFER
(Cont.)

DATA_EVENT

NetLinx Programming Language Reference Guide
• 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.
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.
Reserved Identifiers
111

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Netlinx studio 2

Table of Contents