ATTENTIONThis 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 |
#1
|
||||
|
||||
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.
St.Seidel |
#2
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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
|
|||
|
|||
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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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
|
|||
|
|||
Quote:
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
|
||||
|
||||
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
|
|||
|
|||
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
|
||||
|
||||
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...
__________________
kind regards Nico. |
The Following 3 Users Say Thank You to Nico Zahn For This Useful Post: | ||
zhang xin (12-20-2009) |
#14
|
||||
|
||||
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 |