ATTENTION

This FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices.


flexsim.com

Go Back   FlexSim Community Forum > FlexSim Software > Q&A
Downloads

Q&A Using Flexsim and building models

  #1  
Old 03-20-2009
Stephan Seidel's Avatar
Stephan Seidel Stephan Seidel is offline
Flexsim User
 
Join Date: Mar 2009
Location: Dresden, Germany
Posts: 36
Downloads: 20
Uploads: 0
Thanks: 26
Thanked 22 Times in 8 Posts
Rep Power: 150
Stephan Seidel will become famous soon enough
Default PLC connection, positioning issues

Hi all,

I'm pretty new to FlexSim. Right now i'm trying to evaluate (by building a simple model) if FlexSim is capable of simulating a little high-bay warehouse. "Of course!" you'd say but there are a few constraints.

  1. We need FlexSim to communicate with a PLC or at least a PLC simulator (such as Siemens PLCSIM). Every conveyor, lift, ASRS will have several I/Os for communicating with the PLC. Almost any action such as stopping, resuming, closing or opening ports will be controlled by the PLC.
    I've read about "PLSee" but the velocitialliance.com-page is pretty old (last entry january 2006) so I'd like to know if that product is the way to go (if still available). Are there any other options/interfaces for communicating with the outside world (such as OPC).
  2. A quick example: An ASRS will put items into a rack. The positioning and placement of the item will not always be 100% exact (and will be controlled by the PLC). It's quite important to check and possibly see in 3D if the item is placed outside the boundaries of the bay. I'd guess working with collision spheres is not the way to go?
  3. A last and maybe a silly question: Is it possible to simulate the slip of items on conveyors?
Well, thanks a lot for your answers.
St.Seidel
  #2  
Old 03-20-2009
Nico Zahn's Avatar
Nico Zahn Nico Zahn is offline
Flexsim User
 
Join Date: Sep 2007
Location: Bingen am Rhein, Germany
Posts: 179
Downloads: 19
Uploads: 4
Thanks: 66
Thanked 60 Times in 32 Posts
Rep Power: 201
Nico Zahn has a spectacular aura aboutNico Zahn has a spectacular aura about
Default PLC

Hi Stephan,
you can add an OPC Communication to Flexsim by using a dll. We are using an out of the box solution we bought (not PLSEE, which is quiet expansive and as we are from Germany too far away in means of support). You need a OPC client dll to connect Flexsim to your OPC server and a OPC server to connect to your PLC. But you have to keep in mind that OPC is not like a realtime communication, you have to poll for the information in a certain intervall and write in a certain intervall (e.g. 100 ms). So the performance of you modell will be set by the amount of OPC items you want to read and write and the intervall.
You PLC has to be reachable by a network connection, e.g. it need to have a ethernet interface.

For the slip on the conveyors => it is possible for shure , but a lot of detail and calulation will alway downgrade the performance of the modell, so you might not get 1 month simulated in 60 s.

As you said you are new to Flexsim, I hope your timeline is not to narrow for this project, as I consider this quiet demanding, but possible.
__________________
kind regards Nico.
The Following User Says Thank You to Nico Zahn For This Useful Post:
Stephan Seidel (03-26-2009)
  #3  
Old 03-26-2009
Stephan Seidel's Avatar
Stephan Seidel Stephan Seidel is offline
Flexsim User
 
Join Date: Mar 2009
Location: Dresden, Germany
Posts: 36
Downloads: 20
Uploads: 0
Thanks: 26
Thanked 22 Times in 8 Posts
Rep Power: 150
Stephan Seidel will become famous soon enough
Default Positioning

Hi Nico (and all others),

