Devicenet Mapping

pauly

Member
Join Date
May 2002
Location
South Wales,U.k
Posts
244
When the input and output areas of my devicenet scanner are mapped to my E3 overload relays, the 4 input assembly words are mapped to 2 x 32 bit words in the scanner, how can the 32 bit words be split again in controllogix to pull out the 4 integers I want?
 
I used to use BTD for this, but I like this way even better.

Make a UDT for the E3 data (this lets you name the individual bits and make it self documenting). Create an array of tags of this UDT type. Create an alias for each E3 (the name you will use in the rest of your program). Now you can use a COP instruction from the scanner data array to the E3 array. If you are mapped conveniently, it could be one COP for all the E3s.

This will take care of your inputs. The outputs are handled similarly, you just copy in the opposite direction (separate tags for inputs and outputs).

The big advantage the COP instruction has in this situation is that it doesn't cause minor arithmetic faults which *can* happen when you use BTD instead. If you prefer to avoid the UDTs, you can just COP from the scanner array to Integer tags.
 
Actually, that last sentance is wrong.... You can't just COP to an integer tag. At a minimum you need to create an array of integers and COP to that.
 
mellis is right.
Create an array of type INT[4] and use the COP instruciton to move the data to it.

There is a technote on this in the AB knowledgebase somewhere if you have the inclination to look it up.

And I really like using UDT to represent data for the various devices. Eventually you'll even develop a library of common UDTs. Properly designed UDTs are also useful for developing generic object oriented code that you can use over and over even on very diverse pieces of equipment.

If you look at the attached udt1.pdf you will see that there is an integer array SMCInputImage int[2] and SMCOutputImage int[2]. The SMC-flex returns the discrete IO via device net and I COP the image from the 32 bit word to these integer arrays. You can also see a Data array where I copy info retrieved using the messaging technique I showed you in the other thread.

The other two are UDTs just to illustrate how UDTs can be used. udt2 is a solenoid output. Notice that it is more than just a simple bit output, there are provision for forcing the bit on/off from the HMI, interlocking, error detection, etc all in the UDT. The program writes to the bits in the UDT, and then at the end of the program all the UTDs are passed to a single reusable routine that determines whether to turn on or off the output. udt3 is for a flow meter - note that it has timers and scaling tag structures built right into the udt, so I only create a tag of type FlowMeter and than all the other necessary elements come packaged with that tag. (note: this UDT cant be passed to a FB subroutine but it can be passed to a ST routine)
 
Last edited:
mellis said:
Make a UDT for the E3 data (this lets you name the individual bits and make it self documenting). Create an array of tags of this UDT type. Create an alias for each E3 (the name you will use in the rest of your program). Now you can use a COP instruction from the scanner data array to the E3 array. If you are mapped conveniently, it could be one COP for all the E3s.
This is definitely the way to go.

But, I would advise using the CPS instruction rather than the COP. Based on my experience, these instructions copy data one byte at a time. The COP can be interrupted between bytes by other tasks which may change the data being COPied. In my case, a FBD routine controlling motor speeds occasionally interrupted a COP between bytes of a changing integer speed reference, resulting in large "spikes" in the output to the drive - sometimes resulting in a trip. The CPS can't be interrupted.
 

Similar Topics

I have to modify a device net network by adding two nodes(VFDs) to the network.Please advice me how i can map input and output to PLC...
Replies
0
Views
1,673
Hi Guys There is a tester on my floor, using SoftLogix, 1784-PCID interface, 1734-ADN Adapter and 1734-IB2. when I open the PLC program, the...
Replies
2
Views
1,659
Hey All, Looking for some direction on how to map a SMC EX250-SDN1 SI unit to an Omron CJ1W-DRM21 device net scanner. The manual says that it...
Replies
1
Views
3,094
Hi, I have a Devicenet scanner and its various data i.e. addresses. How to I read these using my SLC500 PLC?
Replies
0
Views
1,663
All, We are using DeviceNet for remote I/O modules. I have configured an alia tag for each digital input and output. For Example: TYPE TAG...
Replies
1
Views
2,286
Back
Top Bottom