background image

Reserved Identifiers

100

NetLinx Programming Language Reference Guide

Keywords & Run-Time Library Functions

The keywords and run-time library function supported by NetLinx are described in the table below. 

Compiler Directives (Cont.)

#INCLUDE 

To include a file in a program, use the keyword 

#INCLUDE

 followed by the file-

name in single quotes.

DEFINE_PROGRAM

(* Program statements can go here *)

#INCLUDE 'TEST.AXI'

(* More program statements can go here *)

When the compiler reaches the 

#INCLUDE

 statement, it jumps into the speci-

fied file and continues compiling. When it has reached the end of that file, it 
comes back to the line following the 

#INCLUDE

 statement and continues com-

piling.

#WARN

This compiler directive displays a warning message after the program is com-
piled. Its primary purpose is to remind you of certain conditions related to the 
program.

#WARN 'This code is obsolete'

#WARN 'This code is obsolete'

Keywords & Run-Time Library Functions

__DATE__

__DATE__

 is replaced by a string (mm/dd/yy) containing the date of compila-

tion. The example below sends the date of compilation to a variable text button 
on a touch panel.

SEND_COMMAND TP, "'!T',1,__DATE__"

__FILE__

At compile time, this keyword is replaced with a string that contains the filename 
of the currently executing program file.

__LDATE__

At compile time, this keyword is replaced by a string (mm/dd/yyyy), containing 
the date of compilation. The example below sends the date of compilation to a 
variable text button on a touch panel.

SEND_COMMAND TP, "'!T',1,__LDATE__"

__LINE__

At compile time, this keyword is replaced by a constant that contains the line 
number the keyword is on.

SEND_STRING 0,"ITOA(__LINE__)"

__NAME__

At compile time, this keyword is replaced by a string that contains the 

PROGRAM_NAME

 description found on the first line of the program.

__TIME__

At compile time, this keyword is replaced by a string (hh:mm:ss) representing 
the time of compilation. The example below sends the time of compilation to a 
variable text button on a touch panel.

SEND_COMMAND TP, "'!T',1,__TIME__"

ABS_VALUE

ABS_VALUE

 provides the absolute value of a variable. It will take any intrinsic 

variable type and return the same type.

AbsVal ABS_VALUE (Value)

DEFINE_VARIABLE

SLONG Var1, Var2

DEFINE_START

Var1 = -1

DEFINE_PROGRAM

Var2 = ABS_VALUE(Var1)        // Var2 = 1

ACTIVE

See 

SELECT...ACTIVE

 on page 148.

Содержание NETLINX PROGRAMMING LANGUAGE

Страница 1: ...Language Reference Guide NetLinx Programming NetLinx Programming Language Document ID 033 004 2255 Last Revised 10 05 2006...

Страница 2: ...he AMX SOFTWARE including without limitation any if any service packs or hot fixes provided to Licensee after the expiration of the ninety 90 day Limited Warranty period are not covered by any warrant...

Страница 3: ...DEFINE_START 7 DEFINE_EVENT 7 DEFINE_PROGRAM 8 Operators 8 Axcess NetLinx Incompatibility 9 Data Types 10 Constants 10 Variables 11 Persistent Variables 12 Arrays 12 Structures 14 Data sets 15 Condit...

Страница 4: ...CH CASE 33 Loops 34 WHILE statements 34 MEDIUM_WHILE statements 34 LONG_WHILE statements 35 FOR loop structure 35 Waits 36 Naming Waits 36 Types of Waits 36 Nesting Waits 37 Pausing and restarting Wai...

Страница 5: ...arrays 53 Structures 55 Subroutines 56 DEFINE_CALL subroutines 56 SYSTEM_CALL subroutines 56 Function Subroutines 57 Calling parameters 59 Event Handlers 61 Button events 62 Channel events 63 Data ev...

Страница 6: ...Master Issues 95 Mainline 97 Reserved Identifiers 99 Compiler Directives 99 DEFINE 99 END_IF 99 ELSE 99 IF_DEFINED 99 IF_NOT_DEFINED 99 Keywords Run Time Library Functions 100 __DATE__ 100 __FILE__ 1...

Страница 7: ...MGR_SET_DAYLIGHTSAVINGS_MODE 106 CLKMGR_SET_DAYLIGHTSAVINGS_OFFSET 106 CLKMGR_SET_END_DAYLIGHTSAVINGS_RULE 106 CLKMGR_SET_RESYNC_PERIOD 107 CLKMGR_SET_START_DAYLIGHTSAVINGS_RULE 107 CLKMGR_SET_TIMEZON...

Страница 8: ...ILE_CREATEDIR 121 FILE_DELETE 121 FILE_DIR 121 FILE_GETDIR 122 FILE_OPEN 122 FILE_READ 123 FILE_READ_LINE 123 FILE_REMOVEDIR 124 FILE_RENAME 124 FILE_SEEK 124 FILE_SETDIR 125 FILE_WRITE 125 FILE_WRITE...

Страница 9: ...139 LOCAL_VAR 139 LONG 139 LONG_WHILE 140 LOWER_STRING 140 LSHIFT 140 MASTER_SN 140 MASTER_SLOT 140 MAX_VALUE 140 MAX_LENGTH_ARRAY 140 MAX_LENGTH_STRING 141 MEDIUM_WHILE 141 MID_STRING 141 MIN_VALUE...

Страница 10: ...0 SET_PULSE_TIME 150 SET_SYSTEM_NUMBER 151 SET_TIMER 151 SET_VIRTUAL_CHANNEL_COUNT 151 SET_VIRTUAL_LEVEL_COUNT 151 SET_VIRTUAL_PORT_COUNT 151 SINTEGER 151 SLONG 151 STACK_VAR 152 STRING 152 STRING_TO_...

Страница 11: ...ssibly too many nested levels 167 w Variable is not used 168 Compiler Errors 168 A symbol was expected 168 ACTIVE keyword expected 168 Allowed only in DEFINE_START 168 Attempted CALL to undefined subr...

Страница 12: ...may not call itself 170 Syntax error 170 SYSTEM_CALL name not same as PROGRAM_NAME in file 170 This variable type not allowed 170 TO statements that occur outside the data flow of PUSH events statemen...

Страница 13: ...WC_SET_LENGTH_STRING 181 WC_TO_CH 181 WC_TP_ENCODE 181 WC_UPPER_STRING 181 Working With UniCode in NetLinx Studio v2 4 182 Configuring NetLinx Studio 182 Including the Unicode Library 183 Defining a U...

Страница 14: ...ple IP Code 194 NetLinx Modules 197 Defining a module 197 Using a module in a program 204 Internet Inside 207 Java TPClasses 207 WDM Configuration 208 Encoding and Decoding Binary and XML 209 Appendix...

Страница 15: ...Table of Contents xiii NetLinx Programming Language Reference Guide...

Страница 16: ...xiv NetLinx Programming Language Reference Guide Table of Contents...

Страница 17: ...r Keywords are case insensitive For example the PUSH command is the same as push Keywords are reserved meaning that identifiers device names constants or variables must have unique names These keyword...

