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

SetUserId

This function provides a means of setting the user program ID parameter #81.49.

Arguments

ID% - -32768 to 32767

Any value passed into this argument will be stored in parameter 49 in the setup menu and will be visible but not modifiable via the keypad.

Target/ Language Restrictions

Only available on SM-Applications and SM-Applications Lite.

________________________________________________________________________________

SGN

This is a Maths function that returns a value indicating the negative or positive sign of the input expression. Where the input value is positive or zero, it returns the valve of 1. Where the input value is negative, it returns the value of -1. The function is overloaded and will accept integer or floating-point values.

Arguments

In%/ In

The input value to be inspected.

Return Values

Q%

An indication of the sign of the input.

Value

Meaning

-1

The input is negative.

1

The input is zero or positive.

Target/ Language Restrictions

None.

________________________________________________________________________________

SHIFT

The SHIFT function simply shifts an input integer value by a specified number of bits, either left or right.

Arguments

IN%

The input value to shift.

Shift%

The number of bits to shift. If Shift% is positive, INT% is shifted left; if Shift% is negative, IN% is shifted right.

Return Values

Q%

The shifted value.

Example

Target/ Language Restrictions

None.

See Also

  • DATASTUFF

  • SHIFTLR

  • SPLITTER

  • STUFF2/STUFF4/STUFF8

________________________________________________________________________________

Shiftlr

The SHIFTLR function simulates a shift register with edge triggered left and right shift inputs. The shift register shifts left or right on a rising edge of its ShiftL% and ShiftR% inputs.

Arguments

IV%

The initial value to which the internal shift register is to be set when the Reset% input is set.

Note: The first time the block is executed, the internal shift register will be pre-loaded with IV% regardless of the value of the Reset% input.

ShiftL%

The left shift trigger. When a rising edge (zero to non-zero) is seen on this input, the internal shift register is shifted left by nShift% bits.

ShiftR%

The left shift trigger. When a rising edge (zero to non-zero) is seen on this input, the internal shift register is shifted right by nShift% bits.

nShift%

The number of bits to shift on a rising edge.

Reset%

When non-zero, the internal shift register is set to the value of IV%.

Return Values

Q%

The value of the internal shift register.

Example

Target/ Language Restrictions

None.

See Also

  • DATASTUFF

  • SHIFT

  • SPLITTER

  • STUFF2/STUFF4/STUFF8

________________________________________________________________________________

SignedBottomWord

This command takes a 32-bit integer value from the input In%, and converts the lower 16-bits to a signed 16-bit value, in the lower 16-bits of the output Out%.

Arguments

In%

Signed 32-bit value.

Return Values

Out%

The lower 16 bits of the input sign extended to a 32-bit value.

Example

Target/ Language Restrictions

This function is only available on SM-Applications and SM-Applications Lite.

See Also

  • PutBottomWord

  • PutTopWord

  • SignedTopWord

  • UnsignedBottomWord

  • UnsignedTopWord

________________________________________________________________________________