Block
Mask
Description
The ML605EX1 PWM In block is used to retrieve Duty cycle and Frequency values from Pulse Width Modulated signal connected to digital input lines of an OP5351 carrier connected to an ML605 development board via an OP5600 I/O box.
The period and the duty cycle values are transferred from the bitstream to the RT-LAB model through the DataOut port allocated to the ML605EX1 PWM In, via the PCIe bus of the target computer; quick processing by the ML605EX1 PWM In block is made to supply the frequency and the duty cycle.
Each ML605 bitstream using digital input channels comes with a configuration file; this file lists the Data port number and their corresponding OP5351 location in the system. The configuration file name is the same as the bitstream file name entered in the OpCtrl ML605EX1 block, with the extension .conf instead of .bin.
This configuration file uses three parameters to describe the selection of the OP5351 channels:
- the Group number (in the range 1 to 3) is the group of the OP5600 I/O box connected to the ML605 development board, vhere the OP5351 is installed,
- the Section A or B indicates the side of OP5600 I/O box.
- the Sub-Section, 1 to 4, is a subset of 8 data values connected to the port: subset 1 returns values for the 8 first channels of one section of the OP5351, subset 2 returns values for the 8 next channels, etc.
The user must refer to the configuration file for selecting the port number for the desired digital input channels. The ML605EX1 PWM In block then parses the configuration file and displays the Slot, Section and Sub-section values corresponding to the port number in the 'Slot info' parameter.
The DataOut ports connected to Pulse Width Modulation input signals are identified by the acronym 'PWMI' in the configuration file.
The maximum number of digital input channels controlled by one ML605EX1 PWM In is limited by the size of the subset of channels in one sub-section, which is fixed to 8 in the current implementation.
Parameters
Controller Name | Bind this block to an OpCtrl ML605EX1 block by entering the same 'Controller Name' as specified in the OpCtrl ML605EX1 block The OpCtrl ML605EX1 block controls initialization of the settings of one specific ML605 card in the system. |
---|---|
DataOut port number | Set the number of the DataOut port to be controlled by this block, in the range [1:32]. |
Slot info | This non-editable parameter displays the physical location of the digital input channels related to the selected DataOut port, as obtained from the parsing of the configuration file. |
Available channels | This non-editable parameter specifies the maximum number of PWM input values returned by the DataOut port as defined in the RT-XSG bitstream.Each PWM input value implies one digital line. |
Number of PWM lines | Set the number of PWM lines to be driven by the block. This value must be less than or equal to the value of the 'Available channels' parameter. |
Sample time (s) | This parameter allows the user to specify the block sample time in seconds. The default value is 0, which specifies a continuous sample time (note that the sample time is borrowed from the separated subsystem) while -1 specifies an inherited sample time. A functionnality block and its associated controller block must execute at the same sample time. |
Inputs
This block has no inputs.
Outputs
The block has three (3) outports.
Hz: This outport returns the frequency of PWM signal; it is specified Hz. A null value is returned when the line is unconnected. The minimal frequency measured is 100 Hz.
Duty: This outport is the duty cycle of PWM signal. A null value is returned when the line is unconnected.
Status: The Status output returns the following values:
Value | Description |
---|---|
0 | No error. |
-1 | Block could not be matched with an OpCtrl ML605EX1 block (check the 'controller Name' value), or ML605 card initialization problem. |
-2 | Internal memory initialization problem. |
-3 | Data reception error : the block received less data from the ML605 card than the value specified in the 'Data outport width' parameter. Missing data were replaced by 0. |
-4 | Data reception error : the block received more data from the ML605 card than the value specified in the 'Data outport width' parameter. Extra data were discarded. |
Characteristics and Limitations
Unexpected behavior: When the duty cycle value returned from bitstream is non-null and the period is null, negative values are outputted. This behavior could be explained by a wrong bitstream file.
Block limitations: The frequency of the PWM signal should be between 100 Hz to 190 kHz to ensure the correct functionality.
Direct Feedthrough | No |
---|---|
Discrete sample time | Yes |
XHP support | Yes |
Work offline | No |