Convert DINT to BOOL[32] and then back to DINT?

theColonel26

Lifetime Supporting Member
Join Date
Feb 2014
Location
West Michigan
Posts
785
I need to iterate though the bits in a DINT, but it seems you can't indirectly address a DINT at the bit level.....

So my next thought was Convert the DINT to a BOOL[32] and then back to a DINT.... but it seems I can't do that with a COP instruction either.


Ideas?


I'm on Studio V32 and my PLC is a L310ER (CompactLogix 5380 series)
 
Not the direct answer to your question, but it will be better to create an UDT with datatype BOOL[32].
Then create a tag using that data type. It will use 4 bytes only and allow COP to and from DINT.
 
i don't see the problem I do it all the time with both INT and DINT
the addressing is simple DINT_TST.1 both as an input and output
they are stored in the plc as an array of bits 0-31 but the tag is a DINT
but them all tags are stored as an array of bits in the plc
on you example you are trying to address them as an array but the addressing is as a bit
they can be addressed as either a bit (using the . ) or as a word
bit one would be .1 or as a word value 2
 

Similar Topics

I'm not a ladder or AB guy and the people asking me are using both, so this has me stumped. Long story short, they have several arrays of...
Replies
11
Views
5,335
I have a Structure in my project which has a few nested UDTs. They are ultimately of type DINT. What I would like to do is copy the values out of...
Replies
5
Views
2,252
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,386
Greetings fellow PLC programmers, I know there is a simple way to get the system date time of the RSLogix system. But, is there then a way to...
Replies
12
Views
8,596
Hey all, I've reviewed many threads regarding converting one data type to another and I have something I'm working on that I'm stumped on and...
Replies
9
Views
5,920
Back
Top Bottom