thanks for your reply. (I could actually answer in german but that would not be fair for all the other users).
I've used the last couple of days to play around with FlexSim and came across one simple problem. I've said in my last post that a plc will be used to interact with FlexSim. I haven't done that yet but I'm trying to "simulate" a plc within FlexSim. Thats done by calling a user event and repeat it every 0.05 sec (plc cycle). The Flexscript in that user event is like my plc program and does all the logic in my simple model (source, BasicTE, rack, sink). What I'm trying to do is to start my BasicTE (kind of ASRS) and control its movement. So far I've managed to dispatch a task sequence (travel, load, travel, unload, etc.) to it and everything works fine. But thats not the way a real world ASRS would behave. In the real world the plc would control the ASRS like starting the vehicle, getting position data, stopping the vehicle. The FlexSim travel task does that on its own but i need to have some control over the movement. Basically the travel task (and the underlying kinemtics) are too smart. I would like to start moving the vehicle into a certain direction and stop the movement once the target is reached. Starting and stopping should be done by FlexScript in the user event.
Does anyone have an idea how that can be done? Are there any examples explaining this kind of task?

Cheers,
Stephan
__________________
---
You can't have it both ways.
  #4  
Old 03-26-2009
Steven Hamoen's Avatar
Steven Hamoen Steven Hamoen is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Location: Soest, NL
Posts: 854
Downloads: 43
Uploads: 0
Thanks: 391
Thanked 661 Times in 379 Posts
Rep Power: 684
Steven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond repute
Default

Hi Stephan,

Sounds like you have to create your own tasksequences. That way you can split up the movement of your tasks over several tasks and have sendmessage tasks in between. And then on the messagetriggers give the signals that you want.

read through the different tasktypes to get some ideas.

Steven
The Following User Says Thank You to Steven Hamoen For This Useful Post:
Stephan Seidel (03-27-2009)
  #5  
Old 03-27-2009
Pablo Concha Pablo Concha is offline
Flexsim User
 
Join Date: Aug 2007
Posts: 104
Downloads: 100
Uploads: 1
Thanks: 103
Thanked 52 Times in 37 Posts
Rep Power: 232
Pablo Concha is just really nicePablo Concha is just really nicePablo Concha is just really nicePablo Concha is just really nice
Default

Not sure if it's the same concept, but i saw this sample model in wich you can control a taskexecuter with a button to stop and a button to resume movement, according to the explanation,you stop a kinematic and the use a new one to resume the operation, i'm guessing the same idea you can use to move in a different direction?, instead of button, using the code on user events?... hope it helps..

http://www.flexsim.com/community/for...do=file&id=170

regards,

Pablo Concha E.
The Following User Says Thank You to Pablo Concha For This Useful Post:
Stephan Seidel (03-27-2009)
  #6  
Old 03-27-2009
Stephan Seidel's Avatar
Stephan Seidel Stephan Seidel is offline
Flexsim User
 
Join Date: Mar 2009
Location: Dresden, Germany
Posts: 36
Downloads: 20
Uploads: 0
Thanks: 26
Thanked 22 Times in 8 Posts
Rep Power: 150
Stephan Seidel will become famous soon enough
Default

Thanks Pablo,

this demo model will be quite useful. Just had a short look into it and its an easy way to do what I want. I'll try to implement this concept into my model.

Have a nice weekend...
__________________
---
You can't have it both ways.
  #7  
Old 04-02-2009
Stephan Seidel's Avatar
Stephan Seidel Stephan Seidel is offline
Flexsim User
 
Join Date: Mar 2009
Location: Dresden, Germany
Posts: 36
Downloads: 20
Uploads: 0
Thanks: 26
Thanked 22 Times in 8 Posts
Rep Power: 150
Stephan Seidel will become famous soon enough
Default

Hi all,

I had a deeper look into the sample model that Pablo mentioned. It does what I want but its not exactly straight forward. In the model a FR is used to move items. Is that not what TE's should do? I always connected FR's with some kind of fixed (non-moving) machinery. Whats your opinion about that way of movign items?
Anyway, now I'm a bit confused whether to use BasicTE's or FR's. Just to remind you of my task: I'd like to control the movement of an ASRS completely by script without using Tasks. Regarding the movement I'm quite confident that this can be done by using kinematics. But what about handling the items. Is there a command to release an item from a FR and hand it over to a TE (and vice versa)? Basically I'd like to check (by using a script of course) if my TE is in position and then get the item or pass it on to a FR.

