Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
SYPT PRO User Guide / SYPT PRO User Guide.doc
Скачиваний:
244
Добавлен:
03.03.2016
Размер:
17.32 Mб
Скачать

Cos - Cosine Function

This function returns the mathematical cosine of an input angle expressed in radians.

Arguments

IN

An angle expressed in radians.

Return Values

Q

The floating-point cosine of IN.

Example

Target/ Language Restrictions

None.

See Also

  • SIN

  • TAN

________________________________________________________________________________

Crc16 - Cyclic Redundancy Check

This function calculates a 16-bit CRC (cyclic redundancy check).

The function is commonly used in communication protocols. A CRC can be calculated for a set of data and transmitted along with the data. The receiver of the data can recalculate the CRC and compare with the CRC value received to check for message corruption.

Arguments

Char%

A character value to be used in the CRC calculation. Only the bottom 8-bits of the value will be included in the calculation.

Crc%

The previous CRC value. When calculating the CRC for a block of data, call CRC for each byte of data, passing the CRC value from the call for a previous byte into the call for the next byte. The value 0 should be passed into Crc% for the first byte of data.

Return Values

Q

A 16-bit CRC.

Example

Target/ Language Restrictions

None.

________________________________________________________________________________

Ctd - Down Counter

This a Down-counter function that is used to signal when a count has reached zero.

The counter counts the number of rising edges (positive transition) detected on input and decreases CV% (current value) output. As CV% reaches zero, the output Q% is set to 1 and the counter stops counting. Reset% is used to reset the counter: Q% is cleared to 0 and CV% is set to the value of IV%.

Arguments

Input%

The value to be counted. A transition of Input% from zero to a non-zero value causes CV% to be decremented.

IV%

This is the initial value to be set in the CV% output when Reset% has a non-zero value.

Reset%

If this is set to 1, Q% is set to 0 and CV% is set to the value of IV%.

Return Values

Q%

This value is set to 1 when CV% has the value 0. Q% is cleared to 0 at all other times.

CV%

This is the decremented count of rising edges on Input%. CV% will be decremented when a rising edge is seen for Input% as long as CV% is greater than 0 AND Reset% is 0.

Example

Target/ Language Restrictions

None.

See Also

  • CTU

  • CTUD

________________________________________________________________________________

Ctu - Up Counter

This an Up-counter function that is used to signal when a count has reached a maximum value.

The counter counts the number of rising edges (positive transition) detected on input and increases CV% (current value) output. As CV% reaches the maximum value (MV%), the output Q% is set to 1 and the counter stops counting. Reset% is used to reset the counter: both Q% and CV% are cleared to 0.

Arguments

Input%

The value to be counted. A transition of Input% from zero to a non-zero value causes CV% to be incremented.

MV%

This is the maximum value to which CV% is to be incremented.

Reset%

If this is set to 1, Q% and CV% are cleared to 0.

Return Values

Q%

This value is set to 1 when CV% has the value of MV%. Q% is cleared to 0 at all other times.

CV%

This is the incremented count of rising edges on Input%. CV% will be incremented when a rising edge is seen for Input% as long as CV% is less than MV% AND Reset% is 0.

Example

Target/ Language Restrictions

None.

See Also

  • CTD

  • CTUD

________________________________________________________________________________