You are on page 1of 8

DeviceNet Hardware WAGO - Connectors

Connectors on CIP and on DeviceNet Buscoupler


CIP
shield CAN high (wh) 24V (rd) Plastiknose for allingning the connector is very sensitiv !!
The DeviceNet can have a maximum of 64 Nodes in total (AWC is node 0 and Master by default)
24V, GND - twisted pair CAN Low , CAN High twisted pair

CAN low (bl) GND (bk) Microstyle Connector, 5 Pin (refer to MV-Controller
Users Guide for pinout)

120 Ohm resistor between CAN high and CAN low Connect 24V and Ground to Buscoupler and CIP ! (see overview on next page)

I/O

On DeviceNet nodes adjust MACID, BAUDRATE by DIP switches


120Ohm

I/O
On AWC adjust LOCAL_ID statement using "config_c": AWC / CIP MACID 0..63, Master BAUDRATE 125kBaud, (MACID:default 0) 250kBaud, or 500kBaud

I/O
AppsNote: DeviceNet

DeviceNet Hardware WAGO - Overview


24V and Ground supply for DeviceNet-Master (AWC / CIP)

Buscoupler

2 InputModules

2 Output- End
Modules module

24V
DIP-switches for MACID and BAUDrate

and Ground available on all modules

120 Ohm resistor between CANHigh und CAN Low

24V and Ground supply for DeviceNet-Bus and Bridge to 24V and GND trails (going through all modules)

There are modules for galvanic separation, that allow to apply different voltages for switching.

AppsNote: DeviceNet

DeviceNet Software (Monitor-Commands)


Monitorcommand :
.devicenet check the Devicenet-Status, (compare to Net-Command for TCP/IP) new system- no DeviceNet configured, yet. OK: D13 Siemens (Infineon) Germany

faulty:

E12 from Taiwan

Powerup problem: The DeviceNet Chip on the AWC (s.o.) isnt initialized in a controlled manner during system bootup. The DeviceNet Buscoupler may go into error condition for that reason (red BUS OFF LED on buscoupler is going on). Recommendation: Not all DeviceNet components supply an automatic ErrorReset that re-initialize communication after 20 sec. Switch on 24V-voltage for DeviceNet logic by relais after bootup of the AWC. New since V+ 13.0 G3, 13.1 J6, 13.1 S2, 13.1 D3 and 14.0 G2 a counter for Missed packets. FCMND(lun,761),$input Accessable from V+ with: can.lost = INTB($input, 11) Monitorcommand / V+Instruction : (undocumented) .dn.restart Reset of DeviceNet communication (takes around 20 sec)

AppsNote: DeviceNet

DeviceNet configuration - SCAN THE DEVICENET


Scan the DeviceNet:

Input size, Output size:

In general those two values represent the numbers of Input or Output BYTES available on a DN node with a certain MAC ID.
Each Input or Output module of the WAGO hardware (see overview) contains four Inputs / Outputs (= 4 Bit). Values for Input and Output size are rounded to the next full Byte. Attention: The scan result for Input size is missleading, as the buscoupler is marked as one additional Input-byte. Example: Wago Node with 3 Input- and 5 Output-modules: (In total 12 Inputs and 20 Outputs) Input size = 2 Bytes (rounded) + 1 Byte (coupler) = 3 Output size = 3 Bytes (rounded)
Set by DIP switches on Buscoupler

Memorize these informations, as they are needed for subsequent DeviceNet configurations.

If problems occur during scan, check if 24V/GND is connected to the DeviceNet logic (connector on Buscoupler) AND to the DNMaster on the AWC (connector on CIP)

AppsNote: DeviceNet

DeviceNet configuration - LOCAL, MACID


In case of this error, the V+ errorhandling could execute the DN.RESTART instruction (only for DN components w/ automatic error reset), or switch off and on the 24V suply for the DeviceNet logic.

Address (MACID) of DeviceNet Master (AWC) default=0

DeviceNet scanner speed. MUST meet the DIP switch settings of all DeviceNet nodes.

Insert results from previous DN scan here

If a DeviceNet Node has Inputs that are relevant for the system safety, it can be told to force a High Power Disable with this statement..

AppsNote: DeviceNet

DeviceNet configuration - I/OMapping


Output-Mapping (mapping nr. 1 ): On DeviceNet node #1 (MACID 1), starting from Byte#1, first bit, define the next eight outputs (33 ... 40)**
** the IO mapping can be split (even within a single module).

