Introduction
In this article we will be covering the steps required to add custom NCK data items to the default Siemens 840D SL configuration install. It is expected that the user has already undergone the steps outlined in the article Siemens 840D SL - Default Monitoring Configuration Install to form the base of the configuration.
Overview of Configuration Steps
- Establish a physical connection between the machine and the programming device.
- Complete the steps outlined in Siemens 840D SL - Default Monitoring Configuration Install, stopping just before downloading the updated program to the machine.
- Use NCVar Selector utility to extend the default provided MM Siemens TIAv18 NCVAR.awl output file as described in Siemens 840D SL - Adding Data Items With NCVar Selector
- Add the required FB2 gathering calls for the new data items to MM_FC, updating the MM_FB2_STATUS and MM_OUTPUT data blocks as required to incorporate the newly selected data items.
- Add the call to MM_FC block to OB1 cyclic block.
- Download the updated program to the machine.
Optional - Instructions for Custom Data Items
We will demonstrate how to do a custom installation using a worked example where we add the ability to monitor Torque actual current for 3 drives.
Note: Work with your customer support liaison and see the article on Siemens 840D SL - Adding Data Items With NCVar Selector for more about how to add additional data items using the NCVar Selector process.
After having included the new desired data items from NCVar Selector and generating a custom NCVAR file, we need to include this into the project. In this example we have named the file containing the additional torque data MM Siemens TIAv18 NCVAR.awl.
Just as above, we Add an external file to the external sources in the project tree. We then load the updated NCVAR file saved as MM Siemens TIAv18 NCVAR.awl into the project.
We will need to compile the newly included source file.
We will again be prompted with the dialog block signifying this will rewrite the output.
Note: If you followed the steps provided for the default installation, this will as warned overwrite the DB120 data block with the new values provided in MM Siemens TIAv18 NCVAR.awl.
When completed we observe that the project tree looks the same as before, as all we've done is overwrite the DB120 block. Inspecting the DB120 block we can see that the torque variables we added are now present at the end of the block.
Next we will define the output registers in MM_OUTPUT where these blocks will live. We will add 3 rows to the bottom of the data block
We add entries for each value, giving them the same symbol names as was defined in NCVAR Selector and assigning them each the data type REAL to represent their type as doubles.
Next we need to prepare the status registers for the new FB2 calls. We will append these to MM_FB2_STATUS data block.
We add 3 of these, as addressing each drive in the NCK requires an individual FB2 call, so we will have 3 new sets of FB2 status Registers FB2_4, FB2_5, and FB2_6.
| FB2_X_Error | BOOL | 1: Indicates negative acknowledgement of job or execution of the job is impossible |
| FB2_X_NDR | BOOL | 1: Job successfully executed. Data is available. |
| FB2_X_State | WORD | See section on Error Identifiers (pg 161) in 840D SL PLC Function Manual A5E47433877B AB |
With all of our input, output, and status data blocks created we need to add the calls to FB2 GET gather call.
Navigate to MM_FC and from the right-click context menu insert a new network
We see the new blank network presented at the bottom.
Note: Depending on where you opened the context menu, it may have been mixed in. You can reorder or re-create a blank network to the bottom.
Give the network a good name, it is recommended to follow the convention of the file by incrementing the index of the name, and insert the starter FB2 template text.
Here we follow the convention to name the network "MachineMetrics FB2 4" to signify the 4th FB2 entry and input the following template:
CALL "FB GET", "MM_FB2_4"
Req := M 100.0
NumVar :=
Addr1 :=
Unit1 :=
Column1 :=
Line1 :=
Addr2 :=
Unit2 :=
Column2 :=
Line2 :=
Addr3 :=
Unit3 :=
Column3 :=
Line3 :=
Addr4 :=
Unit4 :=
Column4 :=
Line4 :=
Addr5 :=
Unit5 :=
Column5 :=
Line5 :=
Addr6 :=
Unit6 :=
Column6 :=
Line6 :=
Addr7 :=
Unit7 :=
Column7 :=
Line7 :=
Addr8 :=
Unit8 :=
Column8 :=
Line8 :=
Error := "MM_FB2_STATUS".FB2_4_Error
NDR := "MM_FB2_STATUS".FB2_4_NDR
State := "MM_FB2_STATUS".FB2_4_State
RD1 :=
RD2 :=
RD3 :=
RD4 :=
RD5 :=
RD6 :=
RD7 :=
RD8 :=When we input the call template, we specify the as of yet uncreated data block "MM_FB_4" in accordance with the existing convention. TIA will then ask us to create the datablock. This is what we want so we press 'OK'
We can then see our base template for a new FB2 call in MM_FC.
Note: Keen eyes might notice that TIA Step 7 has allocated a tag for the Req parameter to represent M100.0 for us
We then specify the newly added variables we want to monitor from the NCK that are loaded into the "NCVAR" data block. We specify their output location in "MM_OUTPUT" data block for monitoring. Here is the full example for the first call to load V1_R0078_RAW_DRIVE1.
- We set the NumVar parameter to 1 to indicate we are reading 1 value.
- We set the Addr1 to the value in DB120.V1_R0078_RAW_DRIVE1
- We set the status registers for FB2 call to point to the MM_FB2_STATUS.FB2_4_ status registers
- We set the output register in MM_OUTPUT.V1_R0078_RAW_DRIVE1
Note: If we are reading multiple parameters from each drive 1, 2, 3 they can be included in the corresponding FB2 call and the NumVar value incremented to account for the number of parameters. We simply cannot read from two separate drives in the NCK using the same call to FB2.
We repeat this process for FB2_5 and FB2_6 to track V1_R0078_RAW_DRIVE2 and V1_R0078_RAW_DRIVE3. When completed we have 6 networks visible in MM_FC
Then we are set up. OB1 should still have our call to MM_FC which will invoke these calls as depicted.
If that is not the case, we can add it now.
Just as before we can download the the software changes to the PLC.
Instructions for failure recovery
If something goes wrong in the compilation process, the controller will alarm. The operator and technician can clear the alarm from the HMI and then correct the error in the programming and then re-download a corrected program to the PLC.
In the case that there is a situation that cannot be resolve expediently, the technician should load the preserved backup from the initial steps of this guide to restore the machine to it's original working state.
If you have questions about this process, please reach out directly to your customer success manager or contact support@machinemetrics.com.
Comments
0 comments
Article is closed for comments.