Jump to content

Question: Can tables be updated AND used while the simulation runs?


jord41
 Share

Recommended Posts

First of all, Hi!

This is my first time posting after some months of stalking in the shadows of the forum and after what I've seen, I'm certain I'll find my answer here!

I've been working with Simio for some time now, and there has been something bothering me for a while, if something in a binded file changes, so does in Simio after you import the table again, or (if you have it on automatic) restart the simulation. But what if mid-run you wanted to add some values to one of your tables after a change in the file was made but you can't allow yourself to restart again? (A bit of a dramatic case, I know!) 

 I've already seen that you can re-import data mid-run, but the values Simio uses don't get updated instantaneously while running, it's like it adds them to the table but waits for the next run to use them!

So, my question is, is there a way to make Simio take in those new values in the binded table without the need to restart the simulation?

 

Thanks to everyone in advance! 

Link to comment
Share on other sites

15 hours ago, GFurtado said:

Updating the data mid-run isn't a good simulation practice, unless you're building some gimmicky application.

But I manage to work this out with this little guy in the Table Ribbon. Have you tried it yet? 

2114817058_Manualimport.png.ebfdfe01af260ac150282ade74829efe.png

Hi GFurtado!

Thanks for your answer! I'm using Simio 11.189 as my testing ground, and even though the ribbon is not the same, I can import data trough it, the problem is, even tho the data is imported into the table, it is not updated mid run so Simio keeps using the values previous to the new import, I'll elaborate a bit.

Imagine these are the original values in the binded table I created. 

image.png.95feb243cdefd61b7281a368a5c4f23c.png

 

