how to introduce a (variable) input parameter into my ladder logic for compare?

karimbahari

Member
Join Date
Apr 2016
Location
vancouver
Posts
8
Hello there,
I want to switch on a motor based on the output of the following:

If (X LEQ 40 psi) OR (X GEQ 60 psi) Then ...

How/where could I introduce X?
I am Studio 5000.

Thank you,
Karim.
 
Assuming 'X' is to represent a pressure measurement in an external system then a suitable pressure measurement transducer would be used. This would be connected to an analog input point on your PLC system.

For more detailed answers you need to provide a lot more details of the exact Logix system and the external conditions you wish to monitor.
 
Hello, Thank you for your response.
I understand your point; but I am new to this field and I was wondering if I can, in the most simple way, introduce an input parameter that can be variable. So, the story is I would like to turn on an oil pump and wait for 3 seconds and then check to see if the oil pressure is within a certain range. If not I turn off the motor that is receiving oil from the pump (and entirely the system should shut off), and set an alarm and wait for supervisor to come and check!
Thank you,
Karim.
 
We understand conceptually what you want to do. I'm just not sure what your question is.
Do you need to know how to create a tag of a specific data type?
Do you need to know how to scale an input to engineering units?
Do you need to know how to locate the tag for the specific input you want to use?

Generally speaking you will get more direct answers to very direct questions. If you have no idea how to get started at all this forum may not be the most efficient place to find an answer.

Keith
 
Karim,
In your example X is just a Variable or a Tag. You use the Tag you assigned to your pressure input.

See the attached picture of the logic I wrote. In my example I used PIPE_PRESS as X in your example.

LEQ GEQ SAMPLE.jpg
 
Thank you very much Bullzi,
I cannot properly see the image though. Where did you assign the PIPE_PRESS input within the ladder logic?
Karim.
 
We understand conceptually what you want to do. I'm just not sure what your question is.
Do you need to know how to create a tag of a specific data type?
Do you need to know how to scale an input to engineering units?
Do you need to know how to locate the tag for the specific input you want to use?

Generally speaking you will get more direct answers to very direct questions. If you have no idea how to get started at all this forum may not be the most efficient place to find an answer.

Keith

+1

karimbahari, Im guessing that you dont know how to create a tag and would like to know how? This varies on the software, the data type, what input you want to alias it to,etc...

For a stab in the dark,
Type a tag name in an LEQ e.g. Pressure
Right click on the text you just wrote and select New

For a local tag
Enter a description
Select required data type

For an alias tag
Enter a description
Select Alias under type
Select in input e.g. Washer_CCP:2:I.Ch0Data
** Note this will probably be a 4-20mA input so you will need to scale it

Ash
 
Last edited:
Dear Ash,

I am used to writing codes in C and C# for microcontrollers.
Over there when you want to use a variable, you introduce it first (local or global), often initialize it, and then use it through out your code.
Now I know for a fact that here in Studio 5000, in order to have a variable, I need to have a sensor that creates it as its output and for that there are no drivers that I could virtually use here. As a result, I am wondering if I can introduce an input, just like the switch on and off, but here instead of the type boolean, may be using a DINT or a SINT. I need to have a timer running for 3 seconds and then a check to see if this input (Oil_Pressure) is within a range, and if it is not, then shut down the system.
I hope I explained this properly, please kindly let me know if this is not the case. I know how to create/change a tag on an XIC or XIO switch.
Regards,
Karim.
 
Let's start saying that a Controller Tag is like a global variable and a Program Tag is a local variable. This's independent of the datatype (BOOL, INT, DINT, etc). In some cases you just copy the value from an input card (a specific channel) to a tag. In other cases you write the value from an HMI, using a grafic object.

I am wondering if I can introduce an input, just like the switch on and off, but here instead of the type boolean, may be using a DINT or a SINT.
You only need to create a tag. If you don't use any instruction to copy or write a velue, you can manually write the value using RSLogix (online, of course):

