0

HD2000 RS232 Communication



Is there a line of code or instruction that prevents other videos from playing until the current video stops. If any button is pushed while a video is playing it will lock up the HD2000 and It must be unpluged to reset. We are using RS232 for communications and everything works great as long as the video is allowed to finish.

1 comment

  • 0
    Avatar
    RokuLyndon


    It sounds like your script is stopping because it's not handling the event it's seeing properly. Yes, you can easily tell the unit to ignore anything that occurs until the video is done playing. Here are two examples where the unit is waiting for serial input, then plays video once it receives the input, and then waits for the video to end before processing any more input.





    Example1:



    REM

    REM In this example, we wait for a serial command to stard

    REM Then, once started, we listen for video events. If we receive the video end event, we move on

    REM If not, we keep waiting for the video end



    MEDEN=8 'end of video event ID

    wait_for_serial:  'this is just a label, the name is arbitrary

    msg=wait(0, p)



    if debug print type(msg)

    if type(msg) = "roStreamLineEvent" then



    if msg="start" then

     if debug print "Playing file...."

     vid.PlayFile("video.mpg")



     wait_for_video_end:

     msg=wait(0,p)

     if type(msg) = "roVideoEvent" then

      if msg.GetInt() <> MEDEN then goto wait_for_video_end

     emdof

    endif

    endif

    REM End of example -----------------------------------------------------







    Example2:



    MEDEN=8 'end of video event ID

    video_playing = FALSE



    wait_for_serial:  'this is just a label, the name is arbitrary

    msg=wait(0, p)



    if debug print type(msg)

    if type(msg) = "roStreamLineEvent" and video_playing = FALSE then



    if msg="start" then

     if debug print "Playing file...."

     vid.PlayFile("video.mpg")

     video_playing=TRUE

    endif



    else if type(msg) = "roVideoEvent" then

    if msg.GetInt() = MEDEN then video_playing = FALSE



    else

    if debug print "Unhandled Event."

    endif

    REM End of example 2 -----------------------------------------
Please sign in to leave a comment.