0

PLC Communication with HD 2000



We Want to use a plc with an RS232 comm. port to play .Mpg files. We have verified the PLC is sending string text to the HD2000 but nothing is happening. We have turned on the necessary roObjects and believe we have the program right. We create and test the programs using a hyperterminal and every thing works great. We have even been able to make the HD2000 operate our PLC. Is there a simple instruction that would allow the HD2000 to recieve a string like "11.mpg" from a PLC and and then play that file? We do not want to operate through the shell because it is dissabled by the "autorun.bas" script we use. WE THINK?

6 comments

  • 0
    Avatar
    RokuLyndon


    Can you send me the script you are using? You can reach me at <!-- e --><a href="mailto:lallydice@roku.com">lallydice@roku.com</a><!-- e -->.



    I'll do some checking in the mean time.
  • 0
    Avatar
    the1saynt


    vid=CreateObject("roVideoPlayer")

    image=CreateObject("roImagePlayer")

    mode=CreateObject("roVideoMode")

    serial=CreateObject("roSerialPort", 0, 38400)

    p=CreateObject("roMessagePort")

    vid.SetPort(p)

    serial.SetLineEventPort(p)

    vid.SetAudioOutput(2)



    imagemode=1

    videomode$="1280x1024x60p"



    main="Logo.jpg"

    one="bp.mpg"

    two="pdx.mpg"



    vid_to_play=""



    mode.SetMode(videomode$)

    image.SetDefaultMode(imagemode)



    intro:

    image.DisplayFile(main)





    wait_for_serial:

    msg=wait(0,p)



    if(type(msg) = "roStreamLineEvent") then vid_to_play=msg

    endif



    serial.SendLine(vid_to_play)

    vid.PlayFile(vid_to_play)



    wait_for_video_end:

    msg=wait(0,p)



    if type(msg)="roVideoEvent" then

    status=msg.GetInt()

    if status <> 8 then goto wait_for_video_end

    vid.StopClear()

    endif

    goto intro
  • 0
    Avatar
    RokuLyndon


    if(type(msg) = "roStreamLineEvent") then vid_to_play=msg

    endif



    That line has an extra endif.



    Also:



    -Please turn off hardware handshaking on the plc, if enabled.

    -Please verify the only connections to the brightsign are to TX, RX, and ground.



    Do you know what the plc sends as the end of line character?
  • 0
    Avatar
    the1saynt


    Verified the hand shake is not an issue. The last character sent is the last character we type. Base on the program above what string would you send to  make the file "bp.mpg" play through the serial port?
  • 0
    Avatar
    RokuLyndon


    Hi,



    The PLC needs to send an EOL (end of line) character, a carriage return after the string.
  • 0
    Avatar
    the1saynt


    All Set



    THANK YOU,



    The1saynt
Please sign in to leave a comment.