PSO Continuous Pulse Output

Demonstrates generating a continuous PSO pulse output by configuring the waveform module and generating continuous manual PSO events.

// PSO Continuous Pulse Output Example:
// Demonstrates generating a continuous PSO pulse output by configuring the waveform module and generating continuous manual PSO events.
// To help you visualize the behavior of the PSO output generated by this configuration, the pulse times used in this program are
// longer than would be typical and this program triggers data collection. You can use the Data Visualizer to collect the
// "OutputActive" bit of the "Pso Status" signal. To see the complete output from this program,
// you must collect data at a period of 1 msec and a time to collect of at least 4000 msec.

program

	var $axis as axis = X

	// Reset all PSO configuration.
	PsoReset($axis)

	// Configure waveform module in pulse mode: 20 ms total time, 10 ms on time (50% duty cycle), 1 period per event.
	PsoWaveformConfigureMode($axis, PsoWaveformMode.Pulse)
	PsoWaveformConfigurePulseFixedTotalTime($axis, 20000)
	PsoWaveformConfigurePulseFixedOnTime($axis, 10000)
	PsoWaveformConfigurePulseFixedCount($axis, 1)
	PsoWaveformApplyPulseConfiguration($axis)
	PsoWaveformOn($axis)

	// Select the waveform module output as the PSO output source.
	PsoOutputConfigureSource($axis, PsoOutputSource.Waveform)

	// Trigger Data Collection.
	AppDataCollectionSnapshot()

	Dwell(1)

	// Generate continuous PSO events for two seconds.
	PsoEventContinuousOn($axis)

	Dwell(2)

	// Cease continuous PSO events.
	PsoEventContinuousOff($axis)

	// Stop Data Collection.
	AppDataCollectionStop()

end