Страница 18: ...Introduction 2 NetLinx Programming Language Reference Guide...

Страница 19: ...event threads beyond the Mainline in Axcess NetLinx offers more options in distributed processing NetLinx expands and strengthens Master to Master communications and expands the traditional AXlink bu...

Страница 20: ...range from 8000 to 8FFF Port is a 16 bit integer representing the port number in a range of 1 through the number of ports on the device System is a 16 bit integer representing the system number 0 ind...

Страница 21: ...rrays may have a maximum value of 65 535 Variables are Non Volatile the variable loses its value when the program is loaded but retains its value if the controller is reset DEFINE_VARIABLE VALUE ARRAY...

Страница 22: ...NE_CALL SWITCH CARD IN OUT SEND_STRING CARD ITOA IN ITOA OUT DEFINE_CALL MULTIPLY X Y RESULT RESULT X Y DEFINE_PROGRAM PUSH TP 11 CALL SWITCH SWITCHER 4 1 PUSH TP 12 CALL MULTIPLY 3 4 VALUE SYSTEM_CAL...

Страница 23: ...he pro gram however the role of the DEFINE_START section is greatly reduced Variable initializations are handled in the DEFINE_VARIABLE section Device initializations are handled with a DATA_EVENT in...

Страница 24: ...ts the value of its variable by one An example of value increment and decrement operators is shown below X 1 Y 5 X X is now equal to 2 Y Y is now equal to 4 X Y This is not a legal statement Axcess La...

Страница 25: ...A B A B B A B A 0 0 0 0 1 1 0 0 0 0 0 1 1 1 0 1 1 0 0 0 The problem applies whether A and B are channels variables or expressions and for OR as well as AND To solve the problem AMX always recommends...

Страница 26: ...255 8 bit a 145 FE The quick gray fox WIDECHAR Wide character strings dealing with Unicode fonts that use 16 bit character codes and most Far eastern fonts 0 to 65 535 16 bit OFF 500 INTEGER Default v...

Страница 27: ...aded and it retains any changed values after system resets Variables can now be defined as constant variables Since the DEFINE_CONSTANT section does not allow you to explicitly declare a constant s da...

Страница 28: ...inx program is downloaded to the Master the Master iterates through all non volatile variables from the new program looking for persistent ones When it finds a persistent variable in the new program i...

Страница 29: ...ensional arrays beyond three dimensions We sometimes try to define the arrays spatially as in a three dimensional array If we take the approach of cascading arrays it is easier to understand Using the...

Страница 30: ...e is an array of structures The database table is an array of records Each record is a structure Each record contains data of different types Let s first consider the elements of a database table We t...

Страница 31: ...0 01 EMP_INDEX JOHNDOE EMP_NUM EMP_INDEX 101 AMX_EMP 101 JOHNDOE AMX_EMP 101 101 155426367 JOHN DOE 0 01 AMX_EMP 60 EMP_NUM 60 AMX_EMP 60 F_NAME BOB Other uses for arrays of structures include channel...

Страница 32: ...You can do more with DEV DEVCHAN and DEVLEV than you could with structures you create within the code DEV PANEL_GROUP1 128 1 0 129 1 0 130 1 0 DEV MSP_GROUP 5 MSP1 MSP2 MSP3 DEVCHAN PRESET1_BUTTONS 5...

Страница 33: ...inx due to eliminating the timeout of WHILE loops LONG_WHILE loops now differ from WHILE loops in the way input change notifications are processed during the programming loop WHILE MEDIUM_WHILE and LO...

Страница 34: ...within the case The BREAK statement applies to the SWITCH and takes execution to the end of the SWITCH Unlike C and C cases do not fall through to the next case if a break is not used Because of this...

Страница 35: ...obal variable in the mainline code NetLinx has two methods for creating subroutines DEFINE_CALL and DEFINE_FUNCTION DEFINE_CALL DEFINE_CALL is intended to run segments of code that are repeated throug...

Страница 36: ...the following example DEFINE_CALL READ INPUT CHAR BUFFER body of the subroutine The parameter BUFFER is declared to be a two dimensional array by including two sets of brackets after the name For comp...

Страница 37: ...echanism for processing events since mainline is not required to process a single I O request If no events are pending mainline is run Mainline becomes an idle time process With the addition of the DE...

Страница 38: ...e Like Button Events the device channel declaration can contain a DEV device set or a DEVCHAN device channel set in addition to individual device and channel declarations In the following example a Ch...

Страница 39: ...LSE VPROJ VP_POWER_OFF PUSH TP1 22 SYSTEM OFF BUTTON PULSE RELAY RACK_OFF PULSE RELAY LIFT_UP PULSE VPROJ VP_POWER_OFF NetLinx Channel Event DEFINE_EVENT BUTTON_EVENT TP1 21 LIFT UP BUTTON PUSH PULSE...

Страница 40: ...pass through mainline whether there is data in the buffer or not This adds to the length of mainline and slows mainline Second data is only received into the buffer between passes through mainline In...

Страница 41: ...is that DEFINE_START initializations are only run when the master is reset and evaluations of the DEVICE_ID must run with each pass of mainline and are dependent on the speed of mainline NetLinx handl...

Страница 42: ...TP1_BUFFER DEFINE_EVENT DATA_EVENT TP1 EVALUATE TP1 DATA STRING SELECT ACTIVE FIND_STRING DATA TEXT PAGE 1 JUNK REMOVE_STRING DATA TEXT PAGE 1 CUR_PAGE DATA TEXT ACTIVE FIND_STRING DATA TEXT KEYP 1 ke...

Страница 43: ...ion and a conditional statement would appear in mainline to evaluate and update the level The format for the LEVEL_EVENT is LEVEL_EVENT device level level event handler Existing Axcess code DEFINE_STA...

Страница 44: ...combining devices NetLinx still recognizes the DEFINE_COMBINE section This section still operates as it did in Axcess however once the DEFINE_COMBINE section has been compiled it remains static NetLin...

Страница 45: ...both within the Include file and within the primary Axcess program Include files are limited because they are static Mainline statements within the Include file cannot be adapted from program to prog...

Страница 46: ...s and expressions cannot be used as arguments Within the NetLinx program the Module is referenced using the following format DEFINE_MODULE module name instance name pass1 pass2 passN The module name m...

Страница 47: ...Variables Output Channels Variables The simplest type of assignment statement is a variable which assigns the value of an expression to a variable The expression may be a constant a variable mathemat...

Страница 48: ...s for all other conditions Regarding IF statements ELSE IF is optional Braces are generally recommended in all cases but are only required if multiple statements are assigned to a given condition IF s...

Страница 49: ...the DEFAULT case statements if any are executed The SWITCH expression is evaluated only once An example is SWITCH x CASE 1 do stuff when x 1 CASE 2 do stuff when x 2 default do stuff when x is not 1...

Страница 50: ...s WHILE conditional expression conditional statements Regarding WHILE statements Statements are executed repeatedly while the conditional expression evaluates to true The condition is tested before ea...

