Ask Your Question
1

Call a external .dll from the fortran user model

asked 2019-04-29 07:25:26 -0500

smint85 gravatar image

Hello,

I would like to create a user written model in which I could call a external .dll containing the whole PLC code of the real machine. Is this possible? Is it possible to gather everything (original .dll + user fortran code) in only one .dll to share with other people?

regards, V

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2019-04-29 22:51:13 -0500

txc gravatar image

I am assuming you have the external dll and also the fortran code that was used to compile this dll (say we name this dll A). What you can do in your fortran code is call the subroutines that are in the dll A. Say the dll A has a subroutine called plcmodel(mc,slot), you can in your fortran code, call this subroutine plcmodel with proper arguments defined. You can then use the environment manager to compile both the fortran codes into one dll say dsusr.dll and then share with whoever you want to.

If you only have the dll A and not the fortran code that was used to compile the dll A, then you can't do what you intend to. However if you have the object file, you can do the above.

If you want to know which subroutines are called in the dll A, you can use a free software called dependency Walker that tells you what subroutines are exported in the dll.

edit flag offensive delete link more

Comments

Thank you. I do not have access to the fortran code of dll A. but I will try to get the .obj to include everything in only 1 dll.

smint85 gravatar imagesmint85 ( 2019-05-06 02:57:57 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools

1 follower

Stats

Asked: 2019-04-29 07:25:26 -0500

Seen: 1,150 times

Last updated: Apr 29 '19