IO_PWFM_SET_CONFIG (FUN)

Description

This function is used to configure the PWFM channel.

The PWFM channel can be in different modes depending on the hardware. Check the technical manual for detailed information about possible modes. The firmware protects wrong usage. If the user tries to use a channel in the wrong mode, the function gives an error code and sets the channel to the disabled mode.  Below is a list of valid configuration parameters in different modes.

 

Digital Output

Direct PWFM

Step Motor

i_PwfmMode

X

X

X

i_PwfmChn

X

X

X

 

The PWFM channel can be used in the following modes:

IO_PWFM_MODE_DISABLED

PWFM channel is disabled and output is always set to off state.

 

IO_PWFM_MODE_DIGITAL_OUTPUT

PWFM channel is used as digital output and user uses boolean variable

o_PwfmChnX_DoState to set the wanted output state.

 

IO_PWFM_MODE_DIRECT_PWFM

In direct PWFM mode the user can set the pulse ratio and frequency for PWFM channel.

In low frequencies, the user must notice that the channel executes always one pulse after the new values are used.

This means for example in 10 Hz frequency that the new values are taken in use after 100 ms.

 

IO_PWFM_MODE_STEP_MOTOR

In step motor mode, the user sets number of wanted pulses which the channel generates.

Width and frequency can be set through normal output variables in PLC configuration.

 

Inputs

Input variable name

Data type

Range

Description

i_PwfmMode

IoModes

 

Used mode

i_PwfmChn

WORD

 

PWFM channel

 

 

 

 

Source file Topic000509.htm

Last updated 21-Feb-2025