Страница 51: ...ows you to define initialization statements statements to execute after each pass through the loop and a condition to test after each pass If the condition evaluates to true another pass is made Other...

Страница 52: ...tion on page 38 Types of Waits Types of Wait statements include Timed Waits have an associated parameter that indicates the amount of time that must elapse before the associated wait instruction s are...

Страница 53: ...ssion The Wait statements are executed if and when the wait condition becomes True name The name to assign to the Wait This name must be a literal string The Wait name is optional although unless a Wa...

Страница 54: ...specified Pausing and Restarting Waits PAUSE_WAIT PAUSE_WAIT puts a scheduled wait on hold The wait being paused is identi fied by the parameter name The wait timer stops counting down until it is res...

Страница 55: ...gle line comments can be specified using the double forward slash notation When a pair of forward slash characters is encountered all text on the same line following the slash pair except the end comm...

Страница 56: ...assign Expressions to intrinsic type variables see theData Types section on page 50 Arrays to other arrays of matching size and type Structures to other structures of the same type The and operators...

Страница 57: ...mbers in the range 0 32767 Device 0 refers to the Master numbers above 32767 are reserved for internal use NetLinx requires a Device Port System D P S specification where Axcess expected only a device...

Страница 58: ...eclares a device array whose maximum length is determined by the number of elements in the initialization array on the right hand side The second form uses MaxLen to specify the maximum length of the...

Страница 59: ...viceSetB 1 2 Correct Device channels and device channel arrays As the name implies a device channel DEVCHAN is a combination of a device and a channel It is represented internally as a DEVCHAN structu...

Страница 60: ...n be used anywhere a Device Channel specification is required with the result of providing a range of targets for the command or instruction where it is used This implies an alternate form for the fol...

Страница 61: ...e and level in an array is referenced to in a particular notification message Variables NetLinx provides support for several different types of variables distinguished by attributes such as Scope Cons...

Страница 62: ...ment block in which it is declared is executed If neither the LOCAL_VAR nor the STACK_VAR keyword is specified STACK_VAR is assumed default IF X 10 LOCAL_VAR INTEGER INT2 static permanent STACK_VAR CH...

Страница 63: ...on static local variables are allocated on the program stack a block of memory reserved for allocation of temporary variables the keywords VOLATILE PERSISTENT and CONSTANT do not apply Global variable...

Страница 64: ...ther power down or reload If the data type is omitted from the variable definition the following defaults are assumed Single variables are INTEGER type Arrays are CHAR type You can define a variable t...

Страница 65: ...he previously downloaded NetLinx program If you changed any of the three the new persistent variable will not be set with the old variable s value Constants Constants are defined in the DEFINE_CONSTAN...

Страница 66: ...s in the expression are converted to 64 bit floating point before resolving If the expression contains only whole number value variables and constants all variables and constants in the expression are...

Страница 67: ...n is a string enclosed in double quotes containing a series of constants and or variables evaluated at run time to form a string result String expressions can contain up to 16000 characters consisting...

Страница 68: ...x language allows arrays of any data type supported by the language as well as arrays of user defined structures and classes If an initialization statement is included in the variable declaration the...

Страница 69: ..._LENGTH_ARRAY LENGTH_ARRAY returns the effective length of a dimension of an array the length set implicitly through array initialization or array manipulation operations and or explicitly through a c...

Страница 70: ...m3D 2 Num2D Num3D 2 1 Num1D Num3D 2 1 1 Num1D 1 LENGTH_ARRAY and MAX_LENGTH_ARRAY are used to determine the effective and maximum lengths of multidimensional arrays as shown in the following examples...

Страница 71: ...t notation as in the two examples below Notice that the members of each structure as well as the entire array are enclosed in braces MyNewStruct Number 0 MyNewStruct Text Copyright by Company X MyNewS...

Страница 72: ...broutine name as shown below DEFINE_CALL Read Input CHAR Buffer To invoke a user defined subroutine use the CALL keyword plus the name of subroutine and any required calling parameters CALL Read Input...

Страница 73: ...its name it requires a name that follows the rules for naming constants and variables This eliminates the need for using the CALL keyword to invoke the subroutine DEFINE_FUNCTION subroutines also diff...

Страница 74: ...f a return statement is encountered anywhere in the function execution of the function is terminated immediately and the value if any specified as the return value is returned to the caller A function...

Страница 75: ...ted If the type is omitted the default type is assumed arrays are CHAR type and non array parameters are INTEGER To specify an array as a function or subroutine parameter one set of brackets for each...

Страница 76: ...Language Elements 60 NetLinx Programming Language Reference Guide...

Страница 77: ...equence of times All incoming events are stored in a queue pending processing Messages are processed in the order they are received The steps to processing an event are 1 Check all events for a handle...

Страница 78: ...cated by the TIME parameter TIME is specified in 10 second increments The REPEAT keyword specifies that the event notification should be repeated in TIME increments as long as the button is held The B...

Страница 79: ...e information contained in Channel events Button Objects Property Name Type Description Button Input DEVCHAN Device Channel Button Input Channel INTEGER Channel Button Input Device DEV Device Button I...

Страница 80: ...OMMAND event handler STRING STRING event handler ONLINE ONLINE event handler OFFLINE OFFLINE event handler ONERROR ONERROR event handler Channel Objects Property Name Type Description Channel Device D...

Страница 81: ...event handler as a local variable Level events are triggered by a level change on a particular device This eliminates having to constantly evaluate a level against a previous value In Axcess a level...

Страница 82: ...LEVEL COOL_POINT ON RELAY FAN ELSE IF TEMP_LEVEL HEAT_POINT OFF RELAY FAN Level Objects Property Name Type Description Level Input DEVLEV Device Level that caused the event to occur Level Input Device...

Страница 83: ...mation on EVENTID values and the values of the custom event for each EVENTID see the programming section of the device manual with which you are working The following table lists the information conta...

Страница 84: ...l event parameters must contain the correct information prior to DEFINE_START This requires that all EVENT parameters must be defined at compile time In addition many parameter shortcuts to help fulfi...

Страница 85: ...ne an event handler for all buttons channel or levels of a device without having to define a DEVCHAN of DEVLEV containing every value you may want to handle To make the example 2 behave like the examp...

Страница 86: ...to toggle a variable in the event since the event runs twice for every button push the variable toggles on then toggles off again There are some additional parameter shortcuts available In all cases...

Страница 87: ...oded the timed sequence so the only way to modify the timing was to modify the NetLinx program recompile and download Timelines make adding deleting and editing the sequence much simpler for the progr...

Страница 88: ...TITION data members can be used to calculate the total amount of time it has been running RELATIVE If the timeline is operating in relative mode this data member is equal to TIMELINE_RELATIVE If the t...

Страница 89: ...anel TEXT2 2 1 case 2 SEND_COMMAND dvPanel TEXT2 2 2 case 3 SEND_COMMAND dvPanel TEXT2 2 3 case 4 SEND_COMMAND dvPanel TEXT2 2 4 case 5 SEND_COMMAND dvPanel TEXT2 2 5 DEFINE_PROGRAM PUSH dvPanel 1 Tim...