a) In Monitor Tags, write the new value on the Value column.
b) In ladder, you can write the new value in some instructions, like MOV (there's a little blue arrow on the editable fields). In case of BOOL, right click on the XIC/XIO instruction and toggle the bit value. Obviously, these methods won't work if you have some logic writing to your tag.

Off topic: I read this thread and thought about the attached picture.

tree_swing_development_requirements.jpg
 
Originally posted by karimbahari:

I am used to writing codes in C and C# for microcontrollers.

Understood. One thing you may have noticed already is that, being a purpose-built controller and development pair, Studio 5000 will do many things for you on the hardware definition level that you would need to do yourself in C written for a microcontroller. One of the things Studio 5000 does for you is create tags that directly map to physical input and output channels based on the placement of modules in the "I/O tree" in the project tree on the far left of the development window.

So, in simplest terms, you will not need to create any tags to use the pressure input value. What you do need to know is where the input module is physically located. Is it in the local rack with the plc or is it accessed across a communication network? The most rigidly defined case is if the input module is in the local rack. If you look in the controller tags you will find a group of tags that something like Local:3:I.Ch0Data". This is very similar to the tag that Ash showed below. These tags are the tags used to access the I/O modules in the local rack. Use the system schematics to determine which input you are interested in and select the tag associated with that point.

The value returned from the input module will depend on its model number and configuration. It is possible that with on-board scaling the value is already in user units. However, the input value may also be in A/D converter bits, at which point you will need to perform some scaling.

Keith
 
nhatsen thank you.
Here is the flowchart I drew for myself of the scenario; in response to your attached picture. I think, as you implied, the way I explained the problem may be different from what other esteemed members up here assumed. Please have a look at it: (attached).
Hope to hear from you and other great contributors, soon.
Karim.

Diagram.jpg
 
In regards to your existing programming knowledge, think of the controller/program tags as the place where you declare and initialize tags/variables. Once you have created a tag there you can use it in your code.

So, Lets try and create the code first then add in your inputs later on...

OK so you will need a rung of code for you pump control, a rung to delat the monitoring, a rung to check your oil pressure and tags associated with it.

Go into controller tags, edit tags, then create the tags below:

  • PumpStart_PB.....Bool
  • PumpStop_PB.....Bool
  • PumpRun_Cmd.....Bool
  • PumpPressure_Timer.....Timer
  • PumpPressure_Alarm.....Bool
  • PumpPressure.....Real


Pump Control: Create the first rung to operate the pump.
When
PumpStart_PB is true OR PumpRun_Cmd is true​
AND
PumpStop_PB is false​
AND
PumpPressure_Alarm is false​


Pressure Monitoring Delay Timer: Create the second rung to start the timer.
When
PumpRun_Cmd is true​
Start PumpPressure_Timer, with a preset of 3000​


Pressure Monitoring Alarm: Create the third rung to monitor the pressure.
When
When PumpPressure_Timer.DN​
AND
PumpPressure Less than 40.0 OR PumpPressure Greater than 60.0​
Use a coil to activate PumpPressure_Alarm​



Use the help files using f1 on an instruction, they are really helpful. Everything described above can be acheived using: XIC, XIO, TON, OTE

Hopefully that will give you an insight into how that code works, once you have that up and running you will be able to replace the those tags with the real inputs and outputs.

Ash

Edit: Just noticed your flow diagram mentioned end process if the pump pressure is within its range. What do you want to happen then?
 
Dear Ash,
Thank you very much for this great detailed solution: please allow me to implement it and get back to you.
Related to your last question: I was thinking I guess the system would do normal operation unless the alarm goes off. In that case, system shuts down and stays off even when alarm is cleared, until supervisor check happens. I hope that made sense, does it?
Karim.
 

Similar Topics

Have a new project and I'd like to get my simulation logic a bit more realistic, as such I'd like to add noise to the simulated analog feedback...
Replies
6
Views
2,145
I would like to introduce a dedicated forum for ABB control system,this is a really good platform to learn ABB control systems,just like...
Replies
0
Views
1,282
i want the cable to connect PLC FUJI MIREX- F Who ever used, and pls. tell me how i order it , or pls. tell me the part number of the cable thank you
Replies
1
Views
3,903
I would like to introduce a dedicated forum for ABB control system,this is a really good platform to learn ABB control systems,just like...
Replies
0
Views
1,910
Pls. introduce the HMI for S7 200 (PPI) or if i have proface 4000 series , can it connect to PLC SIEMENS S7-200 via PPI Port:thumb:
Replies
3
Views
3,755
Back
Top Bottom