Home AMX User Forum NetLinx Studio

How to hold the button?

I am looking for the button event that hold the event, so they can send out continuously

for example
button_event[TouchPanel, 1]
{
hold[1, REPEAT]:
{
send_string ....
}
}

this one will send one RS-232 command every 0.1 second. But I want AMX to send the RS-232 command continuously, once I hold the button.

Thanks for the help

Comments

  • dchristodchristo Posts: 177
    winstonma wrote:
    I am looking for the button event that hold the event, so they can send out continuously

    for example
    button_event[TouchPanel, 1]
    {
    hold[1, REPEAT]:
    {
    send_string ....
    }
    }

    this one will send one RS-232 command every 0.1 second. But I want AMX to send the RS-232 command continuously, once I hold the button.

    Thanks for the help


    This would probably work (I haven't tested it)
    Button_Event[dvTp,1]
    {
       Hold[1]:
       {
          While([dvTp,1])
          {
             Send_String....
          }
       }
    }
    

    However, I would caution against continuously sending serial data. This could quite easily cause system problems due to the master sending data to the port much faster than the port can deal with it. You may want to reevaluate why you need to send data continuously. Can you provide for information on what you're trying to accomplish?

    --D
  • GSLogicGSLogic Posts: 562
    winstonma wrote:
    I want AMX to send the RS-232 command continuously, once I hold the button.
    Do you mean "touch the button" instead of "hold the button"?
    If so, use a timeline to repeat as many times as you want and you'll have control of the speed and numbers of the repeated command.
  • AMXJeffAMXJeff Posts: 450
    Just Curious

    Why would you want to send a string out continuously or faster then 1 ten of a second? Most RS232 devices can not handle that speed and you could end up locking up the equipment... What are you trying to do, there maybe other ways to handle the problem?
  • winstonmawinstonma Posts: 45
    Since I'm handling a Tandberg Video Conference device. And the remote control movement is like that... when you hold the camera movement button you'll end up moving the camera smoothly. But when I repeat the movement button every 0.1 second, the camera will move a little bit, and stop, and move a little bit, and stop... which is not a smooth movement.

    Actually I wonder if I need to do that using IR instead of using RS-232
  • ericmedleyericmedley Posts: 4,177
    winstonma wrote:

    Actually I wonder if I need to do that using IR instead of using RS-232

    Bingo! Good idea.
  • jweatherjweather Posts: 320
    Tandberg codecs let you control the near camera with separate "press" and "release" messages. So you can tell the camera to "start moving left", then when the button is released, say "stop moving". This will result in the smooth motion you get from using the remote control. Look up "xcommand CameraMove" in the API manual: http://www.tandberg.com/collateral/documentation/Application_Programmer_Interfaces/TANDBERG_MXP_API.pdf

    The far end camera can only be controlled in steps, using fecc or xcommand FECCMove.

    Jeremy
  • ericmedleyericmedley Posts: 4,177
    I was actually going to suggest that too. But I am unfamiliar with the Tandberg commands and didn't want to give information from ignorance. I work mainly with Polycom. the cams on the Polycom do the same thing. I also know the Sony cams also work similarly. Start Pan Left, Stop pan left. The IR will get you there too. either way will work.
    jweather wrote:
    Tandberg codecs let you control the near camera with separate "press" and "release" messages. So you can tell the camera to "start moving left", then when the button is released, say "stop moving". This will result in the smooth motion you get from using the remote control. Look up "xcommand CameraMove" in the API manual: http://www.tandberg.com/collateral/documentation/Application_Programmer_Interfaces/TANDBERG_MXP_API.pdf

    The far end camera can only be controlled in steps, using fecc or xcommand FECCMove.

    Jeremy
  • AMXJeffAMXJeff Posts: 450
    Tandberg Camera

    Although the new Tandberg codec?s have the Start, Stop movement process. The older codecs did not. The trick is timing, going faster with these cameras tends to make the cameras work more irratic. If I remember correctly, the camera moves for a half a second before stoping everytime you issue the string. So you should send the next message just before the camera stops. Although this still makes the camera jerk, it is the best you can do. The newer codec fixed this, so look for the newer commands.
  • bmitchellbmitchell Posts: 41
    The older codecs also have the camera movement command.

    I cannot remember the exact software release it was introduced but if I remember it was E4 and B9

    The commands are cammove <camera> <direction>
  • Chip MoodyChip Moody Posts: 727
    Many of the systems I've done have required a single set of cursor keys, which were needed to behave like those on the remote - doing both menu and camera control. Since there is no way for the AMX program to determine whether the Tandberg UI is in a state where IR commands would move the camera vs. navigate a menu, I've always run IR just for pan/tilt/zoom...

    - Chip
  • the8thstthe8thst Posts: 470
    Couldn't you have a menu button pop up the cursor buttons with the programming for the menu state and a Pan or Camera button pop up the same pages with the programming for camera movement?

    I have not used either system, but just thought this might be an easy solution.
  • jweatherjweather Posts: 320
    Chip Moody wrote:
    Many of the systems I've done have required a single set of cursor keys, which were needed to behave like those on the remote - doing both menu and camera control. Since there is no way for the AMX program to determine whether the Tandberg UI is in a state where IR commands would move the camera vs. navigate a menu, I've always run IR just for pan/tilt/zoom...

    We used to do this, but got too many complaints about jerky camera movement resulting from IR emulation. Now we use "mode" buttons next to the arrow keys with Menu, Near Cam, and Far Cam. That way the program can send appropriate press/release messages for camera movement or IR emulation for menu nav. Modes are bad, I know (see Raskin et. al), but this one seems to work out pretty well.

    Jeremy
  • Chip MoodyChip Moody Posts: 727
    Ah, but I didn't say anything about IR emulation. :) I was putting in a "second" for using regular IR for camera controls, 232 for everything else...

    - Chip

    jweather wrote:
    We used to do this, but got too many complaints about jerky camera movement resulting from IR emulation.
  • Chip MoodyChip Moody Posts: 727
    Possibly, but the client base I'm used to would complain. "The remote doesn't make me do that! Why can't you do the same thing on the touch panel?!"

    - Chip

    the8thst wrote:
    Couldn't you have a menu button pop up the cursor buttons with the programming for the menu state and a Pan or Camera button pop up the same pages with the programming for camera movement?

    I have not used either system, but just thought this might be an easy solution.
  • JubalJubal Posts: 77
    Try my code. its working on mine.


    BUTTON_EVENT [dvTP,5]
    BUTTON_EVENT [dvTP,6]
    BUTTON_EVENT [dvTP,7]
    BUTTON_EVENT [dvTP,8]
    {
    PUSH:
    {
    SWITCH(BUTTON.INPUT.CHANNEL)
    {
    CASE 5:
    {
    SEND_STRING dvVTC, "'xCommand Key Click Key: Up',$0D"
    }
    CASE 6:
    {
    SEND_STRING dvVTC, "'xCommand Key Click Key: Left',$0D"
    }
    CASE 7:
    {
    SEND_STRING dvVTC, "'xCommand Key Click Key: Down',$0D"
    }
    CASE 8:
    {
    SEND_STRING dvVTC, "'xCommand Key Click Key: Right',$0D"
    }
    }
    }
    HOLD [10,REPEAT]:
    {
    SWITCH(BUTTON.INPUT.CHANNEL)
    {
    CASE 5:
    {
    SEND_STRING dvVTC, "'xCommand Key Press Key: Up',$0D"
    }
    CASE 6:
    {
    SEND_STRING dvVTC, "'xCommand Key Press Key: Left',$0D"
    }
    CASE 7:
    {
    SEND_STRING dvVTC, "'xCommand Key Press Key: Down',$0D"
    }
    CASE 8:
    {
    SEND_STRING dvVTC, "'xCommand Key Press Key: Right',$0D"
    }
    }
    }
    RELEASE:
    {
    SWITCH(BUTTON.INPUT.CHANNEL)
    {
    CASE 5:
    {
    SEND_STRING dvVTC, "'xCommand Key Release Key: Up',$0D"
    }
    CASE 6:
    {
    SEND_STRING dvVTC, "'xCommand Key Release Key: Left',$0D"
    }
    CASE 7:
    {
    SEND_STRING dvVTC, "'xCommand Key Release Key: Down',$0D"
    }
    CASE 8:
    {
    SEND_STRING dvVTC, "'xCommand Key Release Key: Right',$0D"
    }
    }
    }
    }
Sign In or Register to comment.