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

Putchar - Write Character to rs485 Port

This operation transmits a byte value over the RS485 port on an option.

The RS485 port must be configured in a User Mode.

Arguments

Char% - 0 to 255

The value to transmit. Only the bottom 8 bits (LSB) of the value will be transmitted.

Return Values

Result%

Returns the status of the operation.

Value

Meaning

0

Fail

1

Success

Target/ Language Restrictions

This function is only available on the SM-Applications module, UD7X and MD29 options.

See Also

  • GETCHAR

  • GETKEY

  • PUTKEY

  • PUTBLOCK

________________________________________________________________________________

Putkey - Write Character to Port

This operation transmits a byte value over the RS485 port or RS232 port on an option.

On SM-Applications the character is transmitted over the RS485 port. On MD29 and UD7X options, the character is transmitted over the RS232 port.

On SM-Applications the RS485 port must be set to a User Mode.

On UD7X/ MD29 the RS232 port must be set to dumb terminal mode.

Arguments

Char% - 0 to 255

The value to transmit. Only the bottom 8 bits (LSB) of the value will be transmitted.

Return Values

Result%

Returns the status of the operation.

Value

Meaning

0

Fail

1

Success

Target/ Language Restrictions

This function is only available on the SM-Applications module, UD7X and MD29 options.

See Also

  • GETCHAR

  • PUTCHAR

  • GETKEY

  • PUTBLOCK

________________________________________________________________________________

PutTopWord

This command takes the lower 16 bits of the 32-bit integer value from the input, In1%, and puts them in to the upper 16bits of the output, Out%. It also takes the lower 16 bits of the 32-bit integer value from the second input variable, In2%, and puts them in to the lower 16 bits of the output variable, Out%.

Arguments

In1%

Signed 32-bit value.

In2%

Signed 32-bit value.

Return Values

Out%

Returns the combined value of the lower 16 bits of In1% and the lower 16 bits of In2%.

Example

Target/ Language Restrictions

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

See Also

  • PutBottomWord

  • SignedBottomWord

  • SignedTopWord

  • UnsignedBottomWord

  • UnsignedTopWord

________________________________________________________________________________

PWM

This function block will create a PWM digital output from a given duty and frequency/time base.

Arguments

Duty% - 0 to 1000

The duty factor for the mark space ratio, e.g. 50% duty = Q high for 50% of the cycle and low for the other 50%.

Time%

The cycle time (or carrier frequency 1/T) in milliseconds. The maximum carrier frequency for the PWM wave form is limited by the minimum update time of 1ms. The following table shows the resolutions which can be achieved. The cycle time must give enough resolution for the PWM block to work correctly. The cycle time must be at least 2 times the task scheduling period. For example, in a clock task running once every 10ms, the cycle time should be at least 20ms so that the PWM is calculated over at least 2 samples.

Return Values

Q%

The PWM digital output value

The task the function block is used within determines the achievable duty resolution. The function block should only be used in a cyclic task like Clock, Pos0 or Speed.

Target/ Language Restrictions

None.

See Also

  • TOFF

  • TOFF2

  • TOFFRET

  • TON

  • TON2

  • TONRET

  • PT

  • PTD

  • TCYCLIC

________________________________________________________________________________