squarew

Purpose:

Apply a square wave to a CyFlex variable by superimposing an offset with the specified amplitude and frequency for the given duration.

Enter:

squarew <variable> <offset> <amplitude> <frequency> <duration>

Where:

variable

Specify the name of a current CyFlex variable to which a square wave is applied.

offset

Specify the offset value to superimpose on the square wave function in units of the target variable.

amplitude

Specify the amplitude of the square wave function in units of the target variable.

frequency

Specify the frequency of the square wave function in hertz.

duration

Specify the duration of time in seconds to apply to the square wave function.

Example:

squarew gen_square 10 3 1 10
The above command applies a square wave function to the variable gen_square as follows:

offset of 10, amplitude of +/- 3, frequency of 1 hz, duration of 10 seconds.

Notes:

The square wave is applied until the specified duration is reached and the value returns close to the offset.

The smoothness depends on processor availability and is updated at the CyFlex fast process interval (usually 20 Hz).

The variable must be a valid existing CyFlex variable and is not created by this command.

See Also:

ramp, sine