Any help would be appreciated.
Stephan
__________________
---
You can't have it both ways.
  #8  
Old 04-02-2009
Tom David's Avatar
Tom David Tom David is offline
Flexsim User
 
Join Date: Aug 2007
Location: Schwaebisch Gmuend, Germany
Posts: 430
Downloads: 157
Uploads: 47
Thanks: 486
Thanked 450 Times in 233 Posts
Rep Power: 520
Tom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant future
Default

Just to give you a quick reply with some hints.

You asked how to release an item.

Have a look at the following commands.
releaseitem();
holditem();
receiveitem();
getitemstate();
moveobject();
transfernode();
transportincomplete();
transportoutcomplete();

I guess that with this commands you can do what you want, but I am not sure, because I did not test it. But I hope, that my hints are still helpful.
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions."
The Following User Says Thank You to Tom David For This Useful Post:
Stephan Seidel (04-06-2009)
  #9  
Old 04-06-2009
Stephan Seidel's Avatar
Stephan Seidel Stephan Seidel is offline
Flexsim User
 
Join Date: Mar 2009
Location: Dresden, Germany
Posts: 36
Downloads: 20
Uploads: 0
Thanks: 26
Thanked 22 Times in 8 Posts
Rep Power: 150
Stephan Seidel will become famous soon enough
Default

Many thanks Tom,

I finally found a solution that works for me. The ASRS is no longer a TaskExecuter. Its now a FixedResource which receives items, then changes its position and releases them to another FR. I use kinematics for travelling and implemented the stop and resume functions Pablo mentioned. For a small demonstrator this functionality is more than sufficient and now I have to face the communications issue
__________________
---
You can't have it both ways.
  #10  
Old 12-19-2009
zhang xin zhang xin is offline
Flexsim User
 
Join Date: Dec 2008
Location: China
Posts: 136
Downloads: 147
Uploads: 0
Thanks: 81
Thanked 6 Times in 6 Posts
Rep Power: 150
zhang xin is on a distinguished road
Default

Quote:
Originally Posted by Nico Zahn View Post
Hi Stephan,
you can add an OPC Communication to Flexsim by using a dll. We are using an out of the box solution we bought (not PLSEE, which is quiet expansive and as we are from Germany too far away in means of support). You need a OPC client dll to connect Flexsim to your OPC server and a OPC server to connect to your PLC. But you have to keep in mind that OPC is not like a realtime communication, you have to poll for the information in a certain intervall and write in a certain intervall (e.g. 100 ms). So the performance of you modell will be set by the amount of OPC items you want to read and write and the intervall.
Hi, Nico,
1 how do you treat the difference between realtime and simulation time.
2 Is there any free opc dl which can be used in flexsim?
3 Can we use soket instead of opc? is it more diffcult than opc?

thanks

Last edited by zhang xin; 12-19-2009 at 08:06 PM.
  #11  
Old 12-20-2009
Nico Zahn's Avatar
Nico Zahn Nico Zahn is offline
Flexsim User
 
Join Date: Sep 2007
Location: Bingen am Rhein, Germany
Posts: 179
Downloads: 19
Uploads: 4
Thanks: 66
Thanked 60 Times in 32 Posts
Rep Power: 201
Nico Zahn has a spectacular aura aboutNico Zahn has a spectacular aura about
Default

Hi zhang,
1. The difference between simulation and realtime can be measured by the ratio between realtime and simulation time. Create a visual tool and let it calculate the ratio between the two times while your simulation is running with the speed of 1. If you got a big modell there might be a significant difference. If the difference between the realtime and the simulationtime is to big you have to find a way to syncronise them. E.g. think about the chain of events and figure out if the plc or the simulation will wait for the answer of the communication partner. Find out if the delay by the simulation is relevant for the result.

