LinuxCNC Documentation
This page is 52% translated. Untranslated text is shown in English.

СИНОПСИС

loadrt siggen[num_chan=num | names=name1[,name2…​]]

ОПИСАНИЕ

siggen is a signal generator that can be used for testing and other applications that need simple waveforms. It produces sine, cosine, triangle, sawtooth, and square waves of variable frequency, amplitude, and offset, which can be used as inputs to other HAL components.

siggen supports a maximum of sixteen channels. The number of channels actually loaded is set by the num_chan argument when the module is loaded. Alternatively, specify names= and unique names separated by commas.

Спецификаторы num_chan= и names= являются взаимоисключающими. Если ни num_chan=, ни names= не указаны, значение по умолчанию равно единице.

ИМЕНОВАНИЕ

Имена выводов, параметров и функций имеют префиксы:

siggen.N. for N = 0, 1, …​, num-1 when using num_chan=num

nameN. for nameN = name1, name2, …​ when using names=name1,name2,…​

Формат siggen.N. показан в следующих описаниях.

FUNCTIONS

siggen.N.update (использует floating-point)

Updates output pins for signal generator N. Each time it is called it calculates a new sample. It should be called many times faster than the desired signal frequency, to avoid distortion and aliasing.

PINS

siggen.N.frequency real in

The output frequency for signal generator N, in Hertz. The default value is 1.0 Hertz.

siggen.N.amplitude real in

The output amplitude for signal generator N. If offset is zero, the outputs will swing from -amplitude to +amplitude. The default value is 1.00.

siggen.N.offset real in

The output offset for signal generator N. This value is added directly to the output signal. The default value is zero.

siggen.N.reset bool in

Resets output pins to predetermined states:
sine: 0
sawtooth: 0
square: -1 * amplitude
cosine: -1 * amplitude
triangle: -1 * amplitude

siggen.N.clock bool out

The clock output. Boolean type clock signal output at the commanded frequency.

siggen.N.square real out

The square wave output. Positive while triangle and cosine are ramping upwards, and while sine is negative.

siggen.N.sine real out

The sine output. Lags cosine by 90 degrees.

siggen.N.cosine real out

The cosine output. Leads sine by 90 degrees.

siggen.N.triangle real out

The triangle wave output. Ramps up while square is positive, and down while square is negative. Reaches its positive and negative peaks at the same time as cosine.

siggen.N.sawtooth real out

The sawtooth output. Ramps upwards to its positive peak, then instantly drops to its negative peak and starts ramping again. The drop occurs when triangle and cosine are at their positive peaks, and coincides with the falling edge of square.

PARAMETERS

Нет