function [trl]=maketrlSemCon(cfg);

    event = read_fcdc_event(cfg.trialfile);
    nevents = length(event);

    selevents=strcmp({event.type},{cfg.trialdef.eventtype});
    for eventindx=1:nevents
        if selevents(eventindx)
            selevents(eventindx)=(event(eventindx).value==cfg.trialdef.eventvalue);
        end;
    end;
    badtrialevents=strcmp({event.type},{'classification'});
    badtrialfirstsamples=[event(badtrialevents).sample];
    for eventindx=1:nevents
        if selevents(eventindx)
            temp=(event(eventindx).sample-300)==badtrialfirstsamples;
            if sum(temp)
                selevents(eventindx)=0;
            end;
        end;
    end;
    
    nselevents=sum(selevents);
    trl=zeros(nselevents,3);
        
    seleventindx=0;
    for eventindx=1:nevents
        if selevents(eventindx)
            seleventindx=seleventindx+1;
            trl(seleventindx,1)=event(eventindx).sample - 300;
            trl(seleventindx,2)=event(eventindx).sample + 599;
            trl(seleventindx,3)= -300;
        end;
    end;
    
end