Show last authors
1 {{warning}}In March 2016, the RCI was migrated to STIP. This is to allow more flexiblity within applications and readability of program text. STIP is designed primarily for autonomously modifing the value of network shared variables, but can be extended to handle other commands than described below. {{/warning}}
2 The software deployed on the cRIO-9704 controlling the atmospheric and soil gas sampling valves is designed to allow either direct user (operator) control or automated control via a text file containing instructions. The instructions are described below.
3
4 Instructions are white space delimited and separated by line (carriage return + line feed "CRLF").
5 The first word of each line is the command and must be completely uppercase in order for it to be correctly identified by the compiler.
6 Each following word is considered an argument and case is generally arbitrary.
7 Lines beginning with a number sign (#) or a white space ( ) are considered comments and will be ignored by the compiler.
8
9 {{info}}Custom instructions can be defined by the application developer{{/info}}
10 Any unhandled instruction (non pre-defined instructions) are passed out of the processor's execute function. This can be useful for creating a set of application specific instructions.
11
12
13 An example program is shown here:
14
15 {{box}}
16
17 {{code}}
18 # Create selector aliases
19 ALIAS V1 INTEGER ni.var.psp://localhost/selectors/ATMO_V1
20 ALIAS V2 INTEGER ni.var.psp://localhost/selectors/ATMO_V2
21 ALIAS V3 INTEGER ni.var.psp://localhost/selectors/ATMO_V3
22
23 # Create solenoid controls
24 ALIAS Solenoid1 BOOLEAN ni.var.io://localhost/Mod7/DO0
25 ALIAS Solenoid2 BOOLEAN ni.var.io://localhost/Mod7/DO1
26
27 # set starting state of all solenoids
28 SET Solenoid1 false
29 SET Solenoid2 false
30
31 # set position of all selector valves
32 SET V1 1
33 SET V2 1
34
35 # wait until 00 or 30 minutes past hour
36 TIME-SYNC 30
37
38 # sampling routine
39 SET V1 25
40 WAIT 5
41 RECORD LEO-G_STD-299ppm_LI-7000
42
43 SET V1 26
44 WAIT 5
45 RECORD LEO-G_STD-350ppm_LI-7000
46
47 LOAD gas-sampling-routine.txt
48
49 {{/code}}
50
51 {{/box}}
52
53 == Pre-defined Instructions ==
54 {{box}}
55 **INITIALIZE**
56 No parameters. Sends the processor into the initialization state. This state is predefined by the application and can be used to perform a software reset of the module.
57 {{/box}}
58
59 {{box}}
60 **ALIAS {name} {type} {url}**
61 Adds an alias to a shared variable (controllable element).
62 * name: The user defined name of this element (white spaces are not allowed). Examples of names are "Selector4", "Valve1", "MySelectorIsPurple". Names must be unique. If you add attempt to add two elements with the same name, only the last created will exist.
63 * type: The data type of variable. Valid types are BOOLEAN, INTEGER, DOUBLE.
64 * {path}: The shared variable's url.
65 {{/box}}
66
67 {{box}}
68 **SET {name} {value}**
69 Sets the value of a control element. For a selector, it moves a named selector to the requested position. For boolean, double, string, etc. control elements, it simply sets the value of the network variable.
70 * name: Name of the control element. This element must be configured in the list prior to use.
71 * value: Requested value of the element. This must be a valid value otherwise the operation fails (e.g. 1 - 28 for a 28 position selector, true/false/on/off for a boolean).
72 {{/box}}
73
74 {{box}}
75 **WAIT {seconds}**
76 Waits a requested number of seconds to elapse.
77 * seconds: Time in seconds to wait.
78 {{/box}}
79
80 {{box}}
81 **WAIT-UNTIL {date-time}**
82 Waits until the specified date and time.
83 {{info}}Wait-until {date-time} is more precise than wait {seconds} for long wait times.{{/info}}
84 * date-time: The date and time this instruction will wait for. The format for this time-stamp must be YYYYMMDDHHMMSS. An example would be 20150501043100 for May 1, 2015 at 04:31:00. The year must be in 4-digit format and all other elements in 2-digit format. The hour-of-day must be in 24-hour format.
85 {{/box}}
86
87 {{box}}
88 **TIME-SYNC {minute}**
89 Waits until the time synchronizes with the requested time interval
90 (e.g. if minutes = 15 and the time is 12:36, this command will wait until 12:45. Similarly, if the time is 12:02 it would wait until 12:15)
91 * minute: Time interval in minutes to wait for.
92 {{/box}}
93
94 {{box}}
95 **LOAD {file}**
96 Loads a text file into memory and compiles the text into a list of commands to process. This operation deletes all previously queued commands.
97 * file: Full file path of the file to load. In general, this is only the file name which will exist in the folder /c/programs. For a compact RIO you must use the convention /c/folder/sub-folder/filename.extension
98 {{/box}}
99
100 {{box}}
101 **INTERRUPT**
102 Stops everything and clears the command queue.
103 {{/box}}
104
105 {{box}}
106 **CLEAR**
107 Clears the command queue.
108 {{/box}}
109
110 {{box}}
111 **CLEAR-ALIASES**
112 Clears the list of aliases
113 {{/box}}
This wiki is licensed under a Creative Commons 2.0 license
XWiki Enterprise 13.10.5 - Documentation