16 bit input in word address

rjanociak

Guest
R
Is there a way to put 16 bit inputs into a single 16 bit word address.
The only way I can think of off the top of my head is to:

Add 1 if Bit 1 is high
Add 2 if Bit 2 is high
Add 4 if Bit 3 is high
Add 8 if Bit 4 is high
etc.....

Is there any easier way to do this? I just want something simple without alot of work. It seems that there is an easier way to me that I am overlooking

Bob
 
What brand PLC are you using?

It is really simple to address 16 bit inputs as a single 16 bit word in most, if not all PLC's.......




An AB SLC500 example:

I:1.0/00
I:1.0/01
I:1.0/02
I:1.0/03
I:1.0/04
I:1.0/05
I:1.0/06
I:1.0/07
I:1.0/08
I:1.0/09
I:1.0/10
I:1.0/11
I:1.0/12
I:1.0/13
I:1.0/14
I:1.0/15


These Input "bits" can be addressed as a single 16 bit word- I:1.0
 
In most platforms, assuming the bits are contiguous, you can use some sort of move or copy function to copy the word for the bits into a new register. If you identify the PLC model someone here is sure to give you specifics.

If the bits are not contiguous (all in a sequence and contained in one word like 93's example) but random, then I don't think there is an easy approach.
 
If the bits are not in order, you can use a simple brute force method that uses normally open contacts for the bits you are converting to energize the bit level coils of an integer register i.e. N7:0/0 - N7:0/15 as well.

Don't forget that the 16th bit (/15) is a sign bit. If you are trying to generate an unsigned 16 bit value you will need to include a float register i.e. F8:0 and monitor the sign bit of the integer. If the sign bit is off, move the integer value directly to the float. If the sign bit is on, add 65536 to the integer value and the sum should be placed in the same float register.

It seems like we are talking about AB PLC's but if the PLC type is from a different family, different rules will apply.
 

Similar Topics

So here's my situation, I have been tasked with modifying the logic to mimic a button press in the PLC. I have two identical machines however one...
Replies
6
Views
513
Question- Say I have 8 digital INPUTS to my PLC, any of which may be asserted HIGH for a few seconds, all these inputs "OR'd", currently, to...
Replies
16
Views
3,512
Hi, I'm just trying to get my head around how an analogue input with a 12-bit resolution is able to use the range 0 to 32000? Surely you need at...
Replies
2
Views
1,516
I need to know where to turn on the Input Phase loss on my powerflex 700 drive. I recently had a 40HP drive blow up because the drive had one...
Replies
8
Views
8,185
I am installing a 4-20ma distance sensor on a piece of equipment that has a remote I/O cabinet that uses devicenet Point I/O cards. The analog...
Replies
0
Views
1,729
Back
Top Bottom