Trouble with video camera programming

MEDState Notation Repository Forums Coding Help Archive Trouble with video camera programming

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #13058
    Med_Support
    Moderator
    ECallen

    I recently added 4 video cameras to a rat operant system and am having trouble getting the medstate language to compile. I am trying to do a simple video recording during a 10 sec tone on the four boxes at the same time, but get compile errors. I used previous code and added the video commands, here is a sample below and attached. Can anyone see the errors?

    
    \ freezing test x83
    
    ^LEFTLEVER=1
    
    ^LLEVERPOS=2
    
    ^RIGHTLEVER=3
    
    ^RLEVERPOS=4
    
    ^LLEVEROP=1
    
    ^RLEVEROP=2
    
    ^FEEDER=3
    
    ^STIMLL=4
    
    ^STIMLR=5
    
    ^HOUSELIGHT=7
    
    ^DRIPPER=8
    
    ^SHOCK=9
    
    
    
    
    
    S.S.1,
    
    S1,
    
    .1":ADD T--->SX \ ALL PURPOSE TIMER
    
    
    
    S.S.2,
    
    S1,
    
    #START:ON ^HOUSELIGHT; ~SET N=1--->S2
    
    S2,
    
    .1":~ConnectToVM('.', 'Box 1');~ConnectToVM('.', 'Box 2');~ConnectToVM('.', 'Box 3');~ConnectToVM('.', 'Box 4');~ --->s3
    
    S3,
    
    90":ADD T--->S4 \90-SEC INTERTRIAL INTERVAL
    
    S4,
    
    .1":~WriteEventVM('.', 'Box 1', StartSavingEvent, 'StartEvent');~WriteEventVM('.', 'Box 2', StartSavingEvent, 'StartEvent');~WriteEventVM('.', 'Box 3', StartSavingEvent, 'StartEvent');~WriteEventVM('.', 'Box 4', StartSavingEvent, 'StartEvent');~ --->S5
    
    S5,
    
    .1":~TONEON(MG,BOX);~SET T=0 --->s6
    
    
    
    S6,
    
    10":~TONEOFF(MG,BOX);;~ADD N--->S7
    
    S7,
    
    .1":~WriteEventVM('.', 'Box 1', StopSavingEvent, 'StopEvent');~WriteEventVM('.', 'Box 2', StopSavingEvent, 'StopEvent');~WriteEventVM('.', 'Box 3', StopSavingEvent, 'StopEvent');~WriteEventVM('.', 'Box 4', StopSavingEvent, 'StopEvent');~ --->s8
    
    S8,
    
    .1":~DisconnectVM('.', 'Box 1');~DisconnectVM('.', 'Box 2');~DisconnectVM('.', 'Box 3');~DisconnectVM('.', 'Box 4');~--->s2
    
    S.S.3,
    
    S1,
    
    .5":SHOW 1,TRIAL,N--->SX
    
    
    
    
    
    S.S.4,
    
    S1,
    
    #Z1--->S2
    
    S2,
    
    #Z2:OFF^STIMLR,^STIMLL--->S1
    
    .2":ON ^STIMLR,^STIMLL--->S3
    
    S3,
    
    #Z2:OFF ^STIMLR,^STIMLL--->S1
    
    .2":OFF ^STIMLR, ^STIMLL--->S2
    
    
    
    S.S.5,
    
    S1,
    
    #Start: SET G = 3000; \ default freq = 0 hz (WHITE NOISE)
    
    SET H = 80; \ volume = 80 db
    
    SET I = 10; \ rise\fall time = 10 ms
    
    SET P = 1000; \ duration = 1000 ms
    
    ~InitANL926;~; \ reset ANL-926
    
    ~SetFreq(MG, BOX,G);~; \ initialize frequency
    
    ~SetAmp(MG, BOX,H);~; \ initialize amplitude
    
    ~SetRF(MG, BOX,I);~; \ initialize rise\fall time
    
    ~SetDur(MG, BOX,P);~;--->S2 \ initialize duration
    
    
    
    S2,
    
    .1": ADD L;--->SX
    
    
    
    S.S.6,
    
    S1,
    
    .1":IF N>10 [@TRUE,@FALSE] \ TRIAL COUNTER TO STOP AFTER 3
    
    @TRUE:--->S2
    
    @FALSE:--->SX
    
    S2,
    
    .1":;OFF ^HOUSELIGHT--->STOPABORT
    

    x83testsame

    #13059
    Med_Support
    Moderator
    Gary Bamberger

    Hello,
    1) In S.S.2, S1 you have

    S.S.2,
    S1,
    #START:ON ^HOUSELIGHT; ~SET N=1--->S2
    

    There is a ~ that doesn’t belong.

    2) In S.S.2, S2 you have

    S2,
    .1":~ConnectToVM('.', 'Box 1');
    ~ConnectToVM('.', 'Box 2');
    ~ConnectToVM('.', 'Box 3');
    ~ConnectToVM('.', 'Box 4');~ --->s3
    

    Your ~’s don’t match up evenly.  You need to change it to be:

    S2,
    .1":~ConnectToVM('.', 'Box 1');
    ConnectToVM('.', 'Box 2');
    ConnectToVM('.', 'Box 3');
    ConnectToVM('.', 'Box 4');~ --->s3
    

    3) S.S.2, S4 is the same problem as S2

    4) In S.S.2, S5 you have

    S5,
    .1":~TONEON(MG,BOX);~SET T=0 --->s6
    

    You are missing a semicolon following the tilda

    S5,
    .1":~TONEON(MG,BOX);~; SET T=0 --->s6
    

    5) In S.S.2, S6 you have

    S6,
    10":~TONEOFF(MG,BOX);;~ADD N--->S7
    

    In this case you have the second semicolon, but it is in the wrong place

    S6,
    10":~TONEOFF(MG,BOX);~; ADD N--->S7
    

    6) S.S.2, S7 is the same problem as S2 & S4

    7) S.S.2, S8 is the same problem as S2 & S4 & S7

    Once you correct the above problems the program will compile.
    I am a little concerned about how you are trying to control all four cameras from one program running in one Box.  You may find that you run into timing problems.  It would be better if you had one Box controlling one camera each.  Four separate programs in four Boxes.

    #13062
    Med_Support
    Moderator
    ECallen

    Thanks for the errors and advice, I’ll check the timing issue.

    These changes worked great, appreciate the advice and appreciate the support of Med standing behind their product with quick help, pretty unusual these days.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.