AMX Netlinx Programming Language
|
|
Bookmark AMX Netlinx Programming Language |
About AMX Netlinx Programming LanguageHere you can find all about AMX Netlinx Programming Language like manual and other informations. For example: review.
AMX Netlinx Programming Language manual (user guide) is ready to download for free.
On the bottom of page users can write a review. If you own a AMX Netlinx Programming Language please write about it to help other people. [ Report abuse or wrong photo | Share your AMX Netlinx Programming Language photo ]
Manual
Preview of first few manual pages (at low quality). Check before download. Click to enlarge.
Download
(English)AMX Netlinx Programming Language, size: 1.5 MB |
AMX Netlinx Programming Language
User reviews and opinions
| Biromos2 |
10:24am on Monday, September 27th, 2010 ![]() |
| Running a business where I have to ship out packages on a daily basis, I was looking for a reliable. I remember when thermal printers used to put out this awleful smell. It smelt like burnt plastic and paper. They also were HUGE. Compact size, durable and light weight Bit expensive and Windows OS only | |
| ParanoidAndroid |
12:33pm on Thursday, August 26th, 2010 ![]() |
| This is a lifesaver! Fast printing and Thermal means NO INK REQUIRED! Love this and use it everyday for US postage USPS. Reliable time and money saver for shipping applications. For those who regularly ship through the USPS or even UPS. | |
| jurgen |
11:45pm on Friday, August 13th, 2010 ![]() |
| Several months ago I was assigned a project by my boss and this project involved new product labels for a couple of our production departments. | |
| Bonnee |
4:07pm on Tuesday, June 22nd, 2010 ![]() |
| Make sure you find out your software requirements prior to ordering this item. I ordered it along with Teklynx Label Matrix software. | |
Comments posted on www.ps2netdrivers.net are solely the views and opinions of the people posting them and do not necessarily reflect the views or opinions of us.
Documents

