Newer
Older
mwyman
committed
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
# process this record to reload all stream protocols
record (sub, "$(P)reload")
{
field (SNAM, "streamReload")
}
# some scaling -10...10V <-> 0x0000...0xffff and back
record (ao, "$(P)ao")
{
field (DESC, "An analog value")
field (DTYP, "stream")
field (OUT, "@example.proto set-ao $(PORT)")
field (PREC, "3")
field (LINR, "LINEAR")
field (ESLO, "0.000305180437934") # 20.0 / 0xffff
field (EOFF, "-10")
field (DRVL, "-10")
field (DRVH, "10")
field (EGU, "V")
}
record (ai, "$(P)ai")
{
field (DESC, "An analog value")
field (DTYP, "stream")
field (INP, "@example.proto ai $(PORT)")
field (PREC, "3")
field (LINR, "LINEAR")
field (ESLO, "0.000305180437934") # 20.0 / 0xffff
field (EOFF, "-10")
field (EGU, "V")
}
# simple integer and binary i/o
record (longout, "$(P)lo")
{
field (DESC, "An integer value")
field (DTYP, "stream")
field (OUT, "@example.proto lo $(PORT)")
}
record (longin, "$(P)li")
{
field (DESC, "An integer value")
field (DTYP, "stream")
field (INP, "@example.proto li $(PORT)")
}
record (bo, "$(P)bo")
{
field (DESC, "A bit value")
field (DTYP, "stream")
field (OUT, "@example.proto bo $(PORT)")
field (MASK, "42")
field (ZNAM, "OFF")
field (ONAM, "ON")
}
record (bi, "$(P)bi")
{
field (DESC, "A bit value")
field (DTYP, "stream")
field (INP, "@example.proto bi $(PORT)")
field (ZNAM, "OFF")
field (ONAM, "ON")
}
# playing with enums
record (mbbo, "$(P)mbbo")
{
field (DESC, "Print Enums")
field (DTYP, "stream")
field (OUT, "@example.proto enums $(PORT)")
field (ZRST, "A")
field (ZRVL, "2")
field (ONST, "B")
field (ONVL, "3")
field (TWST, "C")
field (TWVL, "1")
field (THST, "D")
field (THVL, "0")
}
record (stringout, "$(P)command")
{
field (DTYP, "stream")
field (OUT, "@example.proto COMMAND $(PORT)")
}
record (stringin, "$(P)info")
{
field (DTYP, "stream")
field (INP, "@example.proto info $(PORT)")
}
# prints all available checksums
record (stringout, "$(P)checksum")
{
field (DTYP, "stream")
field (OUT, "@example.proto checksum $(PORT)")
}
# this record gets any (terminated) input line
record (stringin, "$(P)spy")
{
field (DTYP, "stream")
field (INP, "@example.proto spy $(PORT)")
field (SCAN, "I/O Intr")
field (FLNK, "$(P)log5")
}
# these records log the last few input lines
record (stringin, "$(P)log5")
{
field (INP, "$(P)log4")
field (FLNK, "$(P)log4")
}
record (stringin, "$(P)log4")
{
field (INP, "$(P)log3")
field (FLNK, "$(P)log3")
}
record (stringin, "$(P)log3")
{
field (INP, "$(P)log2")
field (FLNK, "$(P)log2")
}
record (stringin, "$(P)log2")
{
field (INP, "$(P)log1")
field (FLNK, "$(P)log1")
}
record (stringin, "$(P)log1")
{
field (INP, "$(P)spy")
}
# caput to A,B,C or PROC to process this
record (calcout, "$(P)calcout")
{
field (DTYP, "stream")
field (OUT, "@example.proto calcout $(PORT)")
field (A, "3.1415")
field (B, "15")
field (C, "8")
field (CALC, "0") # should be a valid expression
field (DESC, "filename")
}
# read a long string as a waveform of characteres
record (waveform, "$(P)hugestring")
{
field (DTYP, "stream")
field (INP, "@example.proto char_wave_in $(PORT)")
field (FTVL, "CHAR")
field (NELM, "1000")
}
# write an array of strings
record (waveform, "$(P)strings")
{
field (DTYP, "stream")
field (INP, "@example.proto string_wave_out $(PORT)")
field (FTVL, "STRING")
field (NELM, "10")
}
record (scalcout, "$(P)scalcout")
{
field (DTYP, "stream")
field (OUT, "@example.proto scalcout $(PORT)")
}