I've been trying to add a pipe with a check valve with using AddBinJunction. However, when I tried using this function with the code "CVPIPE' I get an error message with "Undefined function or variable 'typecode' "- which appears to be referring to the code for the Check Valve. The codes for the remaining valve types work fine, It seems like the only issue is with the CV.
I would appreciate any insights on how I could fix this issue, or perhaps an alternative approach on adding control valves.
% arguments: newNodeID,X,Y,ToNodeID,newElevation,newBaseDemand,newDemandPattern,newPipeID,
% Code - Constants for valves: 'CVPIPE', 'PIPE', 'PUMP', 'PRV', 'PSV', 'PBV', 'FCV', 'TCV', 'GPV'