POUTSUB
ModelingRetrieves output from a control plant.
Use
<Control_PlantOutput
id = "2"
label = "PlantOut"
num_element = "2"
variable_id_list = "100, 200"
hold_order = "2"
interpreter = "Python"
script_name = "poutsub.py"
usrsub_fnc_name = "POUTSUB"
usrsub_param_string = "USER(100, 200)"
/>
Format
- Fortran Calling Syntax
-
SUBROUTINE POUTSUB (ID, TIME, PAR, NPAR, IFLAG)
- C/C++ Calling Syntax
-
void STDCALL POUTSUB (int *id, double *time, double *par, int *npar, int *iflag)
- Python Calling Syntax
-
def POUTSUB(id, time, par, npar, iflag):
- MATLAB Calling Syntax
- Not supported.
Attributes
- ID
- [integer]
- TIME
- [double precision]
- PAR
- [double precision]
- NPAR
- [integer]
- IFLAG
- [logical]
Example
from math import sin, cos, pi
def POUTSUB(id, time, par, npar, iflag):
print("POUTSUB, input : ", id, time, par, npar, iflag)
force = []
for i in range(npar):
var_id = int(par[i])
x, errflg = py_sysfnc("VARVAL", var_id)
force.append(x)
print("POUTSUB, output : ", force)