#!../../tools/run/matplc -g # # matplc.conf - configuration file # # the speed of the light-chasing (interval in seconds) Chaser: delay = 0.5 # I could have also written that like this: # [Chaser] # delay = 0.5 # # The section:variable syntax is convenient when there is only one variable # to be set, possibly in the middle of some other section. [LOGGER] file = chaser.log points L1 L2 L3 L4 # Fill in this section to test the MYSQL data logger module; you'll also # have to uncomment the "module" line about a page below this [LOGGER_DB] host = localhost user = matuser password = mat #port_num = 0 #socket_name = db_name = matlog table = demolog points L1 L2 L3 L4 # shared memory map section [PLC] # run the modules!!! # # Note: the Kbd module cannot run as a deamon, as it reads the # terminal's keyboard. It is therefore launched in the demo script. module Chaser ../basic/chaser module vitrine ../../mmi/curses/vitrine module plcshutdown ../../lib/util/plcshutdown #module Kbd ../basic/kbd module LOGGER ../../io/logger/logger #Uncoment the next line to test the MYSQL data logger module #module LOGGER_DB ../../io/logger/logger_db # P O I N T S # ----------- # # These are also specified in the PLC section. However, it's not specified # whether they are inputs or outputs here - that should be specified in the # section(s) relating to the I/O modules. (That way, a point can be both an # input and an output, or it can be output in several places. Also, some # points are just internal coils and don't get input or output at all.) # # syntax: # point name "full name" owner [at offset.bit] # # where: # point = 'point' identifier # name = Name used to refer to the point throughout the PLC # full name = More extensive description of the point # This might be displayed by various diagnostic tools. # owner = Name of the module with write permission on the point # at = 'at' identifier # offset = location of word in the globalmap that holds the point's state # bit = the bit in the word (0-31), that holds the point's state point L1 "light 1" Chaser point L2 "light 2" Chaser point L3 "light 3" Chaser point L4 "light 4" Chaser point left "<- (key L)" Kbd point right "-> (key R)" Kbd point quit "quit (key Q)" Kbd # read in the configuration of the display # (this might equally well be simply specified here, but for the sake of # demonstration it's in a separate file) *include vitrine.conf # note: the following section is only used by the keyboard module from the # mmi/kbd directory; if you are not on the linux console, the kbd.c program # from this directory is used instead, which doesn't use this [Kbd] # format: # key keycode point # for now, keycode must be numeric key 38 left key 19 right key 16 quit # no debugging messages quiet = 1 # specify periods for all the modules, so they don't hog the CPU vitrine: scan_period = 0.01 Chaser: scan_period = 0.01 plcshutdown: scan_period = 0.01 LOGGER: scan_period = 0.25 LOGGER_DB: scan_period = 0.25 #neither of the keyboard modules (Kbd or kbd) can be sensibly given periods [plcshutdown] # configure which point will be used to shutdown the plc quit_pt = quit