Data Sets - AMX NETLINX PROGRAMMING LANGUAGE Manual

Programming language
Table of Contents

Advertisement

DEFINE_TYPE
STRUCTURE EMP
{
INTEGER EMP_NUM
CHAR NI_NUM[9]
CHAR F_NAME[16]
CHAR L_NAME[16]
FLOAT CONT_PENSION
}
Then, within the
the structure as follows:
DEFINE_VARIABLE
EMP JOHN_DOE
EMP AMX_EMP[1000]
Within the program, we use the information stored within the structure and assign information to the
structure in the following manner:
JOHN_DOE.EMP_NUM = 101
JOHN_DOE.NI_NUM = '155426367'
JOHN_DOE.F_NAME = 'JOHN'
JOHN_DOE.L_NAME = 'DOE'
JOHN_DOE.CONT_PENSION = 0.01
EMP_INDEX = JOHNDOE.EMP_NUM
AMX_EMP[101] = JOHNDOE
0.01}*)
AMX_EMP[60].EMP_NUM = 60
AMX_EMP[60].F_NAME = 'BOB'
Other uses for arrays of structures include channel listings, speed-dial lists, and user password lists.

Data sets

NetLinx predefines several structures designed to work with NetLinx device numbers, channels, and
levels. Data sets allow you to group and combine certain elements of NetLinx devices. There are three
data set structures supported by NetLinx:
You have already seen the structure
the structure
STRUCTURE DEV
{
INTEGER DEVICE
INTEGER PORT
INTEGER SYSTEM
}
NetLinx Programming Language Reference Guide
DEFINE_VARIABLE
(* AMX_EMP[101] = {101, '155426367', 'JOHN', 'DOE',
(Device Sets)
DEV
(Device-Channel Sets)
DEVCHAN
(Device-Level Sets)
DEVLEV
DEV
in the
DEV
DEFINE_TYPE
section, you create an instance of the structure and an array of
(* EMP_INDEX = 101 *)
structure in the
DEFINE_DEVICE
section, it would look like this:
NetLinx Programming Overview
section. If we were to define
15

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Netlinx studio 2

Table of Contents