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

Exp - Exponential Function

This is a mathematical function that return the exponential (e^expression) of a floating-point value.

Arguments

IN

A floating point value.

Return Values

Q

e raised to the power of IN.

Example

Target/ Language Restrictions

None.

See Also

  • LN

________________________________________________________________________________

Filter - First-order Digital Filter

This is a signal processing function that returns the output of a first-order filter function with input expression as the input. The time-constant of the filter depends on the time-constant specified, and how often the FILTER statement is executed. The function can be used to filter integer and floating-point values.

Note that the FILTER block cannot be used in the INITIAL, BACKGROUND, ERROR or EVENT tasks.

Arguments

IN%/ IN

The integer or floating-point value to be filtered.

time%

The number of calls over which the filter is to be applied. If time% is set to 0, the option module will trip with a Maths error (trip 50).

Return Values

Q/ Q%

The filtered input value.

Example

The following code shows how a filter can be applied to a parameter value.

If a step change of 0 to 1000 is applied to #18.12, the output of the filter will be as shown in the following diagram.

Target/ Language Restrictions

None.

See Also

  • AVERAGE

________________________________________________________________________________

Float - Integer to Floating Point Conversion

This function converts an integer value to a floating-point value.

Arguments

IN%

The integer value to be converted.

Return Values

Q

The floating-point version of IN%.

Target/ Language Restrictions

None.

See Also

  • FLOAT32

  • INT

________________________________________________________________________________

Float32

This function converts a floating-point value to the IEEE single-precision format and forces the value into a DPL 32-bit signed integer. The integer can then be transferred over CTNet or fieldbus. Accuracy of the value is mainted to 7 digits.

This allows real decimal values to be transferred over CTNet without any need to convert to fixed point accuracy, which needs to be known at each end of a cyclic link. Some PLCs also use the IEEE Single Precision format to send real numbers, so Float32 will allow such a number to be decoded when received, or encoded for transmission to the PLC.

NOTE: This block converts both an IEEE Single Precision number AND a real decimal number on the same pass. If only one conversion is required, the un-used input should be set to 0. The corresponding output will be set to 0 when Float32 has completed.

Arguments

RealI

The floating-point value that is to be converted into IEEE single-precision and returned in output IntO%

IntI%

An integer containing an IEEE single-precision value that is to be converted in a DPL floating-point value in output RealO.

Return Values

RealO

The floating-point version of the IEEE single-precision value embedded in the input IntI%.

IntO%

The IEEE single-precision value (embedded into an integer) of the floating-point input RealI.

Target/ Language Restrictions

None.

See Also

  • FLOAT

  • INT

________________________________________________________________________________

GETCAN

This function retrieves a received CAN frame from a slot in the SM-CAN or UD77-CAN option. It should be used after a call to CANStatus or CANStatusAll indicates that a message has been received in a slot.

Arguments

Slot%

Specifies the CAN slot from which the received frame is to be returned. For Unidrive SP, the parameter is also used to indicate that option slot containing the SM-CAN option from which the frame is to be obtained.

For UD77, the argument can take the following values.

Return Values

Q%

The CAN slot status.

Value

Meaning

0

CAN slot read failed.

1

CAN slot read successful.

Len% - 0 to 8

The number of data bytes in the received message.

Word0%

The 32-bit word containing bytes 0 (LSB) to 3 (MSB) of the CAN data field. Unused bytes will be cleared to zero.

Word1%

The 32-bit word containing bytes 4 (LSB) to 7 (MSB) of the CAN data field. Unused bytes will be cleared to zero.

Time%

A timestamp which can be used to determine the order in which slots received frames. It does not provide accurate timing. On UD77-CAN, only slots 0 through 7 return the timestamp; slots 8 to 15 return -1.

Target / Language Restrictions

Only available on SM-Applications, SM-Applications Lite and UD77-CAN.

See Also

  • CANConfigEvent

  • CANGetNodeAddr

  • CANReady

  • CANSetup

  • CANStatus

  • CANStatusAll

  • EnableCANTrips

  • PUTCAN

  • ResetCANTimer

________________________________________________________________________________