-
-
Notifications
You must be signed in to change notification settings - Fork 85
/
netlinx.scroll
188 lines (154 loc) · 6.14 KB
/
netlinx.scroll
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
import ../code/conceptPage.scroll
id netlinx
name NetLinx
appeared 2007
tags pl
fileExtensions axserb axierb
fileType text
centralPackageRepositoryCount 0
country United States
originCommunity AMX, LLC
reference https://www.amx.com/en/site_elements/language-reference-guide-netlinx-programming-language
lineCommentToken //
multiLineCommentTokens (* *)
hasLineComments true
// A comment
hasComments true
// A comment
hasMultiLineComments true
(* A comment
*)
hasSemanticIndentation false
wikipedia https://en.wikipedia.org/wiki/NetLinx
related c ascii
summary NetLinx is both a range of controllers manufactured by AMX and the name of the proprietary programming language (loosely based on C) used to program the devices. The NetLinx controllers are rack mountable devices which run a version of VxWorks and integrate both a processor and device controllers and are typically utilized for audio-visual control systems. An example is the mid-range NetLinx Integrated NI-2100 controller which has 3 RS-232/RS-485 serial ports, 4 relays, 4 infrared/serial ports and 4 input/outputs. Serial ports can send and receive strings, typically ASCII instructions and replies. Relays permit switching of modest currents. IR ports can send infrared signals which emulate typical remote control devices that control (for instance) televisions and video recorders. Input/output ports detect contact closures. AMX supplies an IDE known as NetLinx Studio which allows a proprietary language to be edited, compiled and sent to the NetLinx controller. NetLinx also contains an interface which allows it to utilize Java based modules. Earlier models of AMX controller were named Axcent.
created 2007
backlinksCount 2
pageId 9870556
revisionCount 20
dailyPageViews 14
appeared 2007
githubBigQuery NetLinx
repos 25
users 21
linguistGrammarRepo https://github.com/amclain/sublime-netlinx
firstCommit 2013
lastCommit 2018
committerCount 2
commitCount 115
sampleCount 2
example
(***********************************************************
Mock Projector
For testing syntax highlighting
************************************************************)
#if_not_defined MOCK_PROJECTOR
#define MOCK_PROJECTOR 1
(***********************************************************)
(* System Type : NetLinx *)
(***********************************************************)
(* DEVICE NUMBER DEFINITIONS GO BELOW *)
(***********************************************************)
DEFINE_DEVICE
dvPROJECTOR = 5001:1:0;
(***********************************************************)
(* CONSTANT DEFINITIONS GO BELOW *)
(***********************************************************)
DEFINE_CONSTANT
// Power States
POWER_STATE_ON = 0;
POWER_STATE_OFF = 1;
POWER_STATE_WARMING = 2;
POWER_STATE_COOLING = 3;
// Inputs
INPUT_HDMI = 0;
INPUT_VGA = 1;
INPUT_COMPOSITE = 2;
INPUT_SVIDEO = 3;
(***********************************************************)
(* INCLUDES GO BELOW *)
(***********************************************************)
#include 'amx-lib-log'
(***********************************************************)
(* DATA TYPE DEFINITIONS GO BELOW *)
(***********************************************************)
DEFINE_TYPE
struct projector_t
{
integer power_state;
integer input;
integer lamp_hours;
}
(***********************************************************)
(* VARIABLE DEFINITIONS GO BELOW *)
(***********************************************************)
DEFINE_VARIABLE
volatile projector_t proj_1;
(***********************************************************)
(* SUBROUTINE/FUNCTION DEFINITIONS GO BELOW *)
(***********************************************************)
define_function initialize(projector_t self)
{
self.power_state = POWER_STATE_OFF;
self.input = INPUT_HDMI;
self.lamp_hours = 0;
}
define_function switch_input(projector_t self, integer input)
{
self.input = input;
print(LOG_LEVEL_INFO, "'Projector set to input: ', itoa(input)");
}
(***********************************************************)
(* STARTUP CODE GOES BELOW *)
(***********************************************************)
DEFINE_START
initialize(proj_1);
(***********************************************************)
(* THE EVENTS GO BELOW *)
(***********************************************************)
DEFINE_EVENT
data_event[dvPROJECTOR]
{
string:
{
parse_message(data.text);
}
command: {}
online: {}
offline: {}
}
button_event[dvTP, BTN_HDMI]
button_event[dvTP, BTN_VGA]
button_event[dvTP, BTN_COMPOSITE]
button_event[dvTP, BTN_SVIDEO]
{
push:
{
switch (button.input.channel)
{
case BTN_HDMI: switch_input(proj_1, INPUT_HDMI);
case BTN_VGA: switch_input(proj_1, INPUT_VGA);
case BTN_COMPOSITE: switch_input(proj_1, INPUT_COMPOSITE);
case BTN_SVIDEO: switch_input(proj_1, INPUT_SVIDEO);
}
}
release: {}
}
(***********************************************************)
(* THE MAINLINE GOES BELOW *)
(***********************************************************)
DEFINE_PROGRAM
[dvTP, BTN_POWER_ON] = (proj_1.power_state == POWER_STATE_ON);
[dvTP, BTN_POWER_OFF] = (proj_1.power_state == POWER_STATE_OFF);
(***********************************************************)
(* END OF PROGRAM *)
(* DO NOT PUT ANY CODE BELOW THIS COMMENT *)
(***********************************************************)
#end_if
githubLanguage NetLinx
fileExtensions axs axi
trendingProjectsCount 0
type programming
aceMode text
tmScope source.netlinx
repos 122