Страница 90: ...e each events occurs 1000 milliseconds after the previous Since TL2 specifies the TIMELINE_ONCE parameter it will execute the entire timeline once then stop 1 2 3 4 5 TIMELINE example The following co...

Страница 91: ...SEND_STRING dvDebug Timer ITOA Timeline ID Event ITOA Timeline Sequence Time ITOA Timeline Time Repetition ITOA Timeline Repetition Relative ITOA Timeline Relative TIMELINE_EVENT MY_LINE_2 switch Time...

Страница 92: ...TimeArray 1 1000 TimeArray 2 2000 TimeArray 3 3000 TimeArray 4 4000 TimeArray 5 5000 TIMELINE_CREATE MY_LINE_2 TimeArray 5 TIMELINE_ABSOLUTE TIMELINE_REPEAT Modify the timeline my kill pause and resta...

Страница 93: ...SEND_COMMAND dvPanel TEXT3 Timer 1 Time is ITOA TIMELINE_GET MY_LINE_1 SEND_COMMAND dvPanel TEXT4 Timer 2 Time is ITOA TIMELINE_GET MY_LINE_2 Pause and restart the timeline at new locations PUSH dvPa...

Страница 94: ...NE_CREATE TimelineID_1 TimeArray LENGTH_ARRAY TimeArray TIMELINE_RELATIVE TIMELINE_REP EAT TIMELINE_CREATE TimelineID_2 TimeArray LENGTH_ARRAY TimeArray TIMELINE_RELATIVE TIMELINE_REP EAT TIMELINE_CRE...

Страница 95: ...s a device that does not physically exist but merely represents one or more devices Combining and Un Combining Devices To approach setting up combine and un combine operations in NetLinx let s first l...

Страница 96: ...example above combines the three touch panel devices TP1 TP2 and TP3 Whenever an input change occurs on any of the three devices NetLinx detects the input as coming only from VIRTUAL1 For example if...

Страница 97: ...g and un combining the panels from the previous example DEFINE_DEVICE VIRTUAL1 33000 TP1 128 TP2 129 TP3 130 TP4 131 DEFINE_PROGRAM Activate dynamic device combine RELEASE TP4 1 COMBINE_DEVICES VIRTUA...

Страница 98: ...omatically be sent to all devices in the list Now let s see how the code example shown above would translate into NetLinx This is code that would function correctly within a NetLinx system but still u...

Страница 99: ...EVLEV DLSETS Parameters Un combining levels UNCOMBINE_LEVELS undoes the effect of COMBINE_LEVELS All combines related to the specified virtual device level are disabled UNCOMBINE_LEVELS DEVLEV Paramet...

Страница 100: ...to the virtual device channel is directed to all elements in the DEVCHAN set COMBINE_CHANNELS DEVCHAN VDC DEVCHAN DCSets Parameters Un combining channels UNCOMBINE_CHANNELS reverses the effect of COM...

Страница 101: ...V CHAN pair DEFINE_VARIABLE DEVCHAN dc1 dvIO10 1 dvREL10 1 dvTP 1 DEFINE_EVENT BUTTON_EVENT dvTP 11 combine_channels 1 RELEASE COMBINE_CHANNELS vdvControl 1 dc1 BUTTON_EVENT dvTP 12 uncombine_channels...

Страница 102: ...xample of combining individual DEV CHAN pairs to a virtual DEV CHAN pair DEFINE_VARIABLE DEVCHAN dc3 dvIO10 3 dvREL10 3 dvTP 3 DEFINE_EVENT BUTTON_EVENT dvTP 15 combine_channels 3 RELEASE COMBINE_CHAN...

Страница 103: ...NT BUTTON_EVENT dvTP 17 combine_channels 4 RELEASE COMBINE_CHANNELS vdc4 dc4 BUTTON_EVENT dvTP 18 uncombine_channels 4 RELEASE UNCOMBINE_CHANNELS vdc4 BUTTON_EVENT vdc4 this will work when the combine...

Страница 104: ...combine_channels above is invoked PUSH TO BUTTON INPUT example of combining individual DEV CHAN pairs to a virtual DEVCHAN DEFINE_VARIABLE DEVCHAN vdc6 vdvControl 6 DEVCHAN dc6 dvIO10 6 dvREL10 6 dvTP...

Страница 105: ...Combining Devices Levels and Channels 89 NetLinx Programming Language Reference Guide BUTTON_EVENT vdc6 this will work when the combine_channels above is invoked PUSH TO BUTTON INPUT end...

Страница 106: ...Combining Devices Levels and Channels 90 NetLinx Programming Language Reference Guide...

Страница 107: ...on of all M2M functionality Intersystem control allows a Master or its NetLinx program to control and get status of any other device or master connected to another Master The illustration below depict...

Страница 108: ...ster s host name may be used in the URL list As of this writing only Windows 2000 s DNS server DHCP servers support the required dynamic capabilities Once the systems are connected they exchange routi...

Страница 109: ...FIG 3 into two dimensions and takes advantage of the fact that each NetLinx master supports multiple connections to masters The to the left of system 5 indicates that system 5 is the local system i e...

Страница 110: ...ns supported by a single master is 200 simultaneous TCP IP connections Another possible connection topology is to establish communication hubs that optimize the traffic with adjacent masters but still...

Страница 111: ...messages is not limited to mainline functions like PUSH and RELEASE rather all EVENT based code will operate normally regardless of the source of the original control message function Design consider...

Страница 112: ...Master To Master M2M 96 NetLinx Programming Language Reference Guide...

Страница 113: ...w be handled through code in the DEFINE_EVENT section This provides a more efficient mechanism for processing events mainline does not have to be traversed to process a single I O request A handler ca...

Страница 114: ...Mainline 98 NetLinx Programming Language Reference Guide FIG 1 Message and Mainline Processing in the NetLinx System...

Страница 115: ...will send out ABCDEF END_IF This directive marks the end of an IF_DEFINED or IF_NOT_DEFINED code block ELSE This directive specifies a counter condition used optionally in conjunction with IF_DEFINED...

Страница 116: ...of compilation to a variable text button on a touch panel SEND_COMMAND TP T 1 __DATE__ __FILE__ At compile time this keyword is replaced with a string that contains the filename of the currently execu...

Страница 117: ...ber of the URL_STRUCT structure See GET_URL_LIST for a description of the URL_STRUCT structure AND This logical operator evaluates two logical conditions Both conditions must be true for the entire ex...

Страница 118: ...containing the character representation of the floating point number The result is a 64 bit floating point number representing the converted string Any non numeric characters in the string are ignore...

Страница 119: ...tatements go here HOLD TIME REPEAT Hold statements go here See the Event Handlers section on page 61 BXOR This operator performs a bitwise XOR operation between two data items which can be constants o...

Страница 120: ...See the Event Handlers section on page 61 for more information on CHANNEL_EVENTs CHAR This keyword defines an intrinsic data type representing an 8 bit unsigned inte ger This data type is used with AN...