With those original values, I start the simulation and after a while I update the binded file (the .csv where Simio is taking values from) and I click on update table with the following options enabled. (Bear in mind! I've tried all of the options in the image below to no avail!)

image.png.4cb2e917f42132a992dce57fcbb83df3.png

(Options used before clicking update mid-run)

image.png.ee7bbeb18c8a5f6cd2d74add4f6d41e1.png

(Updated mid-run table, values get updated but Simio doesn't use them!)

 

While the values get updated, Simio doesn't use them in this run (in the example I posted, it would only use the original first 9 values instead of all of the 19 values provided).

As further context, I am indeed trying to make kind of a 'wacky' simulation, my idea is to update the .csv providing the data to the table at periodic intervals with new data from a real life reading from a machine, or something similar, and use that data as the entity creation time to try and make kind of a 'parallel' simulation with the actual readings of the system. But of course, for me being able to do that I need to know if Simio can update tables with new data and USE that new data mid - run!

 

Thank you so much for your reply and for your time!

 

Have a great one!

Link to comment
Share on other sites

8 minutes ago, jord41 said:

Hi GFurtado!

Thanks for your answer! I'm using Simio 11.189 as my testing ground, and even though the ribbon is not the same, I can import data trough it, the problem is, even tho the data is imported into the table, it is not updated mid run so Simio keeps using the values previous to the new import, I'll elaborate a bit.

Imagine these are the original values in the binded table I created. 

image.png.95feb243cdefd61b7281a368a5c4f23c.png

 

With those original values, I start the simulation and after a while I update the binded file (the .csv where Simio is taking values from) and I click on update table with the following options enabled. (Bear in mind! I've tried all of the options in the image below to no avail!)

image.png.4cb2e917f42132a992dce57fcbb83df3.png

(Options used before clicking update mid-run)

image.png.ee7bbeb18c8a5f6cd2d74add4f6d41e1.png

(Updated mid-run table, values get updated but Simio doesn't use them!)

 

While the values get updated, Simio doesn't use them in this run (in the example I posted, it would only use the original first 9 values instead of all of the 19 values provided).

As further context, I am indeed trying to make kind of a 'wacky' simulation, my idea is to update the .csv providing the data to the table at periodic intervals with new data from a real life reading from a machine, or something similar, and use that data as the entity creation time to try and make kind of a 'parallel' simulation with the actual readings of the system. But of course, for me being able to do that I need to know if Simio can update tables with new data and USE that new data mid - run!

 

Thank you so much for your reply and for your time!

 

Have a great one!

Hi again! Ok! I must've missed it because I tried to use it as a time table (for arrival times) , but now I've tried what you told me before with it as a State and it does update both the table and the simulation! (It takes values at random, but it works! I'll try to find a way to make a time index!) So I'll update my question! Can arrival time tables be modified the same way? Because it didn't work for me using the method we both described! It changed the units and got a bit fuzzy with it, like taking values at random instead of following the order of the table! 

 

Referencing the pictures above, it would be like it started following the arrival table in order (3,3,3,4,8,9...) and after I update it it just goes full random and takes whatever value it wants(making it quite hard to check if it actually used the new ones which it usually doesn't for some reason) , is there a way to keep the arrival times following an order after I update the table? Or am I doing something terribly wrong? (Which being honest, is much more likely! haha)

 

Thanks to everyone in advance, and so sorry for my mistake!

 

Link to comment
Share on other sites

At some point I would start looking for a SCADA system, write it in Python or anything outside Simio.

A Simio Engineer would be better suited to help you, but I still believe you could build this inside Simio (maybe through an API?).

 

I manage to build a very ugly version of this that kinda works. It's not real real-time, because I still need to click on the manual import button (I don't know how to help you with this).

  • I set my source's Arrival Mode to On Event;
  • Create a process with a Decide step that checks if the table received a new value:
    • If it received a new value, trigger SourceEvent;
    • If it didn't, check again a second later.

466982411_Fireevent.png.6e6a26a5722c12ef1bd96774c15b7a90.png

As I said, it's not very elegant, but I hope it inspires you to find the right solution.

  • Thanks 2
Link to comment
Share on other sites

Hi @GFurtado ! 

 

Thank you so much for your reply! I tried using the following to make the table go in order:

TableName[ Math.Ceiling(Random.Uniform(0,TableName.AvailableRowCount) , ColumnNumber ] 

As @willem once posted in the forums, but instead of columns I used rows. Your logic works perfectly! And yes, now I find that there's no way for the tables to update themselves, I tried messing around with logic for a while but I found nothing of use. I posted another question about that kind of update too!

 

 

But I guess I need help from one of the developers now... I mean, my computer skills are not bad but I'm not a software engineer, so API use is a bit out of hand for me. I tried creating a clicker or something similar in Python with low click time (around 0.03s/click)  and it actually works, but it really slows down the whole system and it's probably the most barbaric solution that problem could have! 

I'll keep searching for a solution, and once again, thank you so much for your time! 

Link to comment
Share on other sites

Hi jord41,

Simio loads the bound tables once during the initialization in the Simio tables.
Data access requires a lot of computing time. (More for writing as reading).

I see that you only have 1 column of integer values.

My recommendation is that you do not import the table into a Simio table. It's best to create an integer or real state of type vector.
Then you use e.g. the Read-Step or the ExcelRead-Step. In conjunction with a timer or the sample example loop of GFurtado you can load the data at intervals. I think that this could be a solution. At least that's how I would do it if I had to work with real-time data.

Normally, such real-time data is written to a SQL database by a PLC or something like that. Then you can use the SQL steps anytime in Simio.

Best regards
Pascal

  • Thanks 2
Link to comment
Share on other sites

15 hours ago, ATSProThiede said:

Hi jord41,

Simio loads the bound tables once during the initialization in the Simio tables.
Data access requires a lot of computing time. (More for writing as reading).

I see that you only have 1 column of integer values.

My recommendation is that you do not import the table into a Simio table. It's best to create an integer or real state of type vector.
Then you use e.g. the Read-Step or the ExcelRead-Step. In conjunction with a timer or the sample example loop of GFurtado you can load the data at intervals. I think that this could be a solution. At least that's how I would do it if I had to work with real-time data.

Normally, such real-time data is written to a SQL database by a PLC or something like that. Then you can use the SQL steps anytime in Simio.

Best regards
Pascal

Hi @ATSProThiede!

Thanks for the reply! I did try using both types of blocks before and they're pretty good for updating states in real time, but I wanted to create the entities based on a Date/Time column from a table and I wasn't able to do so with either of those. As "barbaric" as it sounds the clicker solution actually works fine, and allows you to up or down the simulation time with no problem while still refreshing the tables, but it doesn't allow fast-forwarding and let's be honest, it's not professional at all. 

Yet until I find out how to use the API it's the best I can do with my knowledge!

Thanks again!

George 

Link to comment
Share on other sites

Hi George,

I know the normal ways, to create an entity from a table are: 1) Use a timer with the date/time table for a trigger for a own process or 2) A source with the arrival table option.

If you want to create entities, maybe you can make a loop process like GFurtado with an Read-Step/Excel-Step and then you can use the Create-Step of Simio.
Then you can check with an Decide-Step "TimeNow >= value" for example and create your Entity. With this option you can use FastForward too. With an lower delay time it is near the real time. Maybe this could be a solution for your problem. Because, then you dont need a third party tool to click on import.

I checked the Simio API and I dont find something about a trigger for the Simio buttons or a button click event, what we can use for the problem.

It would be nice, if there is an API to "use" the button click processes. For example, to import one or all tables again.
Maybe a professional Simio API developer know more and can write here.

Have a nice day!

Best regards
Pascal

  • Thanks 1
Link to comment
Share on other sites

On 8/9/2019 at 7:51 PM, ATSProThiede said:

Hi George,

I know the normal ways, to create an entity from a table are: 1) Use a timer with the date/time table for a trigger for a own process or 2) A source with the arrival table option.

If you want to create entities, maybe you can make a loop process like GFurtado with an Read-Step/Excel-Step and then you can use the Create-Step of Simio.
Then you can check with an Decide-Step "TimeNow >= value" for example and create your Entity. With this option you can use FastForward too. With an lower delay time it is near the real time. Maybe this could be a solution for your problem. Because, then you dont need a third party tool to click on import.

I checked the Simio API and I dont find something about a trigger for the Simio buttons or a button click event, what we can use for the problem.

It would be nice, if there is an API to "use" the button click processes. For example, to import one or all tables again.
Maybe a professional Simio API developer know more and can write here.

Have a nice day!

Best regards
Pascal

Hello Pascal!

Thank you so much for your reply! I tried the method you proposed this weekend and it worked quite well! It fixes the issue with  updating the table too! So I'd like to thank you and @GFurtado for your replies! Without your help I'm sure I wouldn't have being able to fix this! 

Have a great day!

Best to both!

George

  • Like 1
Link to comment
Share on other sites

  • 2 years later...
×
×
  • Create New...