standard block for a conveyor in an automatic packaging line

SIMATIC S7-200/300/400, Step7, PCS7, CFC, SFC, PDM, PLCSIM,
SCL, Graph, SPS-VISU S5/S7, IBHsoftec, LOGO ...
Post Reply
denhondt
Posts: 7
Joined: Sun Jul 04, 2010 10:10 pm

standard block for a conveyor in an automatic packaging line

Post by denhondt » Sun Feb 17, 2013 3:26 pm

Hi,

I want to make a standard block to control a conveyor

Making a working program is not the problem, but i want to improve and optimise my program

I see in many machine they use standard blocks for motors, valves etc..


Should i use make just one block for a conveyor and integrate all function for a motor in it, or should i make a conveyor block that steers a motor block?

Standard block example

Inputs
Motor_Switch ( switch to turn off the power to the motor , for maintenance )
Thermal ( Contact of motor protective circuit breaker) only necessary if motor function is integrated
Motor_Alarm ( Alarm from Motor standard block ) only necessary if a motor standard block is used
Release_Signal ( enable to run signal from the next conveyor/machine)
Product detection ( sensor at the begin and end of the conveyor, and maybe sensors on the previous conveyor)
Empty time ( Time to elapse if there is no product at the sensors and the conveyor is running)
Block_Nr ( If using an FC for pointer index in DB , not necessary for an FB )

Ouputs
Motor_Output ( Output for motor , or steer signal for motor standard block)
Stand_By ( stand by signal voor other conveyors release_Signal)
Alarm ( Alarm for Motor switch, Thermal, etc)

Stat
Product_On_Conveyor ( Memory there is product on the conveyor)
Conveyor is running ( Memory conveyor is active )

Temp
Timer_Start ( For use of self made timer function)
Timer_Done ( For use of self made timer function)
Point ( Pointer for use of Fc and Gobal DB )

If Product detection is "1" high
- > Product_On_Conveyor is Set

If Conveyor is running and produc_Detection is "0" for Time "Empty_Time"
- > Product_On_Conveyor is Reset

If Thermal is "0" Low OR if Motor_Switch is "0" Low THEN
- > Alarm is High

If Release_Signal is "1" high AND Alarm is "0" Low AND Product_On_Conveyor is "1" High Then
- > Motor_Output is "1" High

If Release_Signal is "1" high AND Alarm is "0" Low AND Product_On_Conveyor is "0" High Then
- > StandBy is "1" High

This is just a small idea example

I'm just looking for some tips, tricks , just your idea of wat i want to make

sania
Site Admin
Posts: 1372
Joined: Sat Aug 13, 2005 6:15 am
Contact:

Re: standard block for a conveyor in an automatic packaging

Post by sania » Fri Feb 22, 2013 10:53 am


Oreca
Posts: 16
Joined: Fri Apr 23, 2010 7:34 pm

Re: standard block for a conveyor in an automatic packaging

Post by Oreca » Fri Feb 22, 2013 11:47 pm

Well, never saw a plant with only one motor... Never saw a plant with one type of motor (speed control, on/off , two way speed etc)

So I you want to make your program nice and organised which is important, then I suggest you create a FB block.
I assume your using just step 7... so FB block would be functional.

With a FB block you can have multiple instances of a block..So it means all motors have the same logic and also you have to program it only once.
You can make a FB block in SCL code, or STL or FBD/LAD.

There are a lot of standards, many using UDT as their input/outputs. Many have multiple UDT where one UDT is for HMI interface, one for inputs, one for outputs etc...
As you can see....how far do you want to go....

I suggest, start building your logic in a FB block, compile it, use it for three motors and see what you have created :)

sania
Site Admin
Posts: 1372
Joined: Sat Aug 13, 2005 6:15 am
Contact:

Re: standard block for a conveyor in an automatic packaging

Post by sania » Sat Feb 23, 2013 8:27 am

i used this sample with et200s cpu & 65 direct motor & 30 valves & 20 sinamics g120 for conveyor system & it work very well

denhondt
Posts: 7
Joined: Sun Jul 04, 2010 10:10 pm

Re: standard block for a conveyor in an automatic packaging

Post by denhondt » Sat Feb 23, 2013 5:19 pm

The new project will be in TIA portal V11 ,it will be the first project we will make in the this software, before we used Step7 V5.4 SP5 and WinCC Flex
So i want to take a good start by making standard blocks we can use for new projects

There will be different blocks for motors like analog speed setpoint, 2 directions, On/Off

I'm a little scared for using an FB(muti Instance FB)

because when expanding a multi fb with multi instances, the DB has to be regenerated, and all values in the DB are set to "0"

With FC and global DB you can upload the values to the offline project then expand the db and transfer back to the CPU

For this project it would not be a problem, but i can think of other machines where i could use the same standard blocks in the future.

Also if you want to delete some multi instances in the beginning of the FB in the program and you regenerate the DB then all data moves some bytes , which could give problems if not programmed symbolic or if indirect adressing is used
With FC and Global DB you can simply name the deleted standard block words in the DB as Spares


I think its best i make a block for a Conveyor This conveyor does a Run Request to a Motor standard block
The motor block will be a standard block that will be used in several projects
the conveyor block is specific for this line

I doubt between use of FC or FB

denhondt
Posts: 7
Joined: Sun Jul 04, 2010 10:10 pm

Re: standard block for a conveyor in an automatic packaging

Post by denhondt » Sat Jun 08, 2013 1:50 pm

Hi,

I made some different blocks to compare,

The best i think is an FC with an DB/UDT as INOUT parameter UDT: 32bytes

Disadvantage
- High CPU cycle = 50 calls +- 16 ms (Tested with S7 ET151-8 cpu) (without the normal programm)


Tested the same code but in an FB with UDT as stat
- 50 calls +- 3 ms (Tested with S7 ET151-8 cpu) (without the normal programm)


now i was trying to copy the INOUT UDT to an TEMP UDT
to reduce the cycle time , this way only in the begin and end of the block the INOUT is used, not for each Bit/Word access

But i cant find a proper way to copy it

Software TIA V11

denhondt
Posts: 7
Joined: Sun Jul 04, 2010 10:10 pm

Re: standard block for a conveyor in an automatic packaging

Post by denhondt » Mon Jun 10, 2013 3:37 pm

Hi,

Just to get your opinion, what do you think about this part of code

I use it for my standard blocks to copy an udt from a DB to the same UDT in my temp in my first network and back again in the last network
I use an IN with the name IO_Object as ANY
For a motor it will be DB_Motors.M001

The UDT is 32 bytes long (some spares)

Software TIA Portal V11

Post Reply