Страница 121: ...n error CLKMGR_GET_END_ DAYLIGHTSAVINGS_RULE Gets a string representation of when Daylight Savings is supposed to END The Fixed Date rules have the form fixed DAY MONTH HH MM SS with all fields as num...

Страница 122: ...SET_CLK_SOURCE CONSTANT INTEGER MODE Can be set to CLKMGR_MODE_NETWORK or CLKMGR_MODE_STANDALONE CLKMGR_SET_DAYLIGHT SAVINGS_MODE CLKMGR_SET_DAYLIGHTSAVINGS_MODE CONSTANT INTEGER ONOFF Can be set to O...

Страница 123: ...ept for the word occurence DAY OF WEEK translates as 1 Sunday 2 Monday 3 Tuesday 4 Wednsday 5 Thursday 6 Friday 7 Saturday e g occurence 3 1 10 02 00 00 3rd Sunday in October 02 00 00AM CLKMGR_SET_TIM...

Страница 124: ...to all devices in the list For instance ON VIRTUAL1 50 will turn on channel 50 on all three panels and OFF VIRTUAL1 10 will turn off channel 10 on all three panels The example below is equivalent to...

Страница 125: ...bug ALEXERICRYAN ALEX RYAN Another example of a use for this feature is if you want an event to occur every hour You would enter a time string that would contain a 00 00 hours minute sec for the recur...

Страница 126: ...rst header byte FF marks the start of a new command string The second header byte is either the number of the device or the index of the DEV member that received the command string The third header by...

Страница 127: ...ow 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...

Страница 128: ...an sinteger representing the month portion of a date string SINTEGER DATE_TO_MONTH CHAR LDATE Parameters LDATE Input string containing the date in mm dd yyyy format If successful this function returns...

Страница 129: ...e program as coming from the virtual device Output changes directed to the virtual device or any device in the set is sent to all devices in the array DEFINE_COMBINE VDevice DEV See COMBINE_DEVICES on...

Страница 130: ...re or an array of structures The function name must not be a previously defined constant or variable or a name assigned to a buffer a wait DEFINE_CALL or Function Function names are not case sensitive...

Страница 131: ...y exclu sive latching set cannot be turned off without activating another channel in the same set In NetLinx you can bypass this rule by using TOTAL_OFF The TOTAL_OFF function turns a channel or varia...

Страница 132: ...on is already actively deleting a URL entry i e busy 4 Delete failed See GET_URL_LIST for a description of the URL_STRUCT structure DEV This keyword defines a data type structure used to represent a s...

Страница 133: ...ch as an infrared serial card or touch panel This is the same information returned by the DEVICE_ID keyword Info VERSION A string identifying the firmware version of the device This is not available f...

Страница 134: ...SEND_STRING 0 VERSION sDeviceInfo VERSION SEND_STRING 0 FIRMWARE_ID ITOA sDeviceInfo FIRMWARE_ID SEND_STRING 0 SERIAL_NUMBER sDeviceInfo SERIAL_NUMBER SEND_STRING 0 SOURCE_TYPE ITOA sDeviceInfo SOURCE...

Страница 135: ...FINITE is specified as the timeout then the push never times out DO_PUSH_TIMED dvTouchPanel 5 10 push button 5 for 1 0S DO_RELEASE This keyword causes an input change from ON to OFF to occur on a spec...

Страница 136: ...Result File_Close hFile FILE_COPY This function copies the specified file SLONG File_Copy CHAR SrcFilePath CHAR DstFilePath Parameters SrcFilePath Path name of the file to copy source DstFilePath Path...

Страница 137: ...MP subdirectories FILE_DELETE This function deletes the specified files SLONG FILE_DELETE CHAR FilePath Parameters FilePath Path name of the file to delete Result 0 Operation was successful 2 Invalid...

Страница 138: ...ts its contents are erased The constant FILE_RW_NEW is defined as a value of 2 for specifying this flag 3 R W Append The file is opened with READ WRITE status The current contents of the file are pres...

Страница 139: ...Buffer 1024 nBytes FILE_READ hFile Buffer 1024 FILE_READ_LINE This function reads a line of data from the specified file SLONG FILE_READ_LINE LONG hFile CHAR Buffer LONG BufLen Parameters hFile Handle...

Страница 140: ...ILE_RENAME CHAR FilePath CHAR NewFileName Parameters FilePath Path name of the file to rename NewFileName New file name This name must not contain a directory path Result 0 Operation was successful 2...

Страница 141: ...of bytes actually written 1 Invalid file handle 5 Disk I O error 6 Invalid parameter buffer length must be greater than zero 11 Disk full The data will overwrite or append to the current contents of t...

Страница 142: ...und at the beginning of the string this function returns 1 any error condition returns 0 POS FIND_STRING STRING ABC 1 FIRST_LOCAL_PORT This keyword contains the lowest number that may be assigned as a...

Страница 143: ...ays begins with or Blank Positive values begin with a blank width Minimum number of characters to print If the output would be less than this width it is padded with spaces to be width characters wide...

Страница 144: ...se expo nents if necessary STRING FTOA 123 4 STRING 123 4 GET_BUFFER_CHAR This keyword removes characters from a buffer Result GET_BUFFER_CHAR Array Array may be either a character array or wide chara...

Страница 145: ...DNS server CHAR DNS2 15 IP address of 2nd DNS server CHAR DNS3 15 IP address of 3rd DNS server GET_IP_ADDRESS This function returns the TCP IP configuration of the specified device The con figuration...

Страница 146: ...nt that most recently caused an event handler to be triggered DEFINE_VARIABLE DEVCHAN dcMyDCSet TP 5 TP 4 TP 3 TP 2 TP 1 INTEGER Index BUTTON_EVENT dcMyDCSet PUSH Index GET_LAST dcMyDCSet Switch Index...

Страница 147: ...RIAL_NUMBER DEV Device CHAR SerialNumber Parameters Device Device from which the serial number will be retrieved SerialNumber String that will receive the device s serial number Result 0 Operation was...

Страница 148: ...function returns the number of URLs updated in the supplied array of URL_STRUCTs 1 Specified device is invalid or is not online 2 Request timed out 3 Busy URLs may be programmed by either the Integrat...

Страница 149: ...cat ing the status of the connection 0x00 Looking up IP address or URL 0x40 Connecting to URL 0x80 Waiting for connection to establish 0xC0 Connected Keywords Run Time Library Functions Cont GET_URL_L...

Страница 150: ...nt in the program INCLUDE filename The parameter filename can be any valid long filename If the file extension is omitted AXI is assumed An INCLUDE statement can appear anywhere in a program Note Ther...

Страница 151: ...domain name of the server to connect to ServerPort The port number on the server that identifies the program or service the client is requesting Protocol The transport protocol to use 1 TCP 2 UDP 3 U...

Страница 152: ...Result This function always returns 0 Errors are returned via the DATA_EVENT ONERROR method The following error may be returned 2 General failure out of memory 10 Binding error 11 Listening error 14 L...

Страница 153: ...UDP socket already listening 16 too many open sockets Example IP_SERVER_OPEN PORT1 SvPort IP_TCP SeeIP Communication section on page 189 for more information ITOA This function converts a 32 bit sign...

