# # matplc.conf - configuration file # # # The section:variable syntax is convenient when there is only one variable # to be set, possibly in the middle of some other section. # 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 io "./io" module io_socket "./io_socket" module dsp "../../logic/dsp/dsp" module hmi_gtk "../../mmi/hmi_gtk/hmi_gtk" #module hmi_gtk "./hmi_gtk/hmi_gtk" module plcshutdown "../../lib/util/plcshutdown" # 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 statusbar "" hmi_gtk u32 point optionmenu "" hmi_gtk i32 point testp1 "" hmi_gtk i32 point testp2 "" hmi_gtk i32 point testp3 "" hmi_gtk i32 point in1 "in 1" hmi_gtk f32 init 100 point in2 "in 2" hmi_gtk f32 init 30.5 point in3 "in 3" hmi_gtk f32 init 25.3 point in4 "in 4" hmi_gtk f32 init 50.75 point out1_dsp "out dsp 1" dsp f32 point out2_dsp "out dsp 2" dsp f32 point out3_dsp "out dsp 3" dsp f32 point out4f_dsp "out dsp 4" dsp f32 point out4u_dsp "out dsp 4" dsp u32 point out4i_dsp "out dsp 4" dsp i32 point out1_io "out io 1" io f32 point out2_io "out io 2" io f32 point out3_io "out io 3" io f32 point out4f_io "out io 4" io f32 point out4u_io "out io 4" io u32 point out4i_io "out io 4" io i32 point quit "quit" hmi_gtk i32 point_alias quit_app1 "quit" quit point startplot "start plot" hmi_gtk i32 point stopplot "stop plot" hmi_gtk i32 point resetplot "reset plot" hmi_gtk i32 point gtkplotcanvas "dummy point to handle widget" hmi_gtk i32 point sinus "y-coordinate" io f32 point xcoord1 "x-coordinate" io f32 point rotation "Rotation Example" io i32 point radiobutton1 "Radiobutton1" hmi_gtk i32 init 1 point radiobutton2 "Radiobutton2" hmi_gtk i32 point radiobutton3 "Radiobutton3" hmi_gtk i32 point_alias LEDradiobutton1 "LEDradiobutton1" radiobutton1 point_alias LEDradiobutton2 "LEDradiobutton2" radiobutton2 point_alias LEDradiobutton3 "LEDradiobutton3" radiobutton3 point checkbutton1 "Checkbutton1" hmi_gtk i32 point checkbutton2 "Checkbutton2" hmi_gtk i32 point checkbutton3 "Checkbutton3" hmi_gtk i32 point_alias LEDcheckbutton1 "LEDcheckbutton1" checkbutton1 point_alias LEDcheckbutton2 "LEDcheckbutton2" checkbutton2 point_alias LEDcheckbutton3 "LEDcheckbutton3" checkbutton3 # specify periods for all the modules, so they don't hog the CPU hmi_gtk: scan_period = 0.05 # S Y N C H R O N I S A T I O N C O N F I G # -------------------------------------------- [PLC] synch hmi_gtk -> plcshutdown synch hmi_gtk -> dsp synch hmi_gtk -> io synch hmi_gtk -> io_socket synch dsp -> hmi_gtk synch_start hmi_gtk # configure which point will be used to shutdown the plc [plcshutdown] quit_pt = quit [dsp] #fblock typeconv in_pt in_pt_type out_pt out_pt_type ... fblock typeconv in1 f32 out1_dsp f32 fblock typeconv in2 f32 out2_dsp f32 fblock typeconv in3 f32 out3_dsp f32 fblock typeconv in4 f32 out4f_dsp f32 fblock typeconv in4 f32 out4u_dsp u32 fblock typeconv in4 f32 out4i_dsp i32 [hmi_gtk] #(default-value) #----------------------------------------------------------------------------------------------------- # - 1 - - 2 - - 3 - - 4 - #----------------------------------------------------------------------------------------------------- #widgetname plotctrl startpoint stoppoint resetpoint #widgetname channel y1point y2point #widgetname mode timer/plotxy # in plotxy-mode required #widgetname plotx xpoint #[optional] #widgetname widget xsize(600) ysize(600) #widgetname title title("Title") x-axis("x") y-axis("y") #widgetname axis xmin(0) xmax(20) ymin(0) ymax(20) #widgetname color bg("light blue") plot_bg("lightyellow") legend_bg("white") #widgetname channelcolor ("red") #widgetname timer scantime(0.5) #widgetname symboltype #widgetname symbolstyle #widgetname symbolsize #widgetname linestyle #widgetname linewidth #widgetname pointconnect #----------------------------------------------------------------------------------------------------- gtkplotcanvas title "Plotting sinus" "x-axis" "y-axis" gtkplotcanvas timer 0.1 gtkplotcanvas axis 0.0 20.0 0.0 3.0 gtkplotcanvas widget 600 400 gtkplotcanvas color "lightblue" "lightyellow" "white" gtkplotcanvas plotctrl startplot stopplot resetplot gtkplotcanvas CHannel sinus gtkplotcanvas channelcolor "Red" "blue" gtkplotcanvas symboltype "plus" "DIAMOND" gtkplotcanvas symbolstyle "Empty" "opaque" gtkplotcanvas symbolsize 4 4 gtkplotcanvas linestyle "solid" "solid" gtkplotcanvas linewidth 2 2 gtkplotcanvas pointconnect "straight" "straight" gtkplotcanvas plotx xcoord1 xcoord2 gtkplotcanvas mode plotxy #gtkplotcanvas mode timer #----------------------------------------------------------------------------------------------------- #----------------------------------------------------------------------------------------------------- GnomePixmap "rotation" rot1 rot2 rot3 rot4 GnomePixmap "testp*" off on1 on2 on3 on4 GtkLabel "out1*" "%+07.2f" GtkLabel "out3*" "%+07.4f" GtkLabel "out4f*" "f32: %+05.2f" GtkLabel "out4u*" "u32: %+03d" GtkLabel "out4i*" "i32: %+03d" optionmenu testp1 "TestA_1" "TestA_2" "TestA_3" "TestA_4" optionmenu testp2 "TestB_1" "TestB_2" optionmenu testp3 "TestC_1" "TestC_2" "TestC_3"