How do you pulse an IO point from a button?

I want to pulse a specific IO point when a button is pressed. Is there an example available that shows how to do this?
Thomas H. Johnston
PACs Application Engineer
Tagged:

Answers

  • Go to the control panel on the pendant.  There you will find programmable keys.  Set up the key you want to use and select pulse and the DO to pulse.
    Lee Justice
  • od1
    od1
    edited March 7
    Thomas J said:
    I want to pulse a specific IO point when a button is pressed. Is there an example available that shows how to do this?

    As you've posted in the AppStudio section, I presume you mean using an AppStudio button, not a flex pendant physical button.

    This functionality doesn't appear to have been implemented for the TComponents.Button

    It should be!
    There should be on option to pulse a DO in "onClick" or toggle it on/off in onPointDown and onPointRelease so that you have a momentary switch operation.
    At present we can only use a TComponents.Switch which is not momentary.

    The best work around I can suggest is the create a procedure which in turn calls PulseDO
    You can then use the "Execute procedure" function in the OnClick behaviour to call that procedure.

    EDIT:
    I've found that you can create a function in AppStudio ans set the DO in that.
    There appears to be pulse functionality but I can't find any documentation on the parameters.
    I'm able to set a DO but unsure how to pulse it.

    Something like this
    async () => {
        API.RWS.SIGNAL.setSignalValue("doFr1ErrorQuit", 1,{activePulse:1,passivePulse:0,pulses:10});          
              }
    But this just sets the signal high.  I don't know if activPulse and passivePulse are supposed to be the state, the duration or what?



    Post edited by od1 on
  • od1
    od1
    After finding the documentation I was able to pulse a signal by creating this function in the button "onClick" behavior
    API.RWS.SIGNAL.setSignalValue("doMySignal", 1,{mode:"pulse",activePulse:500,passivePulse:100,pulses:2});

    setSignalValue(signalName, value, mode:, pulses:, activePulse:, passivePulse:, deviceType, networkType, attr)

    Modify signal's value
    Parameters:
    Name Type Description
    signalName string
    value number
    mode: string value | pulse | invert | toggle | delay
    pulses: number Number of pulses.Pulses is required if mode is toggle/pulse.
    activePulse: number Active pulse length, in ms
    passivePulse: number Passive pulse length, in ms
    deviceType string
    networkType string
    attr *