FlexSim Community Forum

FlexSim Community Forum (https://archive.flexsim.com/index.php)
-   Training, Consulting, Employment (https://archive.flexsim.com/forumdisplay.php?f=122)
-   -   Help with Rail API (https://archive.flexsim.com/showthread.php?t=3108)

Mauricio Souza 07-10-2015 10:17 AM

Help with Rail API
Dear users, hello.

I'm modeling a rail operation and I'm using the Rail API add-in, that was posted here once.

The add-in is working fine and the model is simple for testing: I put an User Event to run a logic each 12 hours. The train arrives, than it has a discharging operation and the train leaves.

By the first attempt, it works fine, I just send the train to an edge (edge 15 to edge 6), it stops and than I send the train from edge 6 to edge 14. You can check this in attached file "Rail_v1".

The problem is: When I send the train to an edge that is smaller than the trainlength (I concluded this, I'm not sure if this is right), from edge 6 to edge 7, it looks like the train is compressed inside edge 7, as you can see in attached file "Rail_v2". I'd like it not to compress the train.

After I solve this "compression" problem, I want to put a logic to simulate the discharge of each wagon. My idea is to put 70 nodes (because there are 70 wagons) and make a looping to travel and operate (e.g. sending a message On Arrival to a processor that represents the discharge operation). As I said, when I try to do this, the train is compressed always when it goes to an edge smaller than its length.

So I ask you people to kindly help me with the "compression" problem and if you have any others tips for me, it will be greatfull. I hope I could explain clearly my problems. If you need any further information, please ask me.

Best regards.



Mauricio Souza 07-10-2015 10:20 AM

Rail API
I don't know if I uploaded tha attach. I'm new at FlexSim. Can anyone help me saying if the attach is uploaded? If it is not, how can I upload an exemple of my model?



sagar bolisetti 07-10-2015 01:01 PM

Hello Mauricio

Have you tried this modeling of rail operation in AGV module.Instead of nodes you can use control points on the network where an AGV is dispatched to other point on network.If you attach trailers to AGV and use them as wagons and treat one control point as base point that is connected to a fixed resources like queues, from there you can transport flowitems to dropoff points.A similar approach is presented here

In the additional options if you click on Manage attachments a window will popup,there you can upload attachments from your computer.

Mauricio Souza 07-13-2015 06:01 AM

Attached files
2 Attachment(s)
There are the attached files about the problem I have said.

Dear Sagar, thank you for the tip you gave me. I'll try this way with AGV.

Nevertheless I'd like to understand why that problem I mentioned happens with my model and if there's any way I can solve it.

Thank you.



Mauricio Souza 07-14-2015 03:43 PM

It's running fine
I'm using AGV to model the train operation and it's working fine. Thank you.

I have a question about writing a code, maybe somebody can help me:

I want to set the Acceleration and Deceleration values for my AGV Network. I want to set it automatically in an "OnRunStart trigger", becouse I read the value from an Excel table. But I'm having some problems.

My code at OnRunStart Trigger is:

double aceleracao = gettablenum( xxx - table from excel);

setvarnum( node("AGVNetwork",model() ),"agvTypes/DefaultAGV/speeds/Acceleration/Loaded",aceleracao);

But it doesn't update the variable.
Can anyone helpe me saying where is my mistake and how to solve it?

Best Regards.


Phil BoBo 07-14-2015 05:03 PM

You can't put a path into the 2nd parameter of setvarnum(). setvarnum() only works with the top level of variables. If your variables are multidimensional, you need to reference them another way. Such as:


set( node("AGVNetwork>variables/agvTypes/DefaultAGV/speeds/Acceleration/Loaded",model() ),aceleracao);

Mauricio Souza 07-15-2015 05:59 AM

it's working
It's working fine.

Thank you.



All times are GMT -6. The time now is 05:50 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.