swlk4w Wiki¶
Swagelok 4W actuated valve :- Actuator : Gulex K8
- Port size : 3/8"
- Port configuration 4 to 1 selector
Install¶
From source¶
Same procedure for Linux and Windows.
$ git clone https://forge.clermont-universite.fr/git/swlk4w
Binaries (Windows)¶
Download Windows binaries under the "Fichiers" tab.
Windows driver¶
For Windows versions earlier than 10, the STMicroelectronics VCP (virtual COM port) driver is required. With Windows versions starting at 10, ST recommends to use the driver provided with by the OS.
A copy of the driver for Windows 7 may be downloaded under the "Fichiers" tab.
Using the software¶
Generate a config file¶
To generate a config file, open a command prompt, and type :
swlk4w -g myconf.conf
Here is the file generated on Windows :
[serial] port_name = COM22 baud_rate = 115200 data_bits = 8 parity = none stop_bits = 1 [data] data_directory = %TEMP% geographical_location = XXX [timing] sync_start_minute_multiple = 15 sec_per_position = 900 sec_read_delay = 10 [sequence] step01 = 1 step02 = 2 step03 = 3 step04 = 4 [captions] pos1 = unused1 pos2 = unused2 pos3 = unused3 pos4 = unused4
Adjust the config file¶
Serial section¶
Search the serial port name that your system has given to the valve, and edit port_name
accordingly. Don't change the other parameters.
Data section¶
- Set the data directory. This is where the log file with time and valve position will be saved. On Windows, the syntax is e.g.
C:/mydir
. On Linux, use standard Linux path syntax.
- Change the station code e.g. to one of the GAW IDs.
Timing section¶
- sync_start_minute_multiple : the valve will synchronize with this multiple (minutes). 15 means the valve will start to move at the next 1/4 h.
- sec_per_position : number of seconds to wait in every position.
- sec_read_delay : number of seconds before polling the valve to read back its actual position. Set to 15 s.
Sequence section¶
This section is used to build a sequence, that will be repeated forever. The sequence is specified in key-value pairs.
Important :- The sequence is not played in the order in which the lines appear, but in the alphabetical order of the keys.
- The key names in the sequence must be unique.
- The key names should be alphabetically sorted.
Suppose you want to sample ports 1, 2, 1, 2 and 3. You must specify the sequence as follows. Note that the keys are alphabetically sorted.
[sequence] step01 = 1 step02 = 2 step03 = 1 step04 = 2 step05 = 3
Captions section¶
This section is used to name the ports of the valve. These strings will appear in the log file. Do not change the number nor the name of the keys in this section.
Running the software¶
Getting help¶
swlk4w --help
Playing a sequence¶
One the configuration file suits your needs, you can use it to play the sequence you just defined.
swlk4w -f myconf.conf
Move the valve manually¶
Move to position 2 :
swlk4w -m 2
The positions range from 1 to 4.
Log file¶
Here is an example log file, with the same sequence configured above. The program creates one file per day, named after the date and the station ID. If you run the program multiple times, it will append to the file until midnight UTC.
Important : time is UTC at the moment when the software reads back actual valve position, i.e. sec_per_position
seconds after rotation begins. The field delimiter is '\t' (tab).
# yr mo dy hr mn sc pos # pos1 = concentrator ; pos2 = filter ; pos3 = ambient ; pos4 = unused4 2018 10 08 15 55 55 1 2018 10 08 15 56 15 2 2018 10 08 15 56 35 1 2018 10 08 15 56 55 2 2018 10 08 15 57 15 3 2018 10 08 15 57 35 1 2018 10 08 15 57 55 2 2018 10 08 15 58 15 1 2018 10 08 15 58 35 2 2018 10 08 15 58 55 3 2018 10 08 15 59 15 1 2018 10 08 15 59 35 2 2018 10 08 15 59 55 1 2018 10 08 16 00 15 2 2018 10 08 16 00 35 3
Related projects¶
- lightSense : illumination measurements for mesocosms.