Reading guide:
Sometimes we need to get the current oneThe serial number of the CPU or memory cardSo there is such a directive in the blog that can achieve our needs. For details, see the following instructions.
1. Read the Serial Number of the S7-1200 CPUCreate a new project in the TIA Portal, add a new DB block, and create the variables "Type" and "Data" in the DB block, where the "Type" data type is uint type, the initial value is set to 0, and the "Data" data type isim0_data, the data type needs to be manually entered at the data type, and then the carriage return takes effect, which is used to store the read information, as shown in the following figure
Add the command get im data to ob1, which is located under the diagnostics folder in the extended command, as shown in the following figure:
laddr is a hardware identifier, which can be viewed under the system constants in the PLC default variable table, as shown in the following figure
Compile the program and monitor the "data" variable in the DB block, as shown in the figure below, where the serial number is the CPU serial number, and you can also see the order number, hardware version number, firmware version and other information from the variables.
2. Read the serial number of the S7-1200 memory cardFor reading the serial number of the S7-1200 memory card, you only need to enter the Get IM Data command to enter the hardware identifier to modify it to "local mc", and the rest remains unchanged, as shown in the figure below.
The author doesn't have a memory card here, so I won't do a ** demonstration.
Three: SummaryNote that our CPU firmware needs to be in 42 and above, the above is how to obtain the serial number of the S7-1200 CPU or memory cardIf there is any error in the content, please contact us.
Article**: Original of Jicheng Training Network, Author: Luo Hao;Unauthorized prohibition**, offenders will be prosecuted!
Tips: Attention, ** is the greatest encouragement!Thank you for your support!If you want to know more exciting content, come and pay attention to the training network
Mitsubishi FX3U and 485 relay module communication applications.
This article allows you to fully grasp the functional blocks in ESME.
PLC Basics: Must-Grasp Array Variable Applications!
5-Step Breakdown: Assembly Line Conveyor Belt Control Case.
An article interprets the Omron CP series PLC family.