certificacinoficialcomm-tec
Formacin oficial Comm-Tec para obtener el certificado de programador de Sistemas AMX: Manual que prepara para la realizacin de las pruebas de conocimientos mnimos necesarios para la realizacin del seminario.
>>
manual de programacin bsica AMX
Manual de productos Axcess y NetLinx
Pgina 1 de 1
Manual de programacin bsica AMX
Advertencia
Este manual est en ingls. Estamos trabajando para tener listo una versin completa en castellano prximamente.
Importante
Durante el presente manual se hace referencia a unos archivos de programacin que puede descargarse en la siguiente direccin: http://www.amx.com/webtraining/intro_amx_prog/code_files/Tutorial_Program_Fil es.zip Necesita el programa NetLinx Studio para practicar las lecciones que encuentra en este manual. Descrgueselo desde aqu. Nota: Si alguno de los vnculos est roto, escriba un e-mail a marketing@comm-tec.es
Table of Contents
Introduction to AMX Programming.... 4 What is Axcess?..... 4 What is NetLinx?..... 4 The AMX Language Tutorial.... 4 Unit 1: Language Basics.... 5 Chapter 1 - Simply the Basics.... 5 Introduction..... 5 Format of the language.... 5 Statements and compound statements.... 5 Comments within the program.... 6 Identifiers..... 7 Reserved words.... 7 Special characters and operators..... 7 Chapter 2 - The Definition Sections.... 8 Starting a new program.... 8 Defining devices..... 8 Defining constants.... 9 Defining variables..... 9 Startup code..... 10 Mainline..... 10 Chapter 3 - Using Input and Output.... 11 Controlling something over there.... 11 The device-channel concept..... 11 All about the channel..... 11 Push..... 11 Release..... 12 Push_Device..... 12 Release_Device..... 12 Changing the state of a channel.... 13 ON..... 13 OFF..... 13 TOTAL_OFF..... 13 TO..... 14 PULSE..... 14 Direct assignment..... 14 Putting input and output together.... 15 Chapter 4 - Channel Characteristics.... 16 The parts of an output channel.... 16 Mutually exclusive.... 16 Putting it all to work.... 17 Programming feedback..... 18 Grouping feedback statements.... 18 Chapter 5 - Your First Program.... 20 The program and the panel.... 20 Unit 2: Conditionals and Waits.... 24 Chapter 6 Conditional Expressions... 24 Introduction..... 24 Conditional expressions.... 25 The IF statement..... 25 The IF.ELSE set of statements.... 25 Repeating IF.ELSE set of statements.... 26 Nesting..... 26 The SELECT.ACTIVE statement.... 27 Trying it out..... 27 The variable assignment method.... 28
More Conditional operators..... 29 Chapter 7 The Wait Keywords.... 31 Controlling time within the AMX System... 31 The WAIT list.... 31 Multiple Waits..... 32 Special uses of Wait..... 33 Naming Waits.... 33 Cancelling, pausing, and restarting Waits.... 33 The WAIT_UNTIL keyword.... 34 Misusing WAIT_UNTIL.... 34 Naming and removing Wait_Untils.... 34 Unit 3: Levels.... 35 Chapter 8 Creating Levels.... 35 Introduction..... 35 What is a level?..... 35 Creating levels..... 35 Chapter 9 Using Levels.... 38 Reading levels.... 38 Making a preset..... 38 Using bar graphs..... 38 Connecting levels.... 39 Unit 4: Arrays, Strings and Buffers.... 40 Chapter 10 Arrays and Strings.... 40 Introduction..... 40 Defining arrays..... 40 Accessing and storing array values.... 40 Strings..... 41 The string expression..... 42 Arrays as strings..... 42 String lengths..... 42 Sending strings and arrays.... 44 ASCII codes..... 44 Integer arrays..... 45 Chapter 11 Working with Arrays.... 46 Grouping Data.... 46 Conversion keywords..... 46 ITOA..... 46 ITOHEX..... 46 ATOI..... 47 Array manipulation keywords.... 47 LEFT_STRING..... 47 RIGHT_STRING.... 47 MID_STRING..... 47 Finding strings..... 48 Removing strings.... 48 Uppercase vs. lowercase..... 49 Setting uppercase and lowercase.... 49 Chapter 12 Using Buffers.... 50 Communicating to the outside world.... 50 Receiving strings..... 50 Creating buffers..... 50 Storing characters..... 51 Retrieving characters..... 51 Clearing a buffer..... 52 Conclusion..... 53 Glossary..... 54
Unit 1: Language Basics Chapter 1 - Simply the Basics
Introduction
This unit will help you start writing AMX programs. By the end of this unit you should be familiar with several concepts: Basic ground rules for writing AMX programs The device channel concept The different sections that make up an AMX program How Axcess executes a program Basic input and output functions Simple feedback. As you progress through the chapters you will develop a simple Axcess program containing these basic features, and you will build on this program in later units.
Format of the language
The AMX languages can be written in a free format, meaning that the source code is independent of tabs and carriage returns. Because of this, it is advised to use a consistent method of code placement in order to make the code more readable. In this manual, an outline format is used; that is, each subsection of a section is slightly indented. For example:
PUSH[PANEL,1] { IF (X = 1) { Y = 2 Z = 3 } }
Statements and compound statements
During programming, most of the keywords and operators require a complete statement. A keyword is a word or series of words that signifies the operation for the system to execute. That keyword and all its parameters form the statement. For example, the keyword to turn a channel on is merely ON. However, the statement to turn on a particular channel is ON[RELAY_CARD,RELAY]. Statements can also involve mathematical or logical operations when operators are used. An operator is a character that performs a specific mathematical or relational function. For example, the operator used to set a variable equal to a value is =. As expected, the statement used to set variable X to the number 5 is X = 5. You will frequently have to group several different statements together into one compound statement. The braces { } are used to enclose this type of statement. Compound statements are used if several statements are to be executed in a situation where program syntax will allow just one. The statements are executed in the sequence in which they are programmed. The number of open braces { and close braces } must be the same in your program. The compiler will point out this error to you if the quantities are different after compiling. Compound statements give you the ability to group multiple statements together into one unit, much like grouping sentences together into one paragraph. The most common example of compound statements occurs with the PUSH keyword. (This keyword is explained in depth later.)
DEFINE_CONSTANT (* TRANSPORT (IR CARD) CHANNEL NUMBERS *) PLAY = 1 STOP = 2 PAUSE = 3 FFWD = 4 REW = 5 (* THE RELAY CARD CHANNEL DEFINITIONS *) SCREEN_UP = 1 SCREEN_DOWN = 2 SYS_POWER = 3 DRAPE_OPEN = 4 DRAPE_CLOSE = 5 DRAPE_STOP = 6 (* THE LIGHT LIGHT_FULL = LIGHT_MED = LIGHT_LOW = LIGHT_OFF = CARD CHANNEL DEFINITIONS *) 3 4
The value of the constant PLAY is 1. STOP has a value of 2. Both of these values cannot be changed anywhere in the program. Later in your program when you need to activate the Play function of the VCR, you dont have to remember that it is channel 1 of the devicejust use the constant PLAY and the system knows to use channel 1. More than one constant can have the same number. For example, PLAY and FWD can both equal 1. You will probably come across this if two cards do not have the same channels for the same functions. PLAY on the VCR control card might be channel 1, and FWD on the slide control card might also be channel 1. By definition, the same constant cannot reference more than one number. This may seem obvious, but this type of error could work its way into large programs. If you make this mistake, the compiler will notify you with a Duplicate symbol error message upon compiling.
Defining variables
Variables are places to store data that will change as the program is executed. Think of a variable as an anything box; nearly anything can be placed in here. For example, a variable can represent a number. For integers, the numeric range is from 0 to 65,535. If one integer variable is subtracted from another, the result will be positive. (If, however, you do subtract a larger number from a smaller number, the result wraps around at 65,535. For instance, if you subtract 20 from 10, the result is 65,525). Once the system is turned off, variables do not lose their value. If a certain variable equals 3 when the Axcess control system is shut down, it will remain 3 when the system is reactivated. This function has both advantages and drawbacks. It obviously helps when you need the system to retain values for the variables. However, if you need those variables to be reset when the system is turned on, they must be reset manually within the DEFINE_START section. In your first program you will not be using variables, but keep the DEFINE_VARIABLE header because you will be using them in the future. The DEFINE_MUTUALLY_EXCLUSIVE, DEFINE_LATCHING, and DEFINE_TOGGLING sections are also explained later.
equal to the device number of PANEL. This variable is set when a channel is turned on, and it remains constant until the end of mainline is reached. If no channel has been turned on, PUSH_DEVICE will contain zero.
Release_Device
RELEASE_DEVICE is a system variable that stores the number of the device containing the channel whose button was most recently released. If a button for device PANEL was released, RELEASE_DEVICE would be equal to the device number of PANEL. This system variable is used in a program in the same manner as PUSH_DEVICE. This variable will have the same value for only one pass through the program.
NOTE: PUSH_DEVICE and RELEASE_DEVICE cannot both have a non-zero value during the same pass through mainline. At least one will always be zero.
Push_Channel
PUSH_CHANNEL is the similar to PUSH_DEVICE, except in this case the channel number that was most
recently turned on is stored inside the variable.
Release_Channel
RELEASE_CHANNEL, stores the channel whose button was most recently released. This system variable is used in a program in the same manner as PUSH_CHANNEL.
NOTE: PUSH_CHANNEL and RELEASE_CHANNEL cannot both have a non-zero value during the same pass through mainline. At least one will always be zero.
Changing the state of a channel
So now you can respond to an input change in your program, and you want it to activate a different device-channel. The next series of keywords allow you to activate channels based on an input change. This activation is called an output change, which is a message to the output function of a channel. The keywords to do this are:
ON OFF TOTAL_OFF PULSE TO MIN_TO
When you use one of these keywords to activate a channel in a device, the device starts the operation that is associated with the channel. For instance, activating channel 5 on a relay card activates relay number 5, whereas channel 5 on an infrared/serial card causes it to generate the infrared pattern it has stored at location 5. Variables can be used as output channels also, but doing so does not actually cause an output change. When a variable is activated as a channel, turning it on gives it a value of 1, and turning it off gives it a value of 0. Following are brief definitions of each of the output change keywords.
The ON keyword simply turns on a channel or variable. If the channel or variable is already on, its status will remain unchanged. Here are two different examples:
ON[1,2] ON[TEMP]
This turns on channel 2 of device 1. This sets the value of the variable TEMP to 1.
DEFINE_MUTUALLY_EXCLUSIVE ([RELAY,SCREEN_UP],[RELAY,SCREEN_DOWN]) ([RELAY,DRAPE_OPEN].[RELAY,DRAPE_STOP]) ([LIGHTS,LIGHT_FULL].[LIGHTS,LIGHT_OFF]) ([VCR,PLAY].[VCR,REW]) ([CASS,PLAY].[CASS,REW]) ([CD,PLAY].[CD,REW])
Actually, the correct terminology here is the status of all channels is momentary by default. However, in the common language of programmers, status is understood. From this point on in the manual, the behavior of status will be described in this manner.
The first set defines the two screen channels as mutually exclusive. Using the shortcut, the second set defines the three drape channels as mutually exclusive, and the third set defines the four lighting relays as mutually exclusive. The fourth through the last sets also use the shortcut to define the five transport functions as mutually exclusive. This is done to achieve last button pressed status for those decks. When you add the feedback statements to the program, the buttons for the VCR, CD player, and cassette deck will indicate the last button selected from each group. Once a channel has its status turned on in a mutually exclusive group, there will always be one channel with its status on in that group, unless it is turned off with the TOTAL_OFF keyword.
Putting it all to work
Now that you know just how all these different types of channels operate, you can skip down to the mainline section of the program and add these lines to activate your system power, screen, drape, and lighting relays:
PUSH[TP,31] { ON[RELAY,SYS_POWER] } PUSH[TP,32] { OFF[RELAY,SYS_POWER] } PUSH[TP,33] { TO[RELAY,SCREEN_UP] } PUSH[TP,34] { TO[RELAY,SCREEN_DOWN] } PUSH[TP,41] { TO[RELAY,DRAPE_OPEN] } PUSH[TP,42] { TO[RELAY,DRAPE_CLOSE] } PUSH[TP,43] { TO[RELAY,DRAPE_STOP] } RELEASE[TP,43] { OFF[RELAY,DRAPE_STOP] } PUSH[TP,45] { TO[LIGHTS,LIGHT_FULL] } PUSH[TP,46] { TO[LIGHTS,LIGHT_MED] } PUSH[TP,47] { TO[LIGHTS,LIGHT_LOW] } PUSH[TP,48] { TO[LIGHTS,LIGHT_OFF] }
This section accomplishes several tasks:
A press of the System Power On button turns on the SYS_POWER channel on the device RELAY. A press of the System Power Off button turns off the SYS_POWER channel on the device RELAY. A press of the Screen Up button turns on the SCREEN_UP channel on device RELAY, after turning off SCREEN_DOWN. The Screen Down button acts the same way as the Screen Up button, but with the opposite channels. Pressing Drape Open, Drape Close or Drape Stop does several things. If it is off, it makes sure the other drape channels are off (due to its mutually exclusive relationship), then it turns on. When the Drape Stop button is released it turns off the DRAPE_STOP relay on the relay device, but its status(feedback) remains on. (Remember, to turn off the status of a channel in a mutually exclusive group, use the keyword TOTAL_OFF.) Since the LIGHTS channels are mutually exclusive, a press of the Lights Full button turns on the LIGHT_FULL channel on the device LIGHTS, after turning off any LIGHTS channel that was previously on. The other LIGHTS channels operate in a similar fashion.
Programming feedback
So far you have been shown how a channels output is affected in a program. You know what to do with the input changes and how to create output changes, but now you want to see some feedback on your control panel. Feedback refers to the lighting of a button during and after it is pressed. The master will not do this automatically; you must tell the system how to light the button. Feedback involves only one statement per button. The first part of the statement references the device-channel of the button that is going to be lit. It is followed by an equal sign (=) and the device-channel corresponding to the source of the feedback. For example:
[TP,1] = [VCR,PLAY]
When VCR channel 1 (the constant value of PLAY) is on, the light of TP button 1 will also be on. When the channel is off, the light will be off. Remember that any reference to a device-channel that does not have the keyword Push or Release preceding it is referring to the output side of the channel. This is a very important concept, because it is the basis of how feedback works. Also recall that one way of creating an output change is to assign a value directly to the device-channel. If the value that you are assigning is another device-channel reference, this is in effect saying to the system, Take the output status of channel PLAY on device VCR, and send it as an output change to channel 1 of device TP. Since you defined the device-channel [VCR,PLAY] as being in a mutually exclusive group, its status will be on if it was the last channel activated in that set, and the feedback assignment will light button 1 on the control panel. Once a channel has feedback on in a mutually exclusive group, there will always be one channel with feedback on in that group, until turned off with TOTAL_OFF.
Grouping feedback statements
The feedback statement is sometimes found after the end of a Push statement. For example:
PUSH[TP,1] { PULSE[VCR,PLAY] } [TP,1] = [VCR,PLAY]
When TP button 1 (Play) is pressed, both VCR channel 1 (PLAY) and the Feedback (output) of the button are turned on. Notice that the feedback statement is outside of the PUSH statement. This is a very important concept. If the feedback statement is included in the PUSH statement it would not operate as desired, but would show the feedback of the last PUSH not the current state. The feedback statements can also be grouped together in a feedback section at the end of the program. For example:
[TP,1] = [VCR,PLAY] [TP,2] = [VCR,STOP] [TP,3] = [VCR,PAUSE]
This feedback section will act no differently if each statement is placed under its corresponding PUSH statement. Where you locate your feedback statements inside your program makes no difference to the operation of the system, but it does make a difference in the readability of your program. Grouping all of the feedback statements at the end of the program is fine, but in larger programs it can be a hassle to skip from the top where the PUSH is located to the bottom where the feedback statements are located. Smaller programs, however, may be easier to manage if all the PUSH statements are together and all the feedback statements are together. A good compromise is to break your program into sections of code where each section has a similar group of functions, and put the feedback statements for each section right below it.
(***********************************************************) (* THE ACTUAL PROGRAM GOES BELOW *) (***********************************************************) DEFINE_PROGRAM PUSH[TP,1] { PULSE[VCR,PLAY] } PUSH[TP,2] { PULSE[VCR,STOP] } PUSH[TP,3] { PULSE[VCR,PAUSE] } PUSH[TP,4] { PULSE[VCR,FFWD] } PUSH[TP,5] { PULSE[VCR,REW] } PUSH[TP,9] { PULSE[CD,PLAY] } PUSH[TP,10] { PULSE[CD,STOP] } PUSH[TP,11] { PULSE[CD,PAUSE] } PUSH[TP,12] { PULSE[CD,FFWD] } PUSH[TP,13] { PULSE[CD,REW] } PUSH[TP,17] { PULSE[CASS,PLAY] } PUSH[TP,18] { PULSE[CASS,STOP] } PUSH[TP,19] { PULSE[CASS,PAUSE] } PUSH[TP,20] { PULSE[CASS,FFWD] } PUSH[TP,21] { PULSE[CASS,REW] } PUSH[TP,31] { ON[RELAY,SYS_POWER] } PUSH[TP,32] { OFF[RELAY,SYS_POWER] }
PUSH[TP,33] { TO [RELAY,SCREEN_UP] } PUSH[TP,34] { TO [RELAY,SCREEN_DOWN] } PUSH[TP,41] { TO [RELAY,DRAPE_OPEN] } PUSH[TP,42] { TO [RELAY,DRAPE_CLOSE] } PUSH[TP,43] { TO [RELAY,DRAPE_STOP] } RELEASE[TP,43] { OFF[RELAY,DRAPE_STOP] } PUSH[TP,45] { TO [LIGHTS,LIGHT_FULL] } PUSH[TP,46] { TO [LIGHTS,LIGHT_MED] } PUSH[TP,47] { TO [LIGHTS,LIGHT_LOW] } PUSH[TP,48] { TO [LIGHTS,LIGHT_OFF] } (* FEEDBACK *) [TP,1] = [VCR,PLAY] [TP,2] = [VCR,STOP] [TP,3] = [VCR,PAUSE] [TP,4] = [VCR,FFWD] [TP,5] = [VCR,REW] [TP,9] = [CD,PLAY] [TP,10] = [CD,STOP] [TP,11] = [CD,PAUSE] [TP,12] = [CD,FFWD] [TP,13] = [CD,REW] [TP,17] = [CASS,PLAY] [TP,18] = [CASS,STOP] [TP,19] = [CASS,PAUSE] [TP,20] = [CASS,FFWD] [TP,21] = [CASS,REW] [TP,31] = [RELAY,SYS_POWER] [TP,32] = (1-[RELAY,SYS_POWER]) [TP,33] = [RELAY,SCREEN_UP] [TP,34] = [RELAY,SCREEN_DOWN] [TP,41] = [RELAY,DRAPE_OPEN] [TP,42] = [RELAY,DRAPE_CLOSE] [TP,43] = [RELAY,DRAPE_STOP] [TP,45] = [LIGHTS,LIGHT_FULL] [TP,46] = [LIGHTS,LIGHT_MED] [TP,47] = [LIGHTS,LIGHT_LOW] [TP,48] = [LIGHTS,LIGHT_OFF] (***********************************************************) (* END OF PROGRAM *) (* DO NOT PUT ANY CODE BELOW THIS COMMENT *) (***********************************************************)
Unit 2: Conditionals and Waits Chapter 6 Conditional Expressions
While your first program may look complicated at first, it really doesnt show the power of the AMX programming languages. The program is what we at AMX call one-to-one. That means that each button has one and only one function, with no special conditions or considerations. The control panel has a separate section of buttons for each piece of equipment. But suppose you want the same number of functions with fewer buttons. A common solution is to have several groups of buttons with similar functions reduced to one group, with a set of buttons that selects which piece of equipment the buttons control. In your program, you could have one button for each piece of equipment to select each deck, and one set of transport buttons. Your panel could now look like the one below:
SELECT { ACTIVE(conditional expression 1): { Statement 1 } ACTIVE(conditional expression 2): { Statement 2 } ACTIVE(conditional expression 3): { Statement 3 } ACTIVE(1): { Default statement } }
Here, the last ACTIVE will always be true (remember in AMX programming a 1 is true and a 0 is false), and will execute only if all of the conditions of the previous ACTIVEs are false. This makes the last ACTIVE statement the default statement.
Trying it out
Now you can write the code for your new panel layout. Before you do, however, you will need to update your definition sections a little. The preferred method of implementing select groups is to use one variable and change its value based on which deck is selected.
The variable assignment method
This is the preferred method of programming select groups. Assigning different values to one variable depending on what is selected. This method is actually more powerful than other methods, as it provides more flexibility while using a lot less code. First add just one variable, DECK to the program you wrote previously (or STEP1.AXS). This will be the select variable. How you define this variable depends upon whether you are programming for an Axcess master or a NetLinx Master. For a NetLinx master you will define the variable to contain NetLinx device address information by using the DEV keyword as shown below: Axcess
DEFINE_VARIABLE DECK
NetLinx
DEFINE_VARIABLE DEV DECK
To this variable you will assign the device number of your currently selected deck. Here is your Select buttons code:
PUSH[TP,1] { DECK=VCR } PUSH[TP,2] { DECK=CD } PUSH[TP,3] { DECK=CASS }
You can reduce the number of transport sections from three to just one by using the variable DECK as the device number in the TO statements, instead of using VCR, CD, and CASS. Heres the section of code:
PUSH[TP,17] { TO [DECK,PLAY] } PUSH[TP,18] { TO [DECK,STOP] } PUSH[TP,19] { TO [DECK,PAUSE] } PUSH[TP,20] { TO [DECK,FFWD] } PUSH[TP,21] { TO [DECK,REW] }
Notice that no IF statement is necessary, no mutually exclusive variables are necessary, and this is the only deck transport section of programming needed in the whole program! But how does this work? Suppose you want to play the CD player. First you press the CD Select button. This assigns the value 2 (the constant value of CD) to the variable DECK. Now the device-channel references of the TO transport statements will reference device number 2 (the CD device). Pressing button number 17 on the Touch Panel will activate [DECK,PLAY], which the master will interpret as [2,1]. The feedback for the transport section works in the same manner as the control section. The feedback statements use the DECK variable as the device from which to get the feedback. These statements for the selection buttons, however, are something new:
[TP,1] = (DECK=VCR) [TP,2] = (DECK=CD) [TP,3] = (DECK=CASS)
These statements, like all feedback statements, are direct assignment output changes; however, the source of the assignment is a conditional expression. In interpreting this kind of feedback statement, the master first evaluates the conditional expression. If the expression is evaluated as true, the expression is replaced with a 1; otherwise it is replaced with a zero. (Remember, only one of these will be evaluated as true because a variable cannot have two different values at one time.) Thus the direct assignment will assign a 1 (on) to the Touch Panel button for which the expression is true, and a zero (off) to the false ones. Recall that assigning a 1 to a device-channel is the same as turning the output of a device-channel on
Conditional Operators
The previously discussed IF and IF.ELSE statements can only base the program flow on one condition. You can, however, combine two of these conditions with a conditional operator. This operator sets the rules for determining the end result. The conditional operators used in AMX systems are AND, OR, XOR, and NOT. These are placed in between the two conditions after the IF statement. For example:
IF((X = 10) AND (Y = 5)) { Statement 1 }
If the end result of the conditional expression is true, the system continues with Statement 1. If the end result is false, the system simply ignores Statement 1. The conditional operators can be abbreviated in your program as shown below:
Conditional Operator Abbreviations
Abbreviation && || ^^ ! Function Logical AND Logical OR Logical XOR Logical NOT Abbreviation & | ^ ~ Function Bitwise AND Bitwise OR Bitwise XOR Bitwise NOT
In most conditional expressions, the possible conditions of two statements are analyzed to achieve one result. A text formula can be followed to find that result: If <condition 1> is <its condition (true or false)> < conditional operator> <condition 2> is <its condition>, then the result of the expression is <result of statement conditions>. The result is found by basing the conditions of the statements against the rules set by the conditional operator. Here are those specific rules: AND Both statements must be true for the result to be true. OR At least one of the conditions must be true for the result to be true. XOR Only one statement can be true for the result to be true. NOT If the statement is true, the result is false. On the contrary, if the condition is false, the result is true. This expression uses only one statement.
PUSH[TP,31] { IF ([RELAY,RACK_POWER]) (* power being turned off *) { OFF[RELAY,AMP_POWER] TO[LIGHTS,LIGHT_FULL] TO[RELAY,SCREEN_UP] TO[RELAY,DRAPE_OPEN] WAIT 5 OFF[RELAY,RACK_POWER] WAIT 1200 PULSE[LIGHTS,LIGHT_OFF] } ELSE (* power being turned on *) { ON[RELAY,RACK_POWER] TO[RELAY,SCREEN_DOWN] TO[RELAY,DRAPE_CLOSE] WAIT 5 ON[RELAY,AMP_POWER] WAIT 200 PULSE[LIGHTS,LIGHT_MED] } }
Notice the use of the PULSE keyword. This is done, as you may recall, because TO cannot be used inside a Wait. Since the lighting buttons are momentary, you use a Pulse to actuate the relay for just a moment. Waits can appear inside other Waits. This is called nesting Waits. You dont need to nest Waits in your program here, but here is how it is done:
WAIT 200 { ON[RELAY,SCREEN_UP] WAIT 200 OFF[RELAY,SCREEN_UP] }
In this example, the system would wait twenty seconds, turn on the Screen Up relay, wait twenty more seconds, then turn off the Screen Up relay. Any timed sequence of events can be accomplished with or without nested Waits. Using nested Waits is in many cases more readable than non-nested Waits. Nonnested Waits, however, use less code. Here is the same example without nesting:
WAIT 200 ON[RELAY,SCREEN_UP] WAIT 400 OFF[RELAY,SCREEN_UP]
Special uses of Wait
Any one Wait can only be placed in the Wait list once. If a particular Wait is already in the Wait list, it cannot be placed into the list a second time until the first instance is either cancelled or expired. For instance, suppose the following line appears in mainline where it will be executed every pass through mainline:
WAIT 5 FLASH = NOT FLASH
The first time this is executed, the Wait is placed into the Wait list. But what if this line is executed again before the Wait expires? Since the Wait is already in the Wait list, the line is simply ignored. One halfsecond after the first execution of this statement, the value in variable FLASH is inverted; if it was zero it will be changed to 1, and if it was non-zero it will be changed to zero. On the next pass through mainline, the Wait will again be placed into the Wait list and the cycle will repeat for the duration of the program. This in effect creates a variable whose state inverts every half-second.
X = FIND_STRING (PRESETS,'LO',1)
When the master executes this statement, it will search the array PRESETS from the beginning, looking for the string LO. If the system finds the search string, as in this case it will, it returns the starting position of the search string in the PRESETS array: in this case, 4. The third parameter (in this example, 1) tells the master where in the array PRESETS to start the search.
Removing Strings
The REMOVE_STRING keyword works much like the FIND_STRING keyword. However, when the master finds the sequence it is looking for, it extracts every character up to and including the sequence. All the other characters move up to fill in the space. Here is an example:
DEFINE_VARIABLE SOURCE[20] DEST[20] DEFINE_PROGRAM SOURCE = THIS IS A TEST DEST = REMOVE_STRING (SOURCE,IS,1)
After the last line is executed, DEST will contain THIS and SOURCE will contain IS A TEST. Notice that after the removal, the first location of the array SOURCE contains a space. This is because REMOVE_STRING removed all characters from the beginning of SOURCE up to and including the string IS. It did not remove the space following the string IS in SOURCE. Also notice that the first occurrence of IS is embedded in the word THIS. The length values of both arrays are set according to the results of the operation. In this case, the length value of SOURCE is set to 4, and DEST is set to 10. In FIND_STRING, each of the first two parameters can be a string literal, string expression, or array. However, in the case of REMOVE_STRING, having anything except an array as the first parameter makes no sense because the master cannot remove part of a string literal or string expression, only an array variable. This is because string literals are constant values and string expressions may contain constant values. Once loaded into the master, constant values cannot be changed. Look at these examples:
STR = REMOVE_STRING(PRESETS,12,1) (* OK this works*) STR = REMOVE_STRING(2,HELLO,10,13,HELLO,1) (* NO this doesnt work *)
Remember that REMOVE_STRING changes the first parameter after it removes whatever characters it needs, and only variables can be changed at run time. Also remember to supply the starting position of the search as the third parameter for both FIND_STRING and REMOVE_STRING.
UPPERCASE vs. lowercase
When using FIND_STRING and REMOVE_STRING, as well as when comparing two string values, it is important to remember that such comparisons are case sensitive, which means that uppercase and lowercase values are not evaluated the same. As you recall, the compiler is not case sensitive when it comes to keywords and identifiers. The compiler is case sensitive, however, when it comes to values inside single quotes (string literals). Here are some examples:
DEFINE_VARIABLE BUFR[10] CHAR DEFINE_START CREATE_BUFFER RS232,BUFR
Now all string data sent to the Master from the device RS232 will go into the array BUFR, as described earlier. Now, suppose you want to get the data out of the buffer as soon as it enters. This is usually a twostep process. Here is an example:
IF(LENGTH_STRING(BUFR)) { CHAR = GET_BUFFER_CHAR(BUFR) }
These two lines of code are actually one statement: an IF statement. The condition of the If is the result of the LENGTH_STRING keyword; if there are not any characters in the buffer (length value of BUFR is zero), then the master will skip the second part of the statement. The second part, which will be executed if there are one or more characters in BUFR, tells the master to get the first character in BUFR place it into the variable CHAR.
Characters should be continuously retrieved and removed from the buffer so that incoming strings have spaces to completely enter. Be sure to place a GET_BUFFER_CHAR statement in a position to do this. Remember, the master system is constantly running through the main program, and it will execute the GET_BUFFER_CHAR statement as long as it is in its path of execution.
Clearing a buffer
AMX programming provides a single keyword that clears a buffer: CLEAR_BUFFER. Here is how it is used:
CLEAR_BUFFER BUFR
This keyword effectively sets the length of the buffer to zero, so that subsequent GET_BUFFER_CHAR statements will not return anything. Using CLEAR_BUFFER is preferable to other methods, such as assigning a null string to the buffer, or using SET_LENGTH_STRING. The CLEAR_BUFFER keyword actually compiles into smaller code and executes faster than the other methods, plus it is clearer to the reader as to what the programmer is trying to accomplish.
Glossary
Analog
An input or output that can have many values.
A single variable that has more than one storage location.
A coding scheme that assigns numeric values to letters, numbers, and other characters.
Warning
A statement by the compiler urging caution with a potentially hazardous statement in the source code.
Wildcard character
Allows any character to be in its place; in AXCESS programs, this is the question mark (?). This is only valid when comparing dates and times.

