Ask Your Question
1

PSS/E-FORTRAN_sharing variables between modules

asked 2014-01-09 13:01:27 -0500

moisanchez gravatar image

Hi,

Im trying to connect two modules in PSS/E by FORTRAN language (control module and generator module of an inverter). The 2 outputs of the control module(say VAR(L) and VAR(L+1)) are the 2 inputs of the generator module (which is encrypted)(WIPCMD and WIQCMD which are dynamic simulation arrays) but I am not be able to do this connection.

At the beggining of my control module I write USE [generatormodule] so as I have available all the variables of the generator module. With the .flx file I compile the [generatormodule].mod too.

My control model has from MODE 1 to 4 and at the end of MODE 3 (just before the 'return') I write:

  WIPCMD(MC)=VAR(L)
  WIQCMD(MC)=VAR(L+1)

Being MC the machine index where apply this plant-related control model.

I don't know if the previous logic is correct, any idea?

Regards

edit retag flag offensive close merge delete

Comments

I think the logic in the control model should be OK. Just make sure that calling sequence of the models in the CONEC.

yfwing gravatar imageyfwing ( 2014-01-09 15:15:32 -0500 )edit

I'm new creating plant-related models. I thought that, in this case, the connection of the variables would only be done inside this model. So it is necessary to create also a CONEC model? If it's, should I write only the CALL statements + variable connections or something else? Thank you very much.

moisanchez gravatar imagemoisanchez ( 2014-01-09 16:55:14 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-07-07 07:42:42 -0500

agastalver gravatar image

I think the proper way to do that is using macind to get the mc value of the machine, and then assign the values to the arrays wipcmd and wiqcmd. Using this method, you don't have to import any other model inside the controller one, and you can control multiple and configurable machines.

Example: into the controller model

call macind(bus_mac, id_mac, mc_mac, ierr)
wipcmd(mc_mac) = var(l)
wiqcmd(mc_mac) = var(l+1)

where:

  • bus_mac is the bus number where the inverter is (ibus if the controller use the same machine).
  • id_mac is the id of the machine inside the bus.
  • mc_mac is the position of the machine in the arrays.
edit flag offensive delete link more

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

Stats

Asked: 2014-01-09 13:01:27 -0500

Seen: 1,575 times

Last updated: Jul 07 '14