Why MotionView UserSubroutine "sysfnc" returns all 0?

User: "Garand"
Altair Community Member
Updated by Garand

Hello everyone,

I used a SYSFNC Subroutine in my Python subroutine script, for reading some system state values. The usage are showed below:

`USER({m_mp_dth.idstring},{m_mw_dth.idstring})`

def CNFSUB(id, time, par, npar, loci, ni, locj, nj, gap, gapdot, gapdotdot, dflag, iflag):   
ipar = [0]*3    
ipar[0] = int(par[0])    
ipar[1] = int(par[1])    
ipar[2] = int(par[1])    
[dw, err] = py_sysfnc("DY", ipar)  # mP_dth, mW_dth, mW_dth [70000094, 70000093, 70000093]    
py_errmes(err, "Error calling SYSFNC for DY, dw", id, "STOP")    
print("DY -- dw=%r, err=%r" % (dw, err))
…
return …

I made a print for debugging, and all the print is:

DY -- dw=0.0, err=0

Seems the sysfnc returns 0 correctly. But i also made a output for the same system state:

DY({m_mp_dth.idstring},{m_mw_dth.idstring},{m_mw_dth.idstring})

The output curve in HyperGraph do has a value, shows below:

image.png

Why did SYSFNC not read those data? Is the problem in my scripting or defining the input parameters for USER()?

Could anyone help me out on this?

Sincere gratitude,

Garand

Find more posts tagged with

Sort by:
1 - 1 of 11
    User: "Orestis_YB"
    Altair Employee
    Accepted Answer

    Hello @Garand,

    you could maybe workaround that. Try to use a GFOSUB and store the sysfnc results in global variables. Then you may be able to access those from the CNFSUB.

    Hope this helps!

    Best regards,
    Orestes