2 x 4 Inputs 2 x 4 Outputs

Input-Mapping (mapping nr. 2 ): On DeviceNet node #1 (MACID 1), starting from Data-Byte#1 *, first bit, define the next eight inputs (1065...1072)**

1070 1069 1066 1065 33 34 37 38

24V

GND

*the /BYTE part of an input-mapping statement only


refers to the Data-Bytes (the additional Inputbyte of the Buscoupler, shown during the scan, is disregarded here !)

1072 1071 1068 1067 35 36 39 40

AppsNote: DeviceNet

DeviceNet - V+ Sample Code - Read common DeviceNet status


ATTACH (dn_lun, 4) "devicenet" TYPE "IOSTAT of DN ATTACH: ", IOSTAT(dn_lun,0), " ", $ERROR(IOSTAT(dn_lun,0)) ; read DeviceNet status (see V+ LRG)

FCMND (dn_lun, 761) "", $input


TYPE "IOSTAT of dn_stat: ", IOSTAT(dn_lun,0), " ", $ERROR(IOSTAT(dn_lun,0)) TYPE /C1, "*********** DeviceNet Status *************" status = INTB($input,1) ; status bits IF status < 0 THEN status = status+65536 END CASE TRUE OF VALUE (status BAND ^B1) == 1: TYPE TYPE "Online" TYPE "Number of bytes transmitted: ", INTB($input,3) VALUE (status BAND ^B10) == 2: TYPE "Number of acknowledges received: ", INTB($input,5) TYPE "Bus warning" TYPE "Number of bytes received: ", INTB($input,7) VALUE (status BAND ^B100) == 4: TYPE "Number of errors: ", INTB($input,9) TYPE "Bus off" TYPE "Number of bytes lost: ", INTB($input,11) VALUE (status BAND ^B1000) == 8: TYPE "Number of overruns ", INTB($input,13) TYPE "Activity detected" TYPE "******** End of DeviceNet Status *********" VALUE (status BAND ^B100000) == 32: TYPE TYPE "Transmit timeout" VALUE (status BAND ^B1000000) == 64: DETACH (dn_lun) TYPE "Receive buffer overrun" TYPE "IOSTAT of DN DETACH: ", IOSTAT(dn_lun,0) VALUE (status BAND ^B1000000000000) == 4096: , " ", ERROR(IOSTAT(dn_lun,0)) TYPE "Online at 125 KBaud" VALUE (status BAND ^B10000000000000) == 8192: TYPE "Online at 250 KBaud" VALUE (status BAND ^B100000000000000) == 16384: TYPE "Online at 500 KBaud" VALUE (status BAND ^B1000000000000000) == 32768: TYPE "Scanner active", /C1 END

AppsNote: DeviceNet

DeviceNet - V+ Sample Code - Read MACID status


Analyze the DeviceNet Bus by gathering informations from the nodes.
AUTO macid, status, $error[25] $error[0] = "Device not in device list" $error[1] = "Device idle (not being scanned)" $error[2] = "Device being scanned" $error[3] = "Device timed-out" $error[4] = "UCMM connection error" $error[5] = "Master/Slave connection set is busy" $error[6] = "Error allocating Master/Slave connection set" $error[7] = "Invalid vendor id" $error[8] = "Error reading vendor id" $error[9] = "Invalid device type" $error[10] = "Error reading device type" $error[11] = "Invalid product code" $error[12] = "Error reading product code" $error[13] = "Invalid I/O connection 1 input size" $error[14] = "Error reading I/O connection 1 input size" $error[15] = "Invalid I/O connection 1 output size" $error[16] = "Error reading I/O connection 1 output size" $error[17] = "Invalid I/O connection 2 input size" $error[18] = "Error reading I/O connection 2 input size" $error[19] = "Invalid I/O connection 2 output size" $error[20] = "Error reading I/O connection 2 output size" $error[21] = "Error setting I/O connection 1 packet rate" $error[22] = "Error setting I/O connection 2 packet rate" $error[23] = "M/S connection set sync fault" macid = 1 ;MACID 1 for instance

IF IOSTAT(lun) < 0 THEN TYPE "No MacId ", macid ELSE status = ASC($input, 1) TYPE "MacID ", macid, "status is ", $error[status] END

ATTACH(lun,4) "DEVICENET"

;Get STATUS of a named MAC_ID (undocumented so far)

FCMND(lun, 760) $INTB(macid), $input

AppsNote: DeviceNet

You might also like