Showing results for 
Search instead for 
Did you mean: 

Create API at Simtalk


There are some routines that I use in my models that I have to create them every model that I create. Is there some way to create API at simtalk?



Re: Create API at Simtalk




You can save your objects (including methods) as object files into Windows. Then, you import them into your models. Another option is to include all your routines into a folder and save it as a Library to include it in your models using the Manage Class Library button (Right-click on a folder to check this option). 

Best Regards,
Paulo Araujo

Did you like the answer? Then click the Thumbs Up button.
Did the answer solve your problem? Then accept the answer as solution.

Re: Create API at Simtalk

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

have a look in templates (menu item in the method editor and as a folder in the plant simulation installation).

Make a txt-file from your program and format it like the other text files in the templates folder, then you can select your method  with the templates menu of the method editor in each project.

Steffen Bangsow
freelance simulation specialist  

Re: Create API at Simtalk


What do you exactly want to do through the API ?


Re: Create API at Simtalk


For example, let´s say I created an object that will have the cycle time counted through an internal method so my method would contain the syntax:


wait cycle_time;


If I do that, the cycle time will be counted without consider if the object is paused or failed.

To resolve that I would like to create an API called wait_cycle_time which will count the operating time discarding pauses and pailures autolatically. The syntax to call the API would be




Of course my appications have much more complexes methods than the example and that kind of syntax would be writen in some part of those methods.

Re: Create API at Simtalk


If I understood you right,


you are resolving the net cycle time,


w/o breakdown times / pauses


through a  selfdesigned method called "wait_cycle_time"


I guess, what @araujopaulo  posted will help


you organize these kind of frequently used methods in your


present  and future models.