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.
Содержание NETLINX PROGRAMMING LANGUAGE
Страница 15: ...Table of Contents xiii NetLinx Programming Language Reference Guide...
Страница 16: ...xiv NetLinx Programming Language Reference Guide Table of Contents...
Страница 18: ...Introduction 2 NetLinx Programming Language Reference Guide...
Страница 76: ...Language Elements 60 NetLinx Programming Language Reference Guide...
Страница 106: ...Combining Devices Levels and Channels 90 NetLinx Programming Language Reference Guide...
Страница 112: ...Master To Master M2M 96 NetLinx Programming Language Reference Guide...
Страница 114: ...Mainline 98 NetLinx Programming Language Reference Guide FIG 1 Message and Mainline Processing in the NetLinx System...
Страница 182: ...Reserved Identifiers 166 NetLinx Programming Language Reference Guide...
Страница 204: ...NetLinx UniCode Functions 188 NetLinx Programming Language Reference Guide...
Страница 244: ...Appendix B Glossary 228 NetLinx Programming Language Reference Guide...
Страница 245: ...Appendix B Glossary 229 NetLinx Programming Language Reference Guide...