Author Topic: Cylinder With 2 Signals  (Read 3829 times)

PLC_Guy

  • Newbie
  • *
  • Posts: 3
    • View Profile
Cylinder With 2 Signals
« on: July 25, 2015, 06:13:03 PM »
Hi

I'm new to this software but ive been trying to improve on a function, the hydraulic cylinder.

i was looking to be able to
- have 2 inputs from the PLC with one for extended, one for retract
- from this you could develop errors if both are on or none are on.

AabeckControls

  • Full Member
  • ***
  • Posts: 193
    • View Profile
Re: Cylinder With 2 Signals
« Reply #1 on: July 27, 2015, 04:04:54 PM »
Since the hydraulic cylinder is analog, you would do the calculations in the PLC. If IN set the value to 0, if OUT set the value to 100 (or your max setting) & have the PLC check to make sure both are not on, if so set a bit & have an object on the HMI become visible or change color.

Being a cylinder there will probably be times the cylinder is neither IN nor OUT while travelling, I would check that both were off after a time delay to give the cylinder time to reach the other limit, then turn on a warning bit.

PLC_Guy

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Cylinder With 2 Signals
« Reply #2 on: July 28, 2015, 08:55:19 AM »
Ya i was thinking i could do something like that,

i was just thinking ahead in case i wanted to make other changes to objects, i wasn't sure how to do this.

AabeckControls

  • Full Member
  • ***
  • Posts: 193
    • View Profile
Re: Cylinder With 2 Signals
« Reply #3 on: July 28, 2015, 06:11:16 PM »
I haven't tried it yet, something I just thought of:

For the hydraulic cylinder set the Minn to 0 & the Max to 1 and for the value look at a binary bit. Going to fire this up tomorrow & see if this works.

Then you could try [bit] AND NOT [bit2] - not sure if an AND would work either, another test tomorrow.

AabeckControls

  • Full Member
  • ***
  • Posts: 193
    • View Profile
Re: Cylinder With 2 Signals
« Reply #4 on: July 29, 2015, 06:42:07 AM »
Found out there are 2 hydraulic cylinders - regular (binary) & analog. The analog will not read a bit like I thought of before, gives an error, but the regular one does read a binary bit for value & if true extends the shaft out.

For the thought of [bit] AND NOT [bit2] it gives a PLC address error, also tried & NOT - still doesn't work.

So the calculations would have to be done in the PLC, something I do as a rule - the HMI only displays what the PLC reports, I don't do calculation in the HMI.

Vitor

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Cylinder With 2 Signals
« Reply #5 on: July 29, 2015, 08:39:23 AM »
Hi.
Since you have two signals, you can use the HydraulicCylinderAnalog, set the maximum value to 1 and leave the minimum to 0, in the PlcAddressValue assign the address of a bit or register in the Plc. Now on the Plc  program one of the inputs signals sets the bit or register that matches the PlcAddressValue; and the other input signal reset the bit or the register.
You can do the same thing using HydraulicCylinder control except you dont have the maximum and minimum properties.
I hope be useful.

AabeckControls

  • Full Member
  • ***
  • Posts: 193
    • View Profile
Re: Cylinder With 2 Signals
« Reply #6 on: July 29, 2015, 11:55:06 AM »
... you can use the HydraulicCylinderAnalog, set the maximum value to 1 and leave the minimum to 0, in the PlcAddressValue assign the address of a bit or register in the Plc...

That's what I tried this morning & got a PLC error  - the analog cylinder wouldn't look at a binary bit, but the regular cylinder does.

I did as I suggested & wrote 0 to a register if in & a 1 if out the analog cylinder then responded to the register value, the same as the regular cylinder did to a bit.

Vitor

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Cylinder With 2 Signals
« Reply #7 on: July 29, 2015, 12:18:23 PM »
Hi.
I tried with the last version and simulate the signals with 2 buttons, one configured to set true and the other set false. I used the SimulatorCom and TestCylinder as a tag, and remember if you use the HydraulicCylinderAnalog you must set the maximum to 1 and the minimum to 0.
Other  idea ocurred to is if you know time betwin the two positions and being simetrical and steady the maximum propertie could be that value and use a timer control in the form to make a animation and of course the signals sets, in this case, the value of the register or word or tag to 0 or to the amount of traveling time of cylinder.

PLC_Guy

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Cylinder With 2 Signals
« Reply #8 on: July 30, 2015, 08:43:20 AM »
I made it work using the analog cylinder, i guess its just not ideal, seeing now in the PLC for each cylinder ill have to add a DINT to show its position instead of using just 2 bits.

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Cylinder With 2 Signals
« Reply #9 on: August 09, 2015, 02:25:15 PM »
Vitor's idea seems to be the closest you can get to have the HMI show the proper animation by knowing the time it takes for cylinder to extend/retract.

Since you want to be using analog cylinders, in case of error, your animation could be incorrect regardless of how you set it.

The assumptions for creating animation could go like this, dependent on your ladder logic (assuming your bits represent retracted/extended limit switches):

Bit1 = 1 and Bit2 = 0  <-- cylinder is fully retracted

Bit1 = changing from 1 to 0 and Bit2 = 0  <-- cylinder is extending

Bit1 = 0 and Bit2 = 1  <-- cylinder is fully extended

Bit1 = 0 and Bit2 = changing from 1 to 0  <-- cylinder is retracting

Bit1 = 0 and Bit2 = 0  <-- cylinder is either retracting or extending and the state of the bits should remain like this for predefined amount of time
                                  -- one of the switches failed, corresponding to the extended/retracted state of the cylinder at time

Bit1 = 1 and Bit2 = 1  <-- ERROR (depending on when one or both switches failed, hypothetically cylinder could be in any position)

If the above assumptions are correct then you can look at the bits only and create a code in HMI to handle all of the above by reading both bits (this way you wouldn't have to set the PLCAddressValue field at all).

It might just be far easier to create a DINT for each cylinder than to go through a hassle of creating a code.

I might be wrong about anything stated above as well.