Port type FTP SSH Description The Master has a built-in FTP server that conforms to RFC959. Standard Port # 21/20 (TCP)
The SSH port functions using the same interface as Telnet but over a 22 (TCP) secure shell where it uses SSL as a mechanism to configure and diagnose a NetLinx system. This port value is used for secure Telnet communication. Note: SSH version 2 is only supported.
Telnet
The NetLinx Telnet server provides a mechanism to configure and diagnose a NetLinx system. For maximum flexibility, the Master can be configured to utilize a different port than 23, or disable Telnet completely from either Telnet or the Program Port located on the rear of the Master itself. Once disabled, the only way to enable Telnet again is from the Masters Program port.
23 (TCP)
The Master has a built-in web server that complies with the HTTP 1.0 specification and supports all of the required features of HTTP v1.1. This port is used for unsecure HTTP Internet communication between the web browsers UI and the target Master.
80 (TCP)
HTTPS/SSL
This port is used by a web browser to securely communicate between the web server UI and the target Master. This port is also used to simultaneously encrypt this data using the SSL certificate information on the Master as a key.
443 (TCP)
Ethernet Ports Used by the NetLinx Integrated Controllers (Cont.)
Port type ICSP Description Standard Port # Peer-to-peer protocol used for both Master-to-Master and Master-to-device 1319 (UDP/TCP) communications. For maximum flexibility, the Master can be configured to utilize a different port than 1319, or disable ICSP over Ethernet completely from either Telnet or the Program Port located on the rear of the Master itself. This type of communication is used by the various AMX product for communication amongst themselves. integration! Solutions This feature on the Master uses, by default, port 10500 for the XML based communication protocol. This port is connected to by the client web browsers JVM when integration! Solutions control pages are retrieved from the on-board Masters web server. For maximum flexibility, the on-board Master can be configured to utilize a different port than 10500 or to disable integration! Solutions completely. 10500 (TCP)
6. Insert the upgrade card into the connector opening with the arrow facing towards the pins, then push it in firmly until the contact pins are completely inside the flash card and securely attached to the connector (FIG. 22).
Under-side groove located below Card Removal Grooves
Insert with arrow facing towards the connector pins
FIG. 22 Removing the Compact Flash card
7. To complete the upgrade process, close and re-secure the Integrated Controller enclosure using the procedures outlined in the following section.
Any new internal card upgrade is detected by the Controller only after power is cycled.
Closing and Securing the Integrated Controller Once the card has been replaced, close and re-secure the outer housing: 1. Align the cover over the unit and gently slide-down the cover until the chassis housing openings are aligned over their respective openings along both the sides and top of the unit. 2. Begin pushing-down the housing until the cover is securely positioned over circuit board. 3. Insert the chassis housing screws into their respective locations, as shown in FIG. 21. 4. Securely tighten these screws by using a grounded screwdriver turning in a clockwise direction. 5. Re-install all connectors and apply power.
Installing the Integrated Controller into an Equipment Rack
Use either the rack-mounting brackets (supplied with the NI-4000/3000/2000 controller) for equipment rack installations. Remove the mounting brackets for flat surface installations.
Before completing the install process, it is recommended that you complete any firmware upgrade of the NetLinx Control Cards. This upgrade involves physically cycling power to the unit and can become cumbersome if the unit is already installed into a rack. Refer to the Upgrading the NXC Card Firmware via IP (NI-4000 ONLY) section on page 57 for more detailed information.
1. Discharge the static electricity from your body by touching a grounded object. 2. Position and install the mounting brackets, as shown in FIG. 23, using the screws supplied with the unit. The mounting brackets can be rotated to accommodate your mounting needs.
Install screws
Bracket
Rack Mounting Holes FIG. 23 Mounting Integrated Controller into an equipment rack
3. Thread the necessary cables (from their terminal locations) through the opening in the equipment rack. Allow for enough slack in the cables to accommodate for movement during the installation process. 4. Connect any corresponding DB9, CAT5, and mini-Phoenix connectors to their appropriate locations on the rear of the Integrated Controller. Refer to the Connections and Wiring section on page 19 for more detailed wiring and connection information. Verify that the terminal end of the power cable is not connected to the a power supply before plugging in the 2-pin power connector. 5. Test the incoming wiring by connecting the Controller connectors to their terminal locations and applying power. Verify that the unit is receiving power and functioning properly to prevent repetition of the installation. 6. Disconnect the terminal end of the power cable from the connected power supply.
5. If the on-board Master firmware being used is not current, download the latest KIT file by first logging in to www.amx.com and then navigate to Tech Center > Firmware Files and from within the NetLinx section of the web page locate your NI Master and click on the desired KIT file link. 6. After youve accepted the Licensing Agreement, verify you have downloaded the correct NI Master firmware (KIT) file to a known location. 7. From within Studio, select Tools > Firmware Transfers > Send to NetLinx Device from the Main menu to open the Send to NetLinx Device dialog (FIG. 32). Verify the targets System number matches the value listed within the active System folder in the OnLine Tree tab of the Workspace. The Device number is always 0 for the NI Master.
Selected on-board Master firmware file Description field for selected KIT file
Firmware download status
Device and System Number must match the Device and System values listed in the Workspace window FIG. 32 Send to NetLinx Device dialog (showing on-board NI_Master firmware update via IP)
8. Select the NI Masters KIT file from the Files section (FIG. 32).
The KIT file for the NI-4000/3000/2000 Series of NI Masters begins with 2105_NI-X000_Master. The KIT file for the NI-700/900 Series of NI Masters begins with 2105-03_NI-X000_Master. DO NOT use the 2105-03_NI_Master KIT file on anything other than an NI-700/900 since each Master KIT file is specifically configured to function on a specific NI unit.
9. Enter the System number associated with the target Master (listed in the OnLine Tree tab of the Workspace window) and verify the Device number value. The Port field is greyed-out. The Device number is always 0 for the NI Master. 10. Click the Reboot Device checkbox to reboot the NI unit after the firmware update process is complete. 11. Click Send to begin the transfer. The file transfer progress is indicated on the bottom-right of the dialog (FIG. 32).
Only upon the initial installation of a new KIT file to an on-board Master will there be a error message displayed indicating a failure of the last component to successfully download. This is part of the NI Master update procedure and requires that the firmware be reloaded after a reboot of the unit. This consecutive process installs the final component of the new KIT file.
12. After the last components fails to install, click Done. 13. Click Reboot (from the Tools > Reboot the Master Controller dialog) and wait for the System Master to reboot. The STATUS and OUTPUT LEDs should begin to alternately blink during the incorporation. Wait until the STATUS LED is the only LED to blink. 14. Press Done once until the Master Reboot Status field reads *Reboot of System Complete*. 15. Repeat steps 5 - 9 again (the last component will now successfully be installed). 16. Click Close once the download process is complete.
Browser Application Frames
A web page (FIG. 37) can be divided into separate sections or frames, each of which can be independent of one another and display their own information. Located on the left side of the populated Browser window is the Navigation frame which allows a user to navigate throughout the application. Located on the right side of the Browser window is the Active frame which displays the pages corresponding to the currently selected option from within the Navigation frame.
Navigation frame
Active frame
FIG. 37 Browser Application frames
The first Active frame displayed within the Browser is the Manage WebControl Connections page.
Default Security Configuration
Security for web pages is separated into two access groups: HTTP and Configuration: HTTP Access allows an authorized user to view these web pages by first requiring the entry of a user name and password at the beginning of every connection session with the target Master. If Master Security is not enabled, the user name and password fields are not displayed and the Master is openly accessible. The Master Security configuration prevents users from altering any security or operational parameters. Unless this option is enabled, all subordinate options are inaccessible and greyed-out. Configuration access is initially greyed-out until the Master Security option is enabled. This feature requires an authorized user provide a valid user name and password before being granted access to change configuration and communication parameters on the target Master. Only with this type of access can a user begin to alter security or operational parameters such as access rights, Port assignments, System values, and SSL certificate usage. If a user is not currently logged-into the Master (via the initial Login screen) and they attempt to access a feature wherein authentication is required, they are prompted with a message to log into the Master (via the Log In button) (FIG. 38). After the users information and rights are confirmed, the login process is successfully completed and the button changes state and displays Log Out. A user must be logged into the system before their associated rights can be activated for the current session.
User name field Password field Log In/Log Out button
FIG. 38 Log In/Log Out fields
Authentication is based upon matching the users data to pre-configured user name and password information, and then assigning the rights assigned to that user. The maximum length of a user name or password is 20 characters. The minimum length of a user name or password is four characters. Characters such as # (pound) & (ampersand) and " (single and double quotes) are invalid and should not be used in user names, group names, or passwords.
The Control/Emulate and Diagnostics buttons are common to all menus. These fields are populated depending on the items selected from the Online Tree (left frame). An example is: if you navigate down to a specific channel on a device, the Control/Emulate page then populates the D:P:S and Channel Code fields.
1. Click the Manage System link (from within the System Settings section of the Navigation frame).
2. Clicking on any of the Online Tree items opens menu items with the Control/Emulate button option available. 3. Click the Control/Emulate button to open the Control/Emulate dialog (FIG. 52). 4. Click the Update Status button to query the Master for the status of the currently entered level and channel.
The System Number, Device Number, and Port Number value fields are read-only (disabled) if you are brought to this window from a selection of an Online Tree item. By default these fields are otherwise editable.
5. Select either the Control or Emulate option.
FIG. 52 Control/Emulate dialog
To Control a device means that the program generates messages which appear to a specified device to have come from the Master. The options in this frame allow you to specify the <D:P:S> combination for the device you want to control. To Emulate a device means that the program generates messages which appear to the Master to have come from a specified <D:P:S> combination (real or fictitious). The options in this frame allow you to specify the <D:P:S> combination for the device you want to emulate. Selecting this option adds a Push button with the Channel Code section of this page.
6. Enter a System Number, Device Number, and Port Number into the appropriate fields. These values correspond to the device you wish to control (real or fictitious). The Device, Port, and System value ranges are 1 - 65535. 7. Within the Channel Code section, enter a valid Channel number to emulate Channel messages (i.e., Push/Release, CHON, and CHOFF) for the specified <D:P:S>. The Channel number range is 1 - 65535. 8. Select the On or Off buttons to Emulate Channel ON (CHON) and Channel OFF (CHOFF) messages for the specified <D:P:S>. 9. Select the Push button to Emulate a push/release on the channel specified. You can click and hold down the Push button to see how the device/Master responds to the push message. 10. Within the Level Code section, enter a valid Level number and Level data value for the specified <D:P:S> and press the Send button to transmit this data. The Level number range is 1 - 65535. The list below contains the valid Level data types and their ranges: Valid Level Data Types and Ranges
Minimum Value CHAR INTEGER SINTEGER LONG SLONG FLOAT --2147483648 -3.402823466e+38 Maximum Value 2147483647 3.402823466e+38
3. Enter the used Domain Name into the Common Name field. Example: If the address being used is www.amxuser.com, that must be the Common name and format used in the Common Name field. This string provides a unique name for the desired user. This domain name must be associated to a resolvable URL Address when creating a request for a purchased certificate. The address does not need to be resolvable when obtaining a free certificate. 4. Enter the name of the business or organization into the Organization Name field. This is an alpha-numeric string (1 - 50 characters in length). 5. Enter the name of the department using the certificate into the Organizational Unit field. This is an alpha-numeric string (1 - 50 characters in length). 6. Enter the name of the city where the certificate resides into the City/Location field. This is an alpha-numeric string (1 - 50 characters in length). 7. Enter the name of the state or province where the certificate resides into the State/Province field. This is an alpha-numeric string (1 - 50 characters in length). The state/province name must be fully spelled out. 8. Click the down arrow from the Country Name field to open a drop-down listing of listing of currently selectable countries. 9. Click the down arrow from the Action field to open a drop-down listing of available certificate generation options. 10. Choose Create Request from the drop-down list. 11. Click the Update button to accept the information entered into the above fields and generate a certificate file. Refer to the Server - Exporting an SSL Certificate Request section on page 101. This refreshed the Server Certificate page and if the certificate request was successful, displays a "Certified request generated" message. 12. Follow the exporting and importing an SSL certificate procedures outlined within the following section.
Common Steps for Requesting a Certificate from a CA
Once the request has begun, a user has the choice to either remain using their self-generated SSL certificate or obtain a CA created certificate by exporting their request for the certificate and then, once received, import the returned certificate information onto the Master. Communicating with the CA A certificate is a cryptographically signed object that associates a public key and an identity. Certificates also include other information in extensions such as permissions and comments. A "CA" is short for Certification Authority and is an internal entity or trusted third party that issues, signs, revokes, and manages these digital certificates.
Module Properties (displayed via a mouse-over popup dialog)
FIG. 76 Select Device Module page
Mousing-over a listed module entry presents a popup which displays the properties associated with the selected module. By selecting the module and clicking the Save button, the administrator can assign a Duet module to be associated with the physical device.
This action will NOT affect any currently running Duet module associated with the physical device and will only be picked up upon the next system reboot.
Clicking the Cancel button aborts the association of a Duet module with the physical device BUT it does not undo the process of pulling new modules from the Internet/device into the /unbound directory on the target Master. These modules will remain resident in the /unbound directory until they are manually deleted via the Manage Other Devices main web page. Refer to the System Settings - Manage Other Devices - Dynamic Device Discovery Pages section on page 114. Manage Other Devices Menu - Creating a new User-Defined Device This page provides the ability to both add and remove any user-defined devices. Existing user-defined devices are listed at the bottom of the display along with a corresponding Remove button alongside each new entry. Although FIG. 77 shows a populated page, by default, all fields are blank and no devices are pre-populated. 1. Click on the Create User Defined Device button (from within the Manage Other Device page). 2. Begin by entering the address of the physical device within the Address field. This information can be either the NetLinx Master port value (D:P:S) or an IP Address (#.#.#.#). 3. From within the Device Type field, use the drop-down list to select the control method associated with the physical target device (IR, IP, Serial, Relay, Other). 4. From within the SDK-Class field, use the drop-down list to select closest Device SDK class type match for the physical target device. The following table provides a listing of the available choices.
List of discovered physical devices (manually entered info)
FIG. 77 Add New Device page
SDK-Class Types
AudioConferencer AudioMixer AudioProcessor AudioTape AudioTunerDevice Camera DigitalMediaEncoder* DigitalMediaDecoder* DigitalMediaServer* DigitalSatelliteSystem DigitalVideoRecorder DiscDevice DocumentCamera HVAC Keypad Light Monitor Motor MultiWindow PoolSpa PreAmpSurroundSoundProcessor Receiver Security System Sensor Device SettopBox SlideProjector Switcher TextKeypad TV Utility VCR VideoConferencer VideoProcessor VideoProjector VideoWall* VolumeController Weather * indicates that these features will be supported within the version 1.6 release of Caf Duet.
4) Edit user
5) Delete user 6) Show the list of authorized users 7) Add group
8) Edit group
9) Delete group
10) Show list of authorized groups 11) Set Telnet Timeout in seconds
12) Display Telnet Timeout in seconds
Main Security Menu (Cont.)
Command Description 13) Make changes permanent by saving to When changes are made to the security settings of the flash master, they are initially only changed in RAM and are not automatically saved permanently into flash. This selection saved the current security settings into flash. Also, if you attempt to exit the Main Security Menu and the security settings have changed but not made permanent, you will be prompted to save the settings at that time. 14) Reset Database (administrator only function) These functions are only visible to administrators. If a user has been given "administrator rights", this additional menu option is displayed. This selection will reset the security database to its Default Security Configuration settings, erasing all users and groups that were added. This is a permanent change and you will be asked to verify this before the database is reset. These functions are only visible to administrators. If a user has been given "administrator rights", this additional menu option is displayed. This selection will display the current security settings to the terminal (excluding user passwords). It also displays all users (minus passwords), their group assignment (if any) and their rights, as well as all groups and their rights.
15) Display Database (administrator only function)
By default, the NetLinx Master will create the following accounts, access rights, directory associations, and security options.
Account 1: Password: Group: Rights: User Name: administrator password administrator All
Directory Association: /* Account 2: Password: Group: Rights: User Name: NetLinx password none FTP Access
Directory Association: none Group 1: Rights: Group: administrator All
Directory Association: /* Security Options: FTP Security Enabled Admin Change Password Security Enabled All other options disabled
The administrator user account cannot be deleted or modified with the exception of its password. Only a user with "Change Admin Password Access" rights can change the administrator password. The NetLinx user account is created to be compatible with previous NetLinx Master firmware versions. The administrator group account cannot be deleted or modified.
>setup security You are not authorized to access security commands
If a user is authorized, or if Configuration Security is not enabled, the Main Security Menu will be displayed.
Programming
This section describes the Send_Commands, Send_Strings, and Channel commands you can use to program the Integrated Controller. The examples in this section require a declaration in the DEFINE_DEVICE section of your program to work correctly. Refer to the NetLinx Programming Language instruction manual for specifics about declarations and DEFINE_DEVICE information.
Converting Axcess Code to NetLinx Code
In order to compile your existing Axcess code to NetLinx code, minor modifications will be required. These modifications include identifier names that conflict with NetLinx identifiers, warning on variable type conversions, and stricter syntax rules. For more information on NetLinx standards and conversion recommendations, go to www.amx.com and click on Dealers > Tech Center > Tech Notes. You can either search for the documents (such as NetLinx Programming Standards and Converting Axcess Code to NetLinx Code) or Tech Notes (TN numbers: 186, 249, 261, and 310). Refer to the NetLinx Programming Instruction Manual for more detailed information on the differences between the two codes and how they can be re-written. The section is called Converting Axcess Code to NetLinx Code.
Master Send_Commands
These commands are specific to the Master and not the Controller. These commands are sent to the DPS 0:1:0 (the Master). A device must first be defined in the NetLinx programming language with values for the Device: Port: System. In these programming examples, <DEV> = Device. The term <D:P:S> = Device:Port:System. Master Send_Commands
Command CLOCK Set the date and time on the Master. Description The date and time settings are propagated over the local bus. Syntax:
SEND_COMMAND <DEV>,"'CLOCK <mm-dd-yy> <hh:mm:ss>'"
Variables: mm-dd-yy = Month, day, and year. Each given using only 2 significant digits. mm-dd-yy = Hour, minute, and seconds. Each given using only 2 significant digits. Example:
SEND_COMMAND 0,"'CLOCK 04-12-05 09:45:31'"
Sets the Master's date to April 12th 2005 with a time of 9:45 am.
Master Send_Commands (Cont.)
Command G4WC Add G4 Web Control devices to Web control list displayed by the Web server in a browser Description The internal G4WC Send command (to Master 0:1:0) has been revised to add G4 WebControl devices to Web control list displayed in the browser. Syntax:
SEND_COMMAND <D:P:S>,"'G4WC "Name/Description",IP Address/URL,IP Port,Enabled'"
Variables: Name/Description = A string, enclosed in double quotes, that is the description of the G4 Web Control instance. It is displayed in the browser. IP Address/URL = A string containing the IP Address of the G4 Web Control server, or a URL to the G4 Web Control server. IP Port = A string containing the IP Port of the G4 Web Control Server. Enabled = 1 or 0. If it is a 1 then the link is displayed. If it is a 0 then the link is disabled. The combination of Name/Description, IP Address/URL, and IP Port are used to determine each unique listing. Example:
Only the Device number can be changed on the Controllers using the ID button. Port and System can not be defined.
Device:Port:System (D:P:S) A device is any hardware component that can be connected to an AXlink or ICSNet bus. Each device must be assigned a unique number to locate that device on the bus. The NetLinx programming language allows numbers in the range 1-32,767 for ICSNet (255 for AXlink). NetLinx requires a Device:Port:System (D:P:S) specification. This D:P:S triplet can be expressed as a series of constants, variables separated by colons, or a DEV structure. For example:
The D:P:S notation is used to explicitly represent a device number, port and system. For example, 128:1:0 represents the first port on device 128 on this system. If the system and Port specifications are omitted, (e.g. 128), system 0 (indicating this system) and port 1 (the first port) is assumed. Here's the syntax:
Program Port Commands
The Program port commands listed in the following table can be sent directly to the Master Card using a terminal program (i.e. Telnet). Be sure that your PC's COM port and terminal program's communication settings match those in the table below: PC COM Port Communication Settings
Baud Parity Data Bits Stop Bits Flow Control 38400 (default) None None
Each of the NetLinx Integrated Controllers has specific port assignments: Port Assignments (NI-4000 & NI-3000)
Serial Relays IR I/Os Count Ports 1 - 7 Port 8 Ports 9 -16 Port relays and 8 I/O's
Port Assignments (NI-2000)
Serial Relays IR I/Os Count Ports 1 - 3 Port 4 Ports 5 -8 Port relays and 4 I/O's
In your terminal program, type "Help" or a question mark ("?") and <Enter> to display the Program port commands listed in the following table. Program Port Commands
Command Description Displays the current date and day of the week. Example:
>DATE 10/31/2004 Wed
DEVICE HOLDOFF ON|OFF
Sets the Master to holdoff devices and not allow them to report online until the NetLinx program has completed executing the DEFINE_START section. Example:
>Device Holdoff ON Device Holdoff Set.
This command sets the state of the device holdoff. The GET DEVICE HOLDOFF command reveals whether the state is On or Off.
SEND_COMMAND RS232_1,"'CHARD-10'"
Sets a 1-millisecond delay between all transmitted characters.
RS-232/422/485 Send_Commands (Cont.)
Command CHARDM Description Syntax:
Set the delay time between SEND_COMMAND <DEV>,"'CHARDM-<time>'" all transmitted characters to Variable: the value specified time = 0 - 255. Measured in 1 millisecond increments. (in 1 Millisecond increments). Example:
SEND_COMMAND RS232_1,"'CHARDM-10'"
Sets a 10-millisecond delay between all transmitted characters. CTSPSH Enable Pushes, Releases, and status information to be reported via channel 255 using the CTS hardware handshake input. This command turns On (enables) channel tracking of the handshaking pins. If Clear To Send (CTS) is set high, then channel 255 is On. Syntax:
SEND_COMMAND <DEV>,"'CTSPSH'"
SEND_COMMAND RS232_1,"'CTSPSH'"
Sets the RS232_1 port to detect changes on the CTS input. CTSPSH OFF Disable Pushes, Releases, and Status information to be reported via channel 255. This command disables tracking. Turns CTSPSH Off. Syntax:
SEND_COMMAND <DEV>,"'CTSPSH OFF'"
SEND_COMMAND RS232_1,"'CTSPSH OFF'"
Turns off CTSPSH for the specified device. GET BAUD Get the RS-232/422/485 ports current communication parameters. The port sends the parameters to the device that requested the information. The port responds with: <port #>,<baud>,<parity>,<data>,<stop> 485 <ENABLED | DISABLED> Syntax:
SEND_COMMAND <DEV>,"'GET BAUD'"
SEND_COMMAND RS232_1,"'GET BAUD'"
System response example:
Device 1, 38400,N,8,DISABLED
HSOFF Disable hardware handshaking (default). Syntax:
SEND_COMMAND <DEV>,"'HSOFF'"
SEND_COMMAND RS232_1,"'HSOFF'"
Disables hardware handshaking on the RS232_1 device. HSON Enable RTS (ready-to-send) and CTS (clear-to-send) hardware handshaking. Syntax:
SEND_COMMAND <DEV>,"'HSON'"
SEND_COMMAND RS232_1,"'HSON'"
Enables hardware handshaking on the RS232_1 device. RXCLR Clear all characters in the receive buffer waiting to be sent to the Master. Syntax:
SEND_COMMAND <DEV>,"'RXCLR'"
SEND_COMMAND RS232_1,"'RXCLR'"
Clears all characters in the RS232_1 device's receive buffer waiting to be sent to the Master card.
Command RXOFF Disable the transmission of incoming received characters to the Master (default). Description Syntax:
SEND_COMMAND <DEV>,"'RXOFF'"
SEND_COMMAND RS232_1,"'RXOFF'"
Stops the RS232_1 device from transmitting received characters to the Master card.
RXON Start transmitting received characters to the Master (default).
Enables sending incoming received characters to the Master. This command is automatically sent by the Master when a 'CREATE_BUFFER' program instruction is executed. Syntax:
SEND_COMMAND <DEV>,"'RXON'"
SEND_COMMAND RS232_1,"'RXON'"
Sets the RS232_1 device to transmit received characters to the Master card. SET BAUD Set the RS-232/422/485 port's communication parameters. Syntax:
SEND_COMMAND <DEV>,"'SET BAUD <baud>,<parity>,<data>,<stop> Disable>]'"
Variables:
[485 <Enable |
baud = baud rates are: 115200, 76800, 57600, 38400, 19200, 9600, 4800, 2400, 1200, 600, 300, 150. parity = N (none), O (odd), E (even), M (mark), S (space). data = 7 or 8 data bits. stop = 1 and 2 stop bits. 485 Disable = Disables RS-485 mode and enables RS-422. 485 Enable = Enables RS-485 mode and disables RS-422. Note: The only valid 9 bit combination is (baud),N,9,1. Example:
SEND_COMMAND RS232_1,"'SET BAUD 115200,N,8,ENABLE'"
Sets the RS232_1 port's communication parameters to 115,200 baud, no parity, 8 data bits, 1 stop bit, and enables RS-485 mode.
Command TSET BAUD Temporarily set the RS-232/ 422/485 port's communication parameters for a device. Description TSET BAUD works the same as SET BAUD, except that the changes are not permanent, and the previous values will be restored if the power is cycled on the device. Syntax:
SEND_COMMAND <DEV>,"'TSET BAUD <baud>,<parity>,<data>,<stop> [485 <Enable | Disable>]'"
Variables: baud = baud rates are: 115200, 57600, 38400, 19200, 9600, 4800, 2400, 1200, 600, 300. parity = N (none), O (odd), E (even), M (mark), S (space). data = 7, 8, or 9 data bits. stop = 1 or 2 stop bits. 485 Disable = Disables RS-485 mode and enables RS-422. 485 Enable = Enables RS-485 mode and disables RS-422. Note: The only valid 9 bit combination is (baud),N,9,1. Example:
SEND_COMMAND RS232_1,"'TSET BAUD 115200,N,8,ENABLE'"
Sets the RS232_1 port's communication parameters to 115,200 baud, no parity, 8 data bits, 1 stop bit, and enables RS-485 mode. TXCLR Stop and clear all characters waiting in the transmit out buffer and stops transmission. XOFF Disable software handshaking (default). Syntax:
SEND_COMMAND <DEV>,"'TXCLR'"
SEND_COMMAND RS232_1,"'TXCLR'"
Clears and stops all characters waiting in the RS232_1 device's transmit buffer. Syntax:
SEND_COMMAND <DEV>,"'XOFF'"
SEND_COMMAND RS232_1,"'XOFF'"
Disables software handshaking on the RS232_1 device. XON Enable software handshaking. Syntax:
SEND_COMMAND <DEV>,"'XON'"
SEND_COMMAND RS232_1,"'XON'"
Enables software handshaking on the RS232_1 device.
RS-232/422/485 Send_String Escape Sequences
This device also has some special SEND_STRING escape sequences: If any of the 3 character combinations below are found anywhere within a SEND_STRING program instruction, they will be treated as a command and not the literal characters. In these examples: <DEV> = device. RS-232/422/485 Send_String Escape Sequences
SEND_COMMAND <DEV>,"'POF'"
SEND_COMMAND IR_1,"'POF'"
Sends power down IR commands 28 (if present) or 9 to the IR_1 device.
Command PON Turn ON a device connected to an IR port based on the status of the corresponding I/O Link input. Description If at any time the IR sensor input reads that the device is OFF (such as if one turned it off manually at the front panel), IR function 27 (if available) or IR function 9 is automatically generated in an attempt to turn the device back ON. If three attempts fail, the IR port will continue executing commands in the buffer and trying to turn the device On. If there are no commands in the buffer, the IR port will continue trying to turn the device ON until a 'POF' or 'POD' command is received. If the IR port fails to turn the device ON, a PUSH and RELEASE is made on channel 254 to indicate a power failure error. You can only use the 'PON' and 'POF' commands when an IR device has a linked I/O channel. Channel 255 changes are disabled after receipt of this command. Syntax:
SEND_COMMAND <DEV>,"'PON'"
SEND_COMMAND IR_1,"'PON'"
Sends power up IR commands 27 or 9 to the IR_1 port. PTOF Set the time duration between power pulses in.10-second increments. This time increment is stored in permanent memory. This command also sets the delay between pulses generated by the 'PON' or 'POF' send commands in tenths of seconds. It also sets the delay required after a power ON command before a new IR function can be generated. This gives the device time to power up and get ready for future IR commands. Syntax:
SEND_COMMAND <DEV>,"'PTOF',<time>"
Variable: time = 0 - 255. Given in 1/10ths of a second. Default is 15 (1.5 seconds). Example:
SEND_COMMAND IR_1,"'PTOF',15"
Sets the time between power pulses to 1.5 seconds for the IR_1 device. PTON Set the time duration between power pulses in.10-second increments This time increment is stored in permanent memory. This command also sets the pulse length for each pulse generated by the 'PON' or 'POF' send commands in tenths of seconds. Syntax:
SEND_COMMAND <DEV>,"'PTON',<time>"
SEND_COMMAND IR_1,"'PTON',15"
Sets the duration of the power pulse to 1.5 seconds for the IR_1 device. SET IO LINK Link an IR or Serial port to a selected I/O channel for use with the 'DE', 'POD', 'PON', and 'POF' commands. The I/O status is automatically reported on channel 255 on the IR port. The I/O channel is used for power sensing (via a PCS or VSS). A channel of zero disables the I/O link. Syntax:
SEND_COMMAND <DEV>,"'SET IO LINK <I/O number>'"
Variable: I/O number = 1 - 8. Setting the I/O channel to 0 disables the I/O link. Example:
SEND_COMMAND IR_1,"'SET IO LINK 1'"
Tags
NV-FJ630 XR-C5100R MM300 KDL-40EX711 NN-E251W XM-280GTX HHB-700 Zorki 4K FRX 456 BR-NX10A SP1614N CD2401S Fatal1TY Tiller AC450W P4500-P3200-p1600 Seiko 7T84 SUB 201A IS-20 QD NX9500 Maxxum Xtsi Royal Booster LG 200 Audio 350 VGN-UX180P P4 533A S530D S09AHP S40 Cafamosacf81 WF419AAW XAA SE233 Plus 70 TLS582C Ameriphone VCO NWA-3160 NV-G202 EW543F TX-P37x10E FOR AAA 21S-FX10U MYX2-2 STR-DE895B KLV-46W300A Zapbox Easy SRT 6004 E1280 VDR-D310EG 6 XL TH-37PX70E TC-301 VL-Z7U QCE531K Breville BP02 UE32C4000PW Adventure Autopilot KCA-IP500 P990I M1020 NV-GX7B CCG432W Cabrio 290 EB-X8 HT-TX75T VR2115 PX-tuan-01 NV-GS24EG Magicolor 5450 32PW9767 12 Polar FT40 T8611 KX 85 Dvdr3305 WFE0866A CDP-C515 Explorer-2000 Antenna 72 TOP Spin HF M32 Ultima TSR12 CVA-1006R Powerbank H500 LS55-1E2Z Scanner Vixia HG20 DG 6145 Desktop 4 IN24-EP Review CMD-J5 NP-R40 Plus Numark VJ01 RM4200S KDL-26S3000 UA-30 Pvr DVD Exchange IC-38A M30AH
manuel d'instructions, Guide de l'utilisateur | Manual de instrucciones, Instrucciones de uso | Bedienungsanleitung, Bedienungsanleitung | Manual de Instruções, guia do usuário | инструкция | návod na použitie, Užívateľská príručka, návod k použití | bruksanvisningen | instrukcja, podręcznik użytkownika | kullanım kılavuzu, Kullanım | kézikönyv, használati útmutató | manuale di istruzioni, istruzioni d'uso | handleiding, gebruikershandleiding
Sitemap
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101











