日本語 English

Steps for FFT Analysis of Analog Input and Graph Display (3/5)

Procedure

Step 4: Prepare Display Data

4-1. Create display data

Add a high-speed analog unit (NX-HAD401) to the CPU rack
Sysmac Studio FFT CPU rack
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

Step 5: Create HMI (NA Series) Screens

5-1. Add the HMI and map variables

Add the HMI and map variables
Sysmac Studio FFT add 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

5-2. Create a data group

Create a data group
Sysmac Studio FFT create 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

5-3. Add a line graph

Sysmac Studio FFT add 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

5-4. Add switching buttons

Sysmac Studio FFT 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

Sysmac Studio FFT calculate 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

5-6. Map variables for the X-axis labels

Sysmac Studio FFT map variables for 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

Sysmac Studio FFT horizontal axis of 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

Sysmac Studio FFT map variables
In Variable Mapping, right-click FFTData among the PLC user variables and create a device variable

6-2. Add a data group

Sysmac Studio FFT add data group
Create a new data series and assign FFTData

6-3. Add a page

Sysmac Studio FFT add 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

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

Comments