日本語
English
Steps for FFT Analysis of Analog Input and Graph Display (3/5)
Procedure
- Step 4: Prepare Display Data
- 4-1. Create display data
- Step 5: Create HMI (NA Series) Screens
- 5-1. Add the HMI and map variables
- 5-2. Create a data group
- 5-3. Add a line graph
- 5-4. Add switching buttons
- 5-5. Calculate the X-axis labels
- 5-6. Map variables for the X-axis labels
- 5-7. Horizontal axis of the line graph
- Step 6: Analog Graph
- 6-1. Map variables
- 6-2. Add a data group
- 6-3. Add a page
Step 4: Prepare Display Data
4-1. Create display data
Create the array PowerSpectrumGraph[800] as a global variable for graph display
The 2048 values of the FFT result PowerSpectrumData are split into three ranges, 0-799, 800-1599 and 1600-2047, and the graph display area is changed between them
The area is switched with the GraphPage[0] to [2] buttons
The 2048 values of the FFT result PowerSpectrumData are split into three ranges, 0-799, 800-1599 and 1600-2047, and the graph display area is changed between them
The area is switched with the GraphPage[0] to [2] buttons
Step 5: Create HMI (NA Series) Screens
5-1. Add the HMI and map variables
Add an HMI (NA series) with Add Device
In Variable Mapping, right-click GraphPage and PowerSpectrumGraph among the PLC user variables and create device variables
GraphPage is for the buttons that switch the graph display data, and PowerSpectrumGraph is the data shown in the graph
In Variable Mapping, right-click GraphPage and PowerSpectrumGraph among the PLC user variables and create device variables
GraphPage is for the buttons that switch the graph display data, and PowerSpectrumGraph is the data shown in the graph
5-2. Create a data group
Create a data group to display the graph
Add a data series with the [+] button, name it 'FFT', set the type to 'Array' and the data type to Double
This matches the data type because the variable PowerSpectrumGraph being displayed is an LREAL array
Add a data series with the [+] button, name it 'FFT', set the type to 'Array' and the data type to Double
This matches the data type because the variable PowerSpectrumGraph being displayed is an LREAL array
5-3. Add a line graph
Add a line graph to the page
Set DataGroup0 created in 5-2 as the data group, and press the [+] button for traces to open the trace settings screen
Add a data series in the trace settings with the [+] button and set the 'FFT' data series created in 5-2
Set the number of display points on the horizontal axis to 800
Also change the appearance as you like, such as hiding the legend or the right axis
Set DataGroup0 created in 5-2 as the data group, and press the [+] button for traces to open the trace settings screen
Add a data series in the trace settings with the [+] button and set the 'FFT' data series created in 5-2
Set the number of display points on the horizontal axis to 800
Also change the appearance as you like, such as hiding the legend or the right axis
5-4. Add switching buttons
Add three momentary buttons and set the PLC's GraphPage(0) to (2) as the variables in the button properties
5-5. Calculate the X-axis labels
Calculate the resolution with First_Run_Mode (ON for one scan at the start of operation)
Resolution = 10 kHz / 4096
Create the global variables GraphX_min (minimum) and GraphX_max (maximum) and calculate the minimum and maximum of the X axis according to the switching buttons
Resolution = 10 kHz / 4096
Create the global variables GraphX_min (minimum) and GraphX_max (maximum) and calculate the minimum and maximum of the X axis according to the switching buttons
5-6. Map variables for the X-axis labels
In Variable Mapping, right-click GraphX_min and GraphX_max among the PLC user variables and create device variables
5-7. Horizontal axis of the line graph
Assign GraphX_min and GraphX_max to the minimum and maximum of the line graph's horizontal axis respectively
Step 6: Analog Graph
6-1. Map variables
In Variable Mapping, right-click FFTData among the PLC user variables and create a device variable
6-2. Add a data group
Create a new data series and assign FFTData
6-3. Add a page
Create a new page and paste a line graph
Assign the data group created in 6-2 to the data group
Add the analog data series created in 6-2 to the data series in the trace settings
Set the left axis min/max to -100 to 100, the horizontal axis min/max to 0 to 100 and the number of display points to 100, so the first 100 ms is displayed
Also add buttons for switching pages
Assign the data group created in 6-2 to the data group
Add the analog data series created in 6-2 to the data series in the trace settings
Set the left axis min/max to -100 to 100, the horizontal axis min/max to 0 to 100 and the number of display points to 100, so the first 100 ms is displayed
Also add buttons for switching pages
On the next page
The HMI is ready to display the FFT results
On the next page, we create test data and check that the FFT calculation works correctly and can be graphed
