This should *only* have live blocks for instruments that are going to be used. Do not have spare blocks of code lying around for "possible" instruments unless they are commented out. This program has a two major blocks of code, one for configurationof ADCPs (information specific to the dialog with the ADCP) and one for all serial communications. NOTE: - python is uses indentation for logic: the easiest mistake to make is to split a line or have the indentation wrong - whatever order the ADCPs go into the first block, "ADCPs", use the same order for the ADCPs in the communications block (called "sensors", and then follow with the passively-logged instruments The file looks like this: ============== # comments and header ADCPs = [... #block of code, described below ] common_opts = '-f %s -F -m 1 -H 2 ' % (shipabbrev,) sensors = [... #block of code, described below ] # tail end ================ Both blocks of code "ADCPs" amd "sensors" are built like this: name = [ { 'name1' : value1, 'name2' : value2, 'name3' : value3, 'nameN' : valueN}, ## comments are after ##hash## { 'name1' : value1, 'name2' : value2, 'name3' : value3, 'nameN' : valueN}, { 'name1' : value1, 'name2' : value2, 'name3' : value3, 'nameN' : valueN}, # etc ] Examples of ADCPs block # for OS38 { 'instrument' : 'os38', #do not change 'setup' : 'rdi_setup', #do not change 'terminal' : 'oswh_term', #do not change 'defaultcmd' : 'os38_default.cmd', #do not change 'commands' : ('EA04500',), # see comment #1 'datatypes' : ('os38bb', 'os38nb'), #do not change 'wakeup_baud' : 9600 }, # see comment #2 # for OS75 (already present in the working version) { 'instrument' : 'os75', #do not change 'setup' : 'rdi_setup', #do not change 'terminal' : 'oswh_term', #do not change 'defaultcmd' : 'os75_default.cmd', #do not change 'commands' : ('EA-04500',), # see comment #1 'datatypes' : ('os75bb', 'os75nb'), #do not change 'wakeup_baud' : 9600}, # see comment #2 # for OS150 { 'instrument' : 'os150', #do not change 'setup' : 'rdi_setup', #do not change 'terminal' : 'oswh_term', #do not change 'defaultcmd' : 'os150_default.cmd', #do not change 'commands' : ('EA+13500',), # see comment #1 'datatypes' : ('os150bb','os150nb'), #do not change 'wakeup_baud' : 9600}, # see comment #2 # for NB150 { 'instrument' : 'nb150', #do not change 'setup' : 'rdi_setup', #do not change 'terminal' : 'nb_term', #do not change 'defaultcmd' : 'nb150_default.cmd', #do not change 'commands' : (), #do not change 'datatypes' : ('nb150',), #do not change 'wakeup_baud' : 19200}, # see comment #2 # for WH300: { 'instrument' : 'wh300', #do not change 'setup' : 'rdi_setup', #do not change 'terminal' : 'oswh_term', #do not change 'defaultcmd' : 'wh300_default.cmd', #do not change 'commands' : ('EA04500',), # see comment #1 'datatypes' : ('wh300',), #do not change 'wakeup_baud' : 9600 # see comment #2 } # comment #1 # # The EA command *must* be set correctly or the data may be irrevocably # damaged. However "set correctly" can be pretty sloppy. ER here refers to # the nominal angle of beam 3, eg. 0,20,30,45,90,135,-45, -90 # Probably best to use 179 not 180 if it is really facing backwards # comment #2 # # wakeup_baud rate is probably set in the deck unit with dip switches. # This refers to whatever baud rate is nexessary to read the "wakeup" # message RDI instruments send out after getting a Some variables might be in the middle: # Do not edit the next three lines: common_opts = '-f %s -F -m 1 -H 2 ' % (shipabbrev,) nb_opts = '-rlE -c -I' # raw data, write a log file, log errors oswh_opts = '-rlE -c -O -I' # -O for OS/WH data format # -c for checksum, -I to initiate pinging Examples of "sensors" block corresponding to above ADCPs { 'instrument' : 'os38', # Passive logging of OS 'device' : 'ttyR5', 'baud' : 19200, 'format' : 'binary', 'subdir' : 'os38', 'ext' : 'raw', 'opt' : '-rlE -c -O -I'}, { 'instrument' : 'os75', # Passive logging of OS 'device' : 'ttyS2', 'baud' : 38400, 'format' : 'binary', 'subdir' : 'os75', 'ext' : 'raw', 'opt' : '-rlE -c -O -I'}, { 'instrument' : 'os150', # Passive logging of OS150 'device' : 'ttyS1', 'baud' : 38400, 'format' : 'binary', 'subdir' : 'os150', 'ext' : 'raw', 'opt' : '-rlE -c -O -I'}, { 'instrument' : 'nb150', # Passive logging of NB150 'device' : 'ttyR6', 'baud' : 19200, 'format' : 'binary', 'subdir' : 'nb150', 'ext' : 'raw', 'opt' : '-rlE -c -I'}, { 'instrument' : 'wh300', 'device' : 'ttyR7', 'baud' : 38400, 'format' : 'binary', 'subdir' : 'wh300', 'ext' : 'raw', 'opt' : oswh_opts}, The ttyS2, ttyR7 etc are serial ports