Страница 154: ...ion returns the effective length of a dimension of an array implicitly through array initialization or array manipulation operations and or explic itly through a call to the function SET_LENGTH_ARRAY...

Страница 155: ...type to be encoded B is the encoding flag These can be used together Value 01 is Encode with Types If the bit is set types will be included for every variable being encoded The default is to not incl...

Страница 156: ...th statements shift INT1 left two positions Either statement could be replaced with the following INT2 INT1 4 MASTER_SN This keyword contains the serial number of the master processor MASTER_SLOT This...

Страница 157: ...ting at the speci fied location in the source string CHAR MID_STRING CHAR STRING LONG Start LONG Count WIDECHAR MID_STRING WIDECHAR STRING LONG Start LONG Count Parameters STRING The input character s...

Страница 158: ...OFF Variable OFFLINE This keyword defines a section in a DATA event handler for processing OFFLINE notifications This is one of the important aspects of the DATA_EVENT that is triggered when the mast...

Страница 159: ...NEL This keyword contains the channel number that was just turned on due to an input change The value remains valid for one pass through mainline The inac tive state of this variable is all fields equ...

Страница 160: ...nt declarations affect NetLinx event handling when REBUILD_EVENT is called after the variables are modified REBUILD_EVENT works on a module by module basis i e calling the func tion in one module does...

Страница 161: ...ent table curModApoc dvApoc1 RELEASE OFF panel 2 BUTTON_EVENT curModApoc 5 PUSH ON dvApoc3 5 RELEASE OFF dvApoc3 5 end REBUILD_EVENT rebuilds the event table for variables modified in the same block o...

Страница 162: ...in a BUTTON_EVENT handler for process ing RELEASE events RELEASE_CHANNEL This keyword contains the number of the channel that was just turned off due to an input change The value remains valid for one...

Страница 163: ...RESTART_WAIT This keyword resumes the specified named wait previously paused by a PAUSE_WAIT command RESTART_WAIT wait name RETURN This keyword is used in a DEFINE_FUNCTION or DEFINE_CALL subroutine...

Страница 164: ...evice The syn tax is SEND_COMMAND DEV command string or SEND_COMMAND DEV command string SEND_LEVEL This keyword sends a value to a specific level on a NetLinx device port The syntax follows any one of...

Страница 165: ...st DNS2 DnsList DNS3 Result SET_DNS_LIST 0 0 0 DnsList set master s list See GET_DNS_LIST on page 129 for a description of the DNS_STRUCT struc ture SET_IP_ADDRESS This function programs the TCP IP co...

Страница 166: ...e any intrinsic or user defined data type Array Array of any type Len Value to assign as the length SET_LENGTH_ARRAY NumArray 5 SET_LENGTH_STRING This function sets the length of a CHAR or WIDECHAR st...

Страница 167: ...rtual device port maintains the state of channels 1 255 inclusive SET_VIRTUAL_CHANNEL_COUNT DEV Device INTEGER Count Parameters Device The virtual device port to modify Count The number of channels th...

Страница 168: ...string When the ENCODE variable is a structure the decode vari able members must match in type and order If the number of members of the structures doesn t match then the routine will fill all it can...

Страница 169: ...ntains the system number TIME This keyword holds the current time as a string in the form hh mm ss The time is represented in 24 hour format IF TIME 23 59 59 TIME_TO_HOUR This function returns an inte...

Страница 170: ...umber one Returns 0 Not created Non zero The timeline has been created IF TIMELINE_ACTIVE TL1 if timeline 1 is running do something TIMELINE_CREATE Creates an initial timeline and specifies the attrib...

Страница 171: ...one Result This function returns the specified timeline s internal timer The timer value represents the number of milliseconds that have passed since the timeline started TIMELINE_SET TL1 TIMELINE_GET...

Страница 172: ...unt of times in the Times array Result 0 Successful 1 Timeline ID already in use 2 Specified array is not an array of LONGs 3 Specified length is greater than the length of the passed array 4 Out of m...

Страница 173: ...While NetLinx does not support a BOOLEAN data type an non zero value is consider true for conditional expressions TYPE_CAST This routine eliminates compiler type cast warnings by casting the passed in...

Страница 174: ...he converted character string UCString UPPER_STRING STRING VARIABLE_TO_STRING VARIABLE ENCODE This routine takes the variable ENCODE and creates entries in the buffer to rep resent that variable The v...

Страница 175: ...is Array Encoding is Little Ending The constant XML_ENCODE_LE can be used to specify this flag The return value is 3 XML decode data type mismatch 2 XML decode data too small more members in structure...

Страница 176: ...urn Save Structure to Disk Binary slFile FILE_OPEN BinaryEncode xml 2 slReturn FILE_WRITE slFile sBinaryString LENGTH_STRING sBinaryString slReturn FILE_CLOSE slFile Save Structure To Disk XML slFile...

Страница 177: ...s for a specified period of time The syntax is WAIT time name wait statements For more information refer to the Waits section on page 36 WAIT_UNTIL This keyword is used to delay execution of one or mo...

Страница 178: ...an be used to specify this flag The return value is 3 XML decode data type mismatch 2 XML decode data too small more members in structure 1 Structure too small more members in XML decode string 0 Deco...

Страница 179: ...GTH_STRING sBinaryString slReturn FILE_CLOSE slFile Save Structure To Disk XML slFile FILE_OPEN xmlEncode xml 2 slReturn FILE_WRITE slFile sXMLString LENGTH_STRING sXMLString slReturn FILE_CLOSE slFil...

Страница 180: ...command and processes it internally Both commands accept a single parameter that specifies the level number Using the dueling levels example above the following send commands will turn on the synchron...

Страница 181: ...one element of var will have a value of 1 at any time This issue does not occur with DEVCHAN s Using ON or assigning them a non zero value will work as expected DEFINE_DEVICE dvRelay 305 1 0 DEFINE_VA...

Страница 182: ...Reserved Identifiers 166 NetLinx Programming Language Reference Guide...

Страница 183: ...that returns a non array type to a one or two dimensional array variable for example X ATOI AMX where X is a one or two dimensional array variable This message is a warning and not an error because X...

Страница 184: ...ubroutine A CALL statement refers to a subroutine that has not been defined with a DEFINE_CALL statement Comment never ends EOF encountered A comment begins but never ends Place a close comment at the...

Страница 185: ...re limited in length to 132 characters including spaces Must be char array reference An array type variable was expected in CREATE_BUFFER CREATE_MULTI_BUFFER or CLEAR_BUFFER Must be integer reference...

Страница 186: ...g literal enclosed in single quotes does not follow the WARN keyword Subroutine may not call itself A subroutine cannot call itself It can however call a different subroutine Syntax error A syntax err...

Страница 187: ...in input file An invalid character was found during the build Use SYSTEM_CALL instance name This error occurs if a SYSTEM_CALL statement is written incorrectly as SYSTEM_CALL NAME INSTANCE NUMBER Vari...

