Click PLC and Cmore HMI panel

swhollis

Member
Join Date
Nov 2015
Location
Georgia
Posts
3
I have a project i;m stumped on. I have a routine on a Click PLC that is sort of a decoder. It looks to see if wires are installed in a connector and outputs a control bit for the one of 31 different possibilities. So outputs are C1- C31 depending on which rung is true. Only one rung is true at a time. I need to be able to display this on a Cmore HMI. I was going to use the lookup text function but i'm struggling.
 
Is there a reason to use individual coils in your ladder program to identify the combination? If you simply put a value in an integer and then use that integer tag for a message display in the HMI your task will be easier.
 
There are 32 rungs on my ladder. Each rung on the ladder has 5 NO or NC instructions. If the jumpers in the electrical connector are in the correct place that denotes an output bit from 0 to 31. I think I have to have 32 rungs in order for it to work correctly. I wish the Cmore software allowed you to make a message list with a discrete bit for each message. Open to suggestions
 
Check out the 'Copy Pack' instruction. By combining your 5 conditions into a single word you will get 32 unique numbers. Use the number to trigger one of 32 messages.
 
If you wanted to get really clever...

Do as Bernie says. You'll have to pack the 31 bits into a double word (32 bits), let's use DD1.

You'll end up with the following.

C1 active = 0000 0000 0000 0000 0000 0000 0000 0001 = 1 = 2^0
C2 active = 0000 0000 0000 0000 0000 0000 0000 0010 = 2 = 2^1
C3 active = 0000 0000 0000 0000 0000 0000 0000 0100 = 4 = 2^2
C4 active = 0000 0000 0000 0000 0000 0000 0000 1000 = 8 = 2^3
C5 active = 0000 0000 0000 0000 0000 0000 0001 0000 = 16 = 2^4
...
C31 active = 0100 0000 0000 0000 0000 0000 0000 0000 = 1,073,741,824 = 2^30

Now, run the following calculation and store it in DD2:
Log(DD1)/Log(2)
That equation is the inverse of 2^x, so ultimately, what you'll get back is:

C1 active (which worked out as 2^0): 0
C2 active (which worked out as 2^1): 1
C3 active (which worked out as 2^2): 2
C4 active (which worked out as 2^3): 3
...
C31 active (which worked out as 2^30): 30

Then add 1 to your result, and hey presto, the number you end up with is the same as the number of the C register! (side note: you only have to add 1 because Click addressing starts at 1, not 0)

Of course, this will only work if you can do advanced math instructions on double words in a click. It may well not be possible - if there's ever any fancy math involved I write the Click off as an option fairly quickly, so I've never really tried to do a huge amount.
 
Wait. I have a better idea.

You say that you have "5 NO or NC instructions" preceding each of your C registers, which determines which C register to turn on.

Sounds to me like this is already a binary value. 2^5 = 32, so with 5 "inputs", you have 32 possible combinations (as you say).

If your inputs are all sequential...
X1
X2
X3
X4
X5
...then forget your C registers, use a Copy Pack to pack the inputs just as they are into DS1. The value of DS1 will then be a value from 0 to 31, and if you happen to have programmed your existing ladder logic in a logical order, you'll probably find that the value you come out with exactly matches the C register you've assigned it to.
 
You guys are awesome. I did end up using the C registers just because for some reason the chart i'm trying to get this program to replicate wants the inverse of the input. No biggie. The only thing I am having a problem with now is that the inputs seem to be in reverse sequence of the chart i'm replicating. Again I can use the C registers to resolve it by inverting them but i'm wondering if there is a more straight forward way to do it.
 
Ah...I'm not sure what you mean. Can you provide some pictures/screenshots of what you're getting, and what you're trying to get?
 

Similar Topics

Does anybody know if the cable between a click PLC and a Cmore micro HMI is a standard phone cable? Thank you, Dave
Replies
2
Views
2,371
We need to have a way to update programs in the Cmore ea1-s3ml panel through the COM port when plugged into the Click PLC com ports . Is there a...
Replies
2
Views
3,014
Complete noob here, using a Click C0-02DD1-D to run a test stand. Requirement is to turn on motor run for X seconds, turn off and dwell for X...
Replies
6
Views
1,076
merry christmas and happy new year i have a click c0-00dr-d and allen bradley 2711c-t3m. can the panelview talk to the click plc via modbus...
Replies
1
Views
214
Hi guys, i have never had to do a PWM Output or input before i have a Device that to dimm the lamp output from the ballast, the ballast has a 24V...
Replies
6
Views
1,045
Back
Top Bottom