DINT word mapped to UDT word RSLogix5000

Tugboat

Member
Join Date
Dec 2011
Location
colorado
Posts
2
First off I am new to this site so please let me know if I am posting anything improperly or if there is anything I need to do differently. I have tried to search through the site for an answer but since I have seemed to have stumped other professionals I am not surprised that I did not find any answer right away but will continue to look. If this is listed someplace else please point me in the direction and disregard my question.

I am currently trying to update one of our old RSLogix500 programs to the RSLogix5000. One thing I wanted to make sure to do was to take advantage of all the new programs abilities. Before I get into what I have done and what my question is I wanted to explain what my hardware set up is.

I have an A-B Controllogix 10 slot rack with a 1756L61 processor, on the rest of the rack I have an Ethernet module the 1756ENBT, and a DeviceNet scanner 1756DNB. This rack will be receiving and sending information back to the main computer room over the Ethernet connection. The Devicenet connection will be controlling flex I/O modules and powerflex70 VFD’s.

What I want to do is be able to give every single bit inside of a DINT word a unique name. the reason I want to do this is that I receive a DINT word from the DeviceNet scanner that is controlling the VFD. Instead of having vfd commands .0-.31 I would like to make it vfd.run, vfd.stop, vfd.clr_flt …etc.
what I did not like about our old code is that half of the code is mapping every single bit to an internal bit and wanted avoid miles of code to map a single word. This brings me to my question.

Is there a way to map a DINT word to a UDT of the exact same size except with .run, .stop , .clear_fault instead of vfd.0, vfd.1, vfd.2, vfd.3 …etc?

I have 2 tags 1st is a DINT 32 bit word: ( Local:4:O.Data[3] ) the 2nd is a UDT with 32 BOOL bits to make it the same size as a 32 bit DINT word but not the same type: ( conveyor_name.Input.vfd ). The idea behind the tag name is that for each conveyor I will only have 1 subroutine and 1 tag to create and name using nested UDT’s.

Ex1: (this example does not work because they are not the same data type): using the MOV function

MOV Source ( Local:4:O.Data[3] ), Dest ( conveyor_name.Input.vfd )

Note: The UDT is made of 32 BOOL bit’s which makes the word exactly 4 Bytes long the exact same length as a DINT. The UDT is just not a DINT.

Ex2: (this does work but can make for weird placement of JSR): using the JSR input/output perimeters

JSR routine name ( conveyor_code ), Input per ( Local:4:O.Data[3] )
SBR Input per ( conveyor_name.Input.vfd )

I have tried other functions without any success except the JSR perimeters but it could be I did not set them up correctly. I hope there is a better function than having to use JSR to map all my UDT tags to a DINT. Thank you in advance for any help.
 
Try using Devicenet generator, that will save you a lot of problems and that´s exactly what you´re requesting. Thtat software will generate VFD tags with all the info you need just to use it.
 
Yes this can be done by editing externally the exported description of the UDT. Export the UDT then open it with notepad or an XML editor. You will notice that SINTs are defined but hidden. The bits are then defined in terms of the SINTs.

Rework the UDT, creating a single DINT, leave it visible, then define the bits in terms of bits within that DINT. (This be clearer once you open the file.)

Once this is done you can import this revised UDT but you won't then be able to edit it from within RSLogix 5000. It is called an 'overlay' UDT by the RSLogix software.

Edit - try the Devicenet generator first. Better to use an actual AB product rather than a kludge.
 
Last edited:
Greetings Tugboat and welcome to the forum.

What I want to do is be able to give every single bit inside of a DINT word a unique name.
The way to give every bit in a dint a unique name is to use something called a bit overlay. Bit overlays are a particular kind of UDT. However you can't create a bit overlay in Logix5000, you must create it as an XML text file and them import it as a UDT. You also cannot modify the UDT in Logix5000. If you have to change it at some future time then you have to delete it and re-import. This lack of flexibility can be cumbersome, however for data structures that are unlikely to change they are a hand tool.

Here are two threads that show a bit overlay example. You can also search the forum for "bit overlay"

http://www.plctalk.net/qanda/showthread.php?t=40331
http://www.plctalk.net/qanda/showthread.php?t=59049
 
I would definitely recommend you use the Logix5000 DeviceNet Tag Generator tool.

It creates tag-names and identifies the control/status bits exactly as they are described in the EDS file for the device (that's where it gets them from).

So you end up with a 100% correlation between your RSNetworks parameter names (RSNetworks gets these from the EDS file also), and the generated tags that are put into the project automatically for you.
 
If the UDT you created (as described in post #1) covers all the data bits you require, then there is no need to bother with the tag generator tool.

The solution to the problem you were having is to use the COP instruction instead of MOV. COP doesn't care about data types - just size. Data is transferred byte-by-byte with length determined by the destination.

Actually, I recommend using the CPS instruction to eliminate possibilities of data inconsistency, as the COP instruction can be interrupted between bytes.
 

Similar Topics

Hello, I am provided with PLC tags with PLC_UDT datatype via symbolic connection. The structure of PLC_UDT (DI_hmi) is: DI_hmi.stat (UDINT)...
Replies
4
Views
1,412
Thank you so much for your help! I am trying to use an INT or DINT as a setpoint for my remote device using Modbus TCP/IP. My code is...
Replies
2
Views
2,369
I know this is simple, just wondering if anyone had a good counter for the int to word conversion, in Protool/Pro I have a 32 bit array...
Replies
8
Views
6,509
Hi I am being given several fault words (as a DINT) from a Drive that I am receiving into a Compactlogix L33ER controller. I have a small...
Replies
12
Views
1,134
I am working on a project with a Controllogix 5582 processor using v32 firmware where I will be communicating with a Genset using Modbus TCP. It...
Replies
14
Views
923
Back
Top Bottom