Страница 188: ...ferenced by an OFF ON or TO keyword is out of range Bad re assign Call These errors occur when the Central Controller attempts to re assign the parameter variables in a DEFINE_CALL to the parameters i...

Страница 189: ...values from the CHAR array WIDECHAR wcData CH_TO_WC ASCII WC_COMPARE_STRING This keyword compares two Unicode strings If either string contains a character the matching character in the other string i...

Страница 190: ...Stat Position in Data from which to start reading Result A WIDECHAR array containing the Unicode data wcMyString WC_DECODE cData WC_FORMAT_UNICODE 1 WC_ENCODE This function encodes a Unicode string to...

Страница 191: ...when all reading or writing to the file is completed SLONG WC_FILE_CLOSE LONG hFile Parameters hFile Handle to the file returned by WC_FILE_OPEN Result 0 Operation was successful 1 Invalid file handl...

Страница 192: ...2 Unicode BE The file is opened as a Unicode BE big Endian formatted file If the file is opened as Read or R W Append and the file is a Unicode BE formatted file this parameter will be set to this va...

Страница 193: ...r 1024 nBytes WC_FILE_READ hFile wcBuffer 1024 WC_FILE_READ_LINE This function reads a line of widechar data from the specified file SLONG WC_FILE_READ_LINE LONG hFile WIDECHAR Buffer LONG BufLen Para...

Страница 194: ..._WRITE_LINE LONG hFile WIDECHAR Line LONG LineLen Parameters hFile Handle to the file returned by WC_FILE_OPEN Line Buffer containing the line of data to write LineLen Number of characters to write Re...

Страница 195: ...om the buffer and shift the remaining char acters up to fill the gap wcSubStr GET_BUFFER_STRING wcString 3 wcSubStr contains first 3 characters of wcString wcString is now three characters smaller in...

Страница 196: ...This function returns the specified number of characters starting at the speci fied location in the source string WIDECHAR WC_MID_STRING WIDECHAR STRING LONG Start LONG Count Parameters STRING The in...

Страница 197: ...10 WC_TO_CH This keyword converts a WIDECHAR array to a CHAR array CHAR WC_TO_CH WIDECHAR wcSTRING Parameters STRING The widechar string to convert to a character string Result A character string vers...

Страница 198: ...t enable the UTF 8 Unicode option and the Unicode Compile option in NetLinx Studio The UTF 8 Unicode option will tell Studio to store your file as UTF 8 which will support Unicode characters The Unico...

Страница 199: ...clude file located in the C Program Files Common Files AMXShare AXIs directory Because this location is the default Include search path you do not need to specify the directory in the include statemen...

Страница 200: ...d for CHAR arrays have been defined for WIDECHAR array for use in Unicode programming These functions allow you to operate on strings similar to the way you would with CHAR array For instance to remov...

Страница 201: ...ns expect data loss Converting between WIDECHAR and CHAR On occasion you may need to convert a CHAR array to a WIDECHAR array or a WIDECHAR array to a CHAR array The CH_TO_WC and WC_TO_CH functions ca...

Страница 202: ...UNICODE_BE WC_FORMAT_UTF8 The Unicode file format specified by the constant WC_FORMAT_UNICODE is the fastest to encode and decode You should use this format unless you have a particular application th...

Страница 203: ...amming for Unicode are caused by not wrapping Unicode string literals in _WC passing a WIDECHAR to a function that take a CHAR array or passing a CHAR array to a function that takes a WIDECHAR array I...

Страница 204: ...NetLinx UniCode Functions 188 NetLinx Programming Language Reference Guide...

Страница 205: ...local port as opposed to letting the system assign it for instance as the return value for IP_CLIENT_OPEN or IP_SERVER_OPEN to satisfy the static nature of DEFINE_EVENT handlers All event handlers mus...

Страница 206: ...representing the virtual port on the client machine that will be used for this conversation Sending data To send data to the server use the SEND_STRING command SEND_STRING 0 LocalPort 0 string The de...

Страница 207: ...the offline event See this example DATA_EVENT dvIP OFFLINE PROCESS THE DATA HERE STRING DO NOT REMOVE ME Server Programming Listening for client requests A client gains access to a service by sending...

Страница 208: ...connection allowed For example IP_SERVER_OPEN First_Local_Port 10510 IP_TCP IP_SERVER_OPEN First_Local_Port 10510 IP_TCP IP_SERVER_OPEN First_Local_Port 10510 IP_TCP This allows three simultaneous con...

Страница 209: ...gned a UDP IP port number not to be confused with local port This UDP IP port will be used to send UDP messages The server if listening will receive this message along with the IP address and UDP IP o...

Страница 210: ...ling IP_CLIENT_OPEN Multicast NetLinx can send and receive multi cast UDP messages To send a multi cast UDP message all you need to do is specify a multi cast address and port in the IP_CLIENT_OPEN fu...

Страница 211: ...ess nIPPort IP_TCP THE EVENTS GO BELOW DEFINE_EVENT Server Data Handler DATA_EVENT dvIPServer ONERROR SEND_STRING 0 error server ITOA Data Number ONLINE SEND_STRING 0 online server OFFLINE SEND_STRING...

Страница 212: ...Reference Guide SEND_STRING 0 offline client STRING SEND_STRING 0 string client Data Text THE ACTUAL PROGRAM GOES BELOW DEFINE_PROGRAM Send Ping To Server WAIT 50 SEND_STRING dvIPClient ping 13 END O...

Страница 213: ...s the module name with the addition of the AXS extension Module parameters behave exactly like subroutine parameters the parameter list is optional The value for each parameter is set either by the ma...

Страница 214: ...go into stop after search rewinding for a certain time VCR1_SREV_TO_STOP 12000 20 min vcr will go into stop after being paused for a certain time VCR1_PAUSE_TO_STOP 6000 10 min button feedback flag V...

Страница 215: ...TOP_FB nFUNCTION STOP dvDECK nOFFSET_FB PAUSE_FB nFUNCTION PAUSE dvDECK nOFFSET_FB FFWD_FB nFUNCTION FFWD dvDECK nOFFSET_FB REW_FB nFUNCTION REW dvDECK nOFFSET_FB SFWD_FB nFUNCTION SFWD dvDECK nOFFSET...

Страница 216: ...dvDECK nOFFSET_FN PLAY CALL FEEDBACK PLAY CASE STOP CANCEL_WAIT VCR1 REW TO STOP CANCEL_WAIT VCR1 PAUSE TO STOP CANCEL_WAIT VCR1 SREV TO STOP CALL ALL OFF MIN_TO dvDECK nOFFSET_FN STOP CALL FEEDBACK S...

Страница 217: ...OFF MIN_TO dvDECK nOFFSET_FN PAUSE CALL FEEDBACK PAUSE ACTIVE dvDECK nOFFSET_FB REC_FB CANCEL_WAIT VCR1 REW TO STOP CANCEL_WAIT VCR1 PAUSE TO STOP CANCEL_WAIT VCR1 SREV TO STOP WAIT VCR1_PAUSE_TO_STOP...