2. I do not know if there is a free dll for opc communication. You can build your own with a toolbox from opc-server providers, but it will take some knowledge and time. (some downloads are available at www.softing.com , you can switch the webside even to chinese)

3. For the socket communication there are commands in flexsim. If you want to play around, try http://www.freedownloadscenter.com/N...g_Sockets.html . You have to check for incoming communication (polling), but I wonder how you could put the signals from the plc to socket communication. (Maybe there is a opc server which can do this for you. I think i have seen something like this at http://www.inat.de/index.html"margin-top: 10px" align="right">
The Following User Says Thank You to Nico Zahn For This Useful Post:
zhang xin (12-20-2009)
  #12  
Old 12-20-2009
zhang xin zhang xin is offline
Flexsim User
 
Join Date: Dec 2008
Location: China
Posts: 136
Downloads: 147
Uploads: 0
Thanks: 81
Thanked 6 Times in 6 Posts
Rep Power: 150
zhang xin is on a distinguished road
Default

Hi. Nico, thank you so much for your help.

I wonder that according to your experience, is there any significant difference between these two times?
  #13  
Old 12-20-2009
Nico Zahn's Avatar
Nico Zahn Nico Zahn is offline
Flexsim User
 
Join Date: Sep 2007
Location: Bingen am Rhein, Germany
Posts: 179
Downloads: 19
Uploads: 4
Thanks: 66
Thanked 60 Times in 32 Posts
Rep Power: 201
Nico Zahn has a spectacular aura aboutNico Zahn has a spectacular aura about
Default

hi zhang,
this depends on the number of events in your model and the speed of your cpu. I added a modell in which the ratio is shown. So for small modells the ratio is pretty close to 1. You can try it with a bigger modell or higher runspeeds and it will go down...
Attached Files
File Type: zip Ratio.zip (33.2 KB, 259 views)
__________________
kind regards Nico.
The Following 3 Users Say Thank You to Nico Zahn For This Useful Post:
zhang xin (12-20-2009)
  #14  
Old 04-08-2010
Stephan Seidel's Avatar
Stephan Seidel Stephan Seidel is offline
Flexsim User
 
Join Date: Mar 2009
Location: Dresden, Germany
Posts: 36
Downloads: 20
Uploads: 0
Thanks: 26
Thanked 22 Times in 8 Posts
Rep Power: 150
Stephan Seidel will become famous soon enough
Default PLC issue

Hi all,

I dont know if anyone is following this thread but i'd like to let you know about the plc connection issue.
Finally we've found a solution that will (hopefully) work for us. There is a software plc from IBH softec (http://www.ibhsoftec-sps.de/english/Selection_PLC.htm) which provides a dll for writing and reading values to and from the plc. It's compatible to SIMATIC PLCs and can be programmed with the Step7 PLC programming tool.
Synchronisation is necessary in case timers are used in the plc code. They need to be synchronised with Flexsim's simulation time. As of yet i've not implemented such a synchronisation but i'd assume it will only work for a simulation time factor slower than real-time up to 2x real-time. Faster simulations face the problem that the plc cycle will be too long in relation to simulation time and simulation results will be not as accurate any more.
Communication between Flexsim and the plc is quite fast and i'd say its much faster than OPC. But so far i've only developed a very small "proof-of-concept" model.

That's all folks...
Stephan
__________________
---
You can't have it both ways.

Last edited by Stephan Seidel; 04-08-2010 at 06:50 AM.
The Following 7 Users Say Thank You to Stephan Seidel For This Useful Post:
Tom David (04-09-2010)


Thread Thread Starter Forum Replies Last Post
How to recognize the task excuter by connection Sung Kim Tips and Tricks 2 06-11-2008 10:13 AM
how to send msg to another which do not have connection with the sender object KelvinHo Q&A 3 03-05-2008 04:28 AM


All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.