You can add field devices to the communication manager by selecting the field device manager node (for example, CANopen or Modbus manager) in the and clicking the green plus sign. Alternatively, you can right-click the field device manager node in the and execute the command.
As a prerequisite, the device must be available in the dialog box.
Step |
Action |
---|---|
1 |
Select the field device manager node (CANopen or Modbus manager) in the and click the green plus sign, or right-click the field device manager node and execute the command from the contextual menu. Result: The dialog box opens. |
2 |
In the dialog box, select from the list box .Note: You can filter the devices by brand by clicking the list box . |
3 |
Select the device of your choice from the list below. |
4 |
Rename your device by typing a name in the textbox.
NOTE: Do not use spaces within the name. Do not use an underscore character (_) at the end of the name.
If you do not rename the device, a name is given by default. Naming the device meaningfully may ease the organization of your project. |
5 |
Click the button.Result: The field device is added to the field device manager.
NOTE: The dialog box remains open.
You can do the following:
|
To get diagnostic information of devices on CANopen, use the CAA_CiA405.library.
You can use the options CANopen configurator to manage potential configuration inconsistencies.
and in the tab of theTo optimize the CAN master performance, CAN diagnostics are external from the CAN master in the controller. The CAN diagnostic structure is defined in the CanConfig Extern library available in the
.
The structure g_aNetDiagnosis
contains the most recent diagnostic information from the slaves. The structure is updated every time a slave is configured.
This structure can be used within the program to do the following:
Monitoring the response of the slaves configured via SDO messages.
Monitoring the master for abort messages from the slaves before allowing a machine / application start-up.
This structure must be in place and active within the user application during testing, debugging and commissioning of the application. When the machine and its controlling application have been commissioned and validated, then it would be possible to disable this code from execution to reduce traffic on the CANopen network.
However, if during the lifecycle of an application and the machine or process that it controls, slaves are added or replaced in the operational system, then the diagnostic structure should continue to remain active in the application.
WARNING | |
---|---|
After adding the CanConfig Extern library to your application, use the
definition within your application to test for SDO abort messages from the CAN slaves.The following code example illustrates the use of the CAN diagnostic data structure:
IF g_aNetDiagnosis[CAN_Net_Number].ctSDOErrorCounter = 0 THEN
(* No error is detected in the configuration*)
ELSE
(* An error has been detected during configuration. Get the latest error information.*)
// node ID of the slave which sent the abort code
ReadLastErrorNodeID := g_aNetDiagnosis[CAN_Net_Number].usiNodeID;
// index used in the aborted SDO
ReadLastErrorIndex := g_aNetDiagnosis[CAN_Net_Number].wIndex;
// subIndex used in the aborted SDO
ReadLastErrorSubIndex := g_aNetDiagnosis[CAN_Net_Number].bySubIndex;
//SDO abort code
ReadLastErrorSdoAbortCode := g_aNetDiagnosis [CAN_Net_Number].udiAbortCode;
(* Do not allow the start-up or other operation of the machine or process *)
END_IF
CAN_Net_Number
would be 0 for the CAN0 port and, if the controller is so equipped, 1 for the CAN1port.