Страница 218: ...LL OFF MIN_TO dvDECK nOFFSET_FN SFWD CALL FEEDBACK SFWD CASE SFWD IF dvDECK nOFFSET_FB PLAY_FB OR dvDECK nOFFSET_FB STOP_FB OR dvDECK nOFFSET_FB REW_FB OR dvDECK nOFFSET_FB FFWD_FB OR dvDECK nOFFSET_F...

Страница 219: ...EL_WAIT VCR1 REW TO STOP CANCEL_WAIT VCR1 PAUSE TO STOP CANCEL_WAIT VCR1 SREV TO STOP WAIT VCR1_SREV_TO_STOP VCR1 SREV TO STOP SYSTEM_CALL FUNCTION dvDECK STOP nFIRST CALL ALL OFF MIN_TO dvDECK nOFFSE...

Страница 220: ...PORTS 5 dvDECK nOFFSET_FB REW_FB OR dcTRANPORTS 7 CHANNEL NO_BUTTON AND dvDECK nOFFSET_FB SREV_FB dcTRANPORTS 6 dvDECK nOFFSET_FB SFWD_FB dcTRANPORTS 7 dvDECK nOFFSET_FB SREV_FB dcTRANPORTS 8 dvDECK n...

Страница 221: ...the parent module they will then be separated by the declarations of the child module FIG 1 demonstrates how a NetLinx module is incorporated into a main program In this example the main program has...

Страница 222: ...Linx Modules 206 NetLinx Programming Language Reference Guide MODULE CODE GOES BELOW DEFINE_MODULE ModuleExample mdlVCR dvVCR dcTRANPORTS nVCR_FIRST END OF PROGRAM DO NOT PUT ANY CODE BELOW THIS COMME...

Страница 223: ...nto a sub directory of the USER directory For example a board room system that contains a NetLinx master might be placed in a directory named BoardRoom as a subdirectory of USER If you decide to downl...

Страница 224: ...tional because the WDMs default configuration options work for most applications The only WDM configuration option that might need to be modified is the TCP port that the TPClasses Java code attempts...

Страница 225: ...nary representation of the variable while the XML represents the variable as a ASCII text only XML document The binary routines are ideal when sending data from one NetLinx system to another NetLinx s...

Страница 226: ...FINITIONS GO BELOW DEFINE_CONSTANT nFileRead 1 nFileWrite 2 DATA TYPE DEFINITIONS GO BELOW DEFINE_TYPE STRUCTURE _AlbumStruct LONG lTitleID CHAR sArtist 100 CHAR sTitle 100 CHAR sCopyright 100 CHAR sL...

Страница 227: ...ruct 1 sLabel MCA AlbumStruct 1 sReleaseDate 1974 AlbumStruct 1 nNumTracks 11 AlbumStruct 1 sCode 3132333435 AlbumStruct 1 nDiscNumber 91 AlbumStruct 2 lTitleID 17248229 AlbumStruct 2 sArtist Buffet J...

Страница 228: ...O DISCS slFile FILE_OPEN BinaryEncode xml nFileWrite IF slFile 0 slReturn FILE_WRITE slFile sBinaryString LENGTH_STRING sBinaryString IF slReturn 0 SEND_STRING 0 FILE WRITE FAIL RETURN ITOA slReturn s...

Страница 229: ...sXMLString IF slReturn 0 SEND_STRING 0 FILE WRITE FAIL RETURN ITOA slReturn slReturn FILE_CLOSE slFile IF slReturn 0 SEND_STRING 0 FILE CLOSE FAIL RETURN ITOA slReturn CONVERT TO BINARY lPos 1 slRetu...

Страница 230: ...E_READ slFile sXMLString MAX_LENGTH_STRING sXMLString IF slReturn 0 SEND_STRING 0 FILE WRITE FAIL RETURN ITOA slReturn slReturn FILE_CLOSE slFile IF slReturn 0 SEND_STRING 0 FILE CLOSE FAIL RETURN ITO...

Страница 231: ...s a single byte The size of a field may or may not be stored depending upon the field type fields with know lengths do not have a size prefix The specific formats of all the supported types are descri...

Страница 232: ...TESTR 0xE9 Length MSB Length LSB BYTE Sequence STRUCT A structure containing one or more fields Each element within a structure is self descriptive and can be any of the types in this table 0xEA First...

Страница 233: ...optional Typically only var data Data data var is needed var name MyName name type ui1 type data 255 data var UWORD Unsigned short value If var is an element of an array name is replaced with index i...

Страница 234: ...ypes in this table Each ele ment in an array is self descriptive The type of the parent is the type of the entire array Type is optional and generally not included when the array is an array of struct...

Страница 235: ...Arrays can optionally be encoded decoded as pairs of ASCII encoded HEX The pairs of ASCII encoded HEX needs to be padded to the size of the data so a 4 byte data value needs to have 4 bytes that repr...

Страница 236: ...guage Reference Guide encoded style BE style size 2 size data 010203040B0C0D0E data encoded This is the default type of encoding for non CHAR arrays but can be used to encode decode char arrays as wel...

Страница 237: ...ngth of Array 3 4D 43 41 Data MCA E5 Start of CHAR Array String 00 03 Length of Array 3 4D 43 41 Data MCA E5 Start of CHAR Array String 00 04 Length of Array 4 31 39 37 34 Data 1974 E2 WORD INTEGER or...

Страница 238: ...RD LONG or SLONG 00 BC 1E A4 Data 12328612 E5 Start of CHAR Array String 00 0D Length of Array 13 42 75 66 66 65 74 2C 20 4A 69 6D 6D 79 Data Buffet Jimmy E5 Start of CHAR Array String 00 05 Length of...

Страница 239: ...t Jimmy string array array name STITLE name curLength 26 curLength string Living amp Dying in 3 4 Time string array array name SCOPYRIGHT name curLength 3 curLength string MCA string array array name...

Страница 240: ...e NDISCNUMBER name data 91 data var struct struct index 2 index var name LTITLEID name data 17248229 data var var name NDISCNUMBER name data 105 data var struct struct index 3 index var name LTITLEID...

Страница 241: ...vice channel array Specifies a group of DEVCHANs Device level A reference to a specific level in the NetLinx system DEVLEV Device level array Specifies a group of DEVLEVs Device number A unique number...

Страница 242: ...annel or variable in this set can be on at a time Output change A message to the output function of a channel Reserved identifier An identifier reserved for use by the NetLinx compiler Statements Comp...

Страница 243: ...ry 227 NetLinx Programming Language Reference Guide Wildcard character In NetLinx the question mark can only be used in a COMPARE_STRING operation unlike Axcess which uses the question mark to compare...

Страница 244: ...Appendix B Glossary 228 NetLinx Programming Language Reference Guide...

Страница 245: ...Appendix B Glossary 229 NetLinx Programming Language Reference Guide...

Страница 246: ...o are registered trademarks of AMX AMX reserves the right to alter specifications without notice at any time It s Your World Take Control 3000 RESEARCH DRIVE RICHARDSON TX 75082 USA 800 222 0193 469 6...

Отзывы: