ST condition

vedano

Member
Join Date
Mar 2008
Location
Copenhagen
Posts
17
Hi guys,
I am doing my final project at school, and I try to develop some libs for motion control. I try to use PLCopen standard as an inspiration.
My problem is, I have never done too much of PLC programming. There is a condition for the FB I am creating, that if any of the inputs are missing (open), FB should use the last values used. It's IEC standard. I don't know what to write as a condition for "OPEN". They are REAL number inputs.

IF INPUT=????? open?

Thx for help
 
No one had this kind of problem before? Where to look? IF "open"...
It must be some operator. I use CodeSys and even though I start to like the software, their documentation is far from Logix or Siemens.
 
Maybe if you post a screen shot of the Function Block and explain a little better what you mean someone will be able to help.

Are you looking for default values for the function block input parameters?
 
No one had this kind of problem before?
Most people don't write code for motion controllers. Just application code.

[quyote]
Where to look? IF "open"...
[/quote]
You should have asked while I was at work. I have the specification there.

A blank parameter field usually is assigned to a default value but this wouldn't make sense on a motion application. It makes sense that a blank field uses the last parameter.

Why do you care? Define the operation any way you wish. You aren't designing or programming a product. Most companies interpret the specification to suit them. I think you are sweating the small stuff.

The hard part is designing a motion profile generator or target generator. Simple point to point isn't too hard but there are fine points.

You will find your project challenging.
 
It's important, because the FBs I am creating are for motion and they can be called few times in the sequential code. The standard says, that if u call the block without some inputs, in my case without "Velocity", "Distance", the last used values will be assigned to them.
So basically I have dummy variables for them and I need to write a condition that would use the last used values if there is nothing at input. Input is open.

And it is a small thing, it's just that the standard says so. I know I am sweating the small stuff, but that's what u do in school. :)

Luckily I do FB only for single axis motion, Homing, Stop, MoveRelative...and some interfacing FBs.
 
This is an interesting problem.

Do you have a means to check if the parameter is blank in ST?
Normally ST passes default parameters to FBs or FCs so if you are writing a FB in ST you have no way of telling if the parameter was blank from inside the FB.

Is that your problem? If so then I don't think there is a way around it.
 
Do you have a means to check if the parameter is blank in ST?
Normally ST passes default parameters to FBs or FCs so if you are writing a FB in ST you have no way of telling if the parameter was blank from inside the FB.

Is that your problem? If so then I don't think there is a way around it.

I didn't know that, but it makes sense. Than I just have to initialize it with a value that is not valid for application and have condition to check for that value.

But this would make sense only if it always uses INIT value for missing parameter. Is this the case? Or would FB use values from previous call if parameter is missing?
 
I tackled the same problem once writing PLCopen function blocks. What I did with some of the optional inputs like Velocity, Acceleration, Deceleration on a MC_MoveAbsolute, is that I initialized those parameters to -1. Since negative numbers are not valid for those, inputs when I saw in negative inputs in the function block, I would not copy the data to the interpolator and allow it to use the previous setting.
 

Similar Topics

I have a question about process interlock naming. I want to hear opinions, as well as if there is a relevant standard. When naming specific...
Replies
3
Views
673
Hello: Question for SCADA/HMI experts. One of our customers is responsible for planning and selection of key technologies for manufacturing...
Replies
12
Views
2,992
We have a repair hole that carriers come into. As they come in they pass a RFID reader and each carrier has a tag. The repair hole can hold 5...
Replies
2
Views
1,971
Hey Folks. At our plants we've been talking about monitoring the current on motors through the VFD parameters to gather a bit of historical /...
Replies
17
Views
3,793
All, is it possible for a compactlogix to have an overflow fault if the destination of calculation is REAL, the variables are REAL but being...
Replies
1
Views
1,363
Back
Top Bottom