Direct Logic H2-CTRIO help please

Tubularfab

Member
Join Date
Jan 2012
Location
Atlanta
Posts
37
Ok, first of all I must remind you that I am a complete newb to PLC programming of any kind. I am working on a digital angle control for a mandrel tube bender, and my first step is to use a standalone PLC (as in separate from the one currently running the machine) to monitor a quadrature encoder on the bender and pass the scaled bend angle over to the PLC. For learning purposes I am using this separate PLC for my expirimentation and my only output is closing a relay when the bend angle is reached. This relay acts as a limit switch input for the other PLC running hte machine. This way I have no chance of doing anything dangerous while I'm learning!

I have a Direct Logic 205 series PLC with the DL240 processor, a relay output card, and an H2-CTRIO high speed counter. I am using a 360 div/rev quad encoder in 4x counting mode to get .25 degree resolution. I also have a 6" Cmore color touchscreen for an HMI.

I have configured the CTRIO using the CTRIO workbench for quad counting, 4X and scaled the output to degrees which is then stored in a memory V location with one implied decimal place. I have an output box on the C-more displaying this angle real time, and it is working. I also was able to create a reset pushbutton on the Cmore that momentarily closes the reset bit for the counter - that functions correctly as well.

OK - I should qualify - this is all working if I manually tell the ctrio to go into run mode in the workbench. It stays in run mode as long as I don't kill power to the plc. What I'm not getting is what do I need to do in the ladder logic to initialise the ctrio and put it in run mode. The examples in the ctrio manual are all using a lot more functions of the ctrio than I need.

Second question - what type of scheme could I use to let me enter multiple setpoints for bend angles, and then toggle through them sequentially? I understand how to create a user input with the cmore and store the number in memory, but I don't know how to then access the numbers sequentially. In normal computer programming I'd envision a simple array holding the bend angles and run the process as a loop and increase the array reference by one each time through the loop. I have no idea where to start to do that on a plc - or even whether this would be done in the ladder logic or the hmi. Some hints on how to implement that would be great...

To recap how this works:
I might have a tube that has 6 bends in it. for kicks b1=24.2, b2=46.2 b3=5.6, yadda yadda. I go to the machine and manually position the tube for b1 then hit the BEND button (and wish to have the machine stop at 24.2 degrees. The clamps are then released, the bend arm swings back to zero degrees (hitting a limit switch) and then you position the tube for b2 and repeat. If the next bend angle setpoint is zero degrees that should signal no more bends and make B1 the setpoint again.


Thank you!
 
Last edited:
Thanks for the links - I'll be using them for sure.

But, I'm still stuck on getting the ctrio initialization going. Many of the example programs on this use iboxes, which appear to not be an option with the dl240 cpu. All of the others, including the ones in the ctrio manual, list memory bit references starting with a B, with the rest of the location matching the appropriate V location. I cannot find anything in the manuals about B references... What am I missing here?
 
Since the 240 does not support 'Bit of Word' operands (as shown in the documentation) be sure to use '4 ranges' when setting up the I/O Map. Assign the correct 'V memory' address for a range of 'C' bits to use for input and/or output operations. Then just use the mapped 'C' bits for bit type control.
 
That got me running, at least the first thin I wanted to accomplish. I can now input a target bend angle via the cmore and have it close Y0 at the correct point. So, everything is happy as far as passing the variables around. Thanks for the hints!

Now time to read up on the pointers and figure out the multiple angle part...
 
Ok, so I'm completely clueless now. I was getting strange results from the program I was working with, so I whittled it down to about nothing, and it's still acting weird in my opinion. In monitor mode I'm getting resets activated even when the condition on the same line is not met. In my original program I had intermittant resets occuring. In the attached program hitting the momentary button on the Cmore that is tied to C5 causes the Y0 relay to momentarily close and reopen, even though c4 is not being reset. Viewing the live data the only thing highlighted in blue is the reset C4 part.

WHat silly noob thing am I doing??? Help!

Thank yuo!
 
With your current logic, Y0 can only be on while you're holding the button down. You need to remove Y0 from the first rung, and place it on a separate rung, turned on by C4.
|    C4            Y0
|----] [----------(OUT)

Also, keep in mind that C4 will never 'SET' if C161 happens to be on when you push your button. You might want to make C161 a one-shot.

🍻

-Eric
 
Ok, I made the change, but same thing. Here is a screen shot showing the status of everything - notice the reset c4 is the only thing on even though the conditions are not met?

coiltest.jpg
 
Hmmm, that's a weird one. Is C4 mapped to the HMI somewhere? It might be turning C4 off. Try disconnecting the HMI and toggle C5 using DirectSOFT only (same as pressing the button on the HMI, but without the HMI connected).

To change the value of a bit, highlight the bit and click the 'Value' button (or Ctrl-Shft-F2). Choose ON or OFF, and click 'Send to PLC'.

🍻

-Eric
 
Thanks for the tips Eric. I just tried that - unplugged the hmi, and then changed C5, then C4 to on. Both times the Y0 relay momentarily pulled in and shut back off. The green shading remained around the reset C4 area, and C161 stayed in the off state the whole time.

I'm lost here - any other ideas?

Thank you!
 
I'm stumped... :confused:

I know the 240 supports forcing. I've never had the need to force bits, but maybe you have C4 forced to off? In 'View--> Options', on the Data View tag, put a checkmark in the 'Override Bits' box. Click OK, then see what you find in the Data View window.

🍻

-Eric
 
Ok, I pulled the H2-CTRIO card and now it's working as expected. I don't think the CTRIO is supposed to do anything with C4 or C5... Humm
 
Figured it out. Newbie mistake - the CTRIO card was taking over the memory locations occupied by C0 up. I bumped up the starting location to free up the first C locations...

Thank you for the help!
 
It will if something in the CTRIO is mapped to V40600!

V40600 is the V-memory word that references C0 thru C15. Double check your memory mapping in the CTRIO module.

🍻

-Eric

EDIT - I see you figured it out... Great!
 
Yeah - the problem lies in my DL240 CPU. Since it doesn't do bit of word it relies on these bits for control. I'm not sure, but I don't think it would have been an issue with a 250 or 260?
 

Similar Topics

So this is my attempt at collecting and displaying data on a Cmore panel With a DL06. Each pair in my logic is the "Time total" or the TA15 and...
Replies
4
Views
474
Hello, I am having some trouble trying to use Port 2 on the direct logic (250-1) for K-sequence. I am trying to use RS-232, I have a breakout...
Replies
0
Views
544
I have a few o these controllers and had to replace a CPU. It looks like everything is there in the ladder including the registers for the port...
Replies
5
Views
1,454
Hey, I am entirely new to PLC's and am trying to help my friend with a project. He wants to take the signal from a PNP photoelectric sensor as...
Replies
12
Views
2,227
Anyone know anybody that will attempt a repair on a DirectLogic F1-130AR? There were a few hits on the internet but none I've used personally...
Replies
1
Views
1,285
Back
Top Bottom