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?

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.

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?

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
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 *

You can write code within the function, for example:

await API.RWS.SIGNAL.setSignalValue("ACOK", "", {mode: "pulse", passivePulse: 1000});

The current AppStudio has this interface, but there is a value attribute in the input parameters of this interface, which causes the pulse phenomenon to be somewhat abnormal. We are still working on solving this issue.