<< Click to Display Table of Contents >> Manual > Monitoring system construction guide > Establishing major functions > Logging/trend graph > Using logger actions > Collection of logger action samples > Receives logging requests from the PLC |
overview
If you want to save the values calculated by PLC ladder logic in log data, you can receive the bit signal indicating the end of the calculation from the PLC as a handshake bit, and log the results by turning that bit ON/OFF. In such a situation, you can set the event log trigger to occur with the handshake bit tag.
Here, we will use a Mitsubishi PLC ladder sequence as an example to explain how to use "D0002" as the handshake bit and log the data of "D0000" and "D0001".
Download the sample
The creation examples shown on this page are provided with samples.
The sample can be downloaded from below.
This sample specifies a driver for connecting to a Mitsubishi Electric PLC. Therefore, if you want to run the sample without an actual PLC, please use online debugging.
Online debugging can be performed by clicking the red arrow button. This function is a debug mode that runs virtually online without actually connecting. Since there are no communication errors even when not connected to the actual device, it is possible to run the sample.
|
Setup Procedure
Tag settings
1.Select Mitsubishi Electric's Ethernet connection, equivalent to the Q series, as the connection driver.
For actual connections, please refer to the Equipment Connection Guide.
2.Set the tags "U01.F01.D0000" and "U01.F01.D0001" for data collection and the tag "U01.F01.D0002" for handshake.
Action Settings
1.Add logger action "A01".
Create a time field and tag fields "D0000" and "D0001".
2.From the Text Settings tab of A01, set the file name and destination of the log file (below is an example setting).
3.In the "When processing is completed" script, write the process to turn off the handshake bit.
Here, write it as follows:
(script content)
U01.F01.D0002 = 0 |
Event Settings
1.Add one Tag event.
Set it to occur when "U01.F01.D0002" becomes 1, and specify A01 as the action to be executed.
In addition, on the ladder side, set "D0002" to ON when you want to instruct logging.
Tag event detects that D0002 is ON and the action is executed.
Commentary
Below is a ladder sample for Mitsubishi PLC.
When the ladder program is executed, data is set to "D0000" and "D0001", and "1" is set to "D0002" for handshake. When FA-Server is put online, Tag event occurs because the value of "D0002" is "1", and the first logging takes place. After logging is finished, the end script of the logger action writes "0" to "D0002".
In this ladder example, when "D0002" becomes "0," PLC executes each MOVP command according to the ladder program's condition [ = D2 K0], setting "D0002" to "1" again and repeating logging. This operation is repeated until FA-Server goes offline.