From Friday, January 17th 11 PM CDT (January 18th 5 AM UTC) through Saturday, January 18th 11:30 AM CDT (January 18th 5:30 PM UTC), ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing a Cluster In and a Structure Out a MathScript Node

A Cluster when being passed into a mathscript node becomes a Structure.

A Structure when being passed out a mathscript node becomes a Cluster.

Here is the script, that you can refer 

BangNg_0-1599758022858.png

Here, I passed a cluster named "Area1". 

Then, I can use "Area1.xxxx" to access to values of this Cluster.

 

I defined a structure named "Load_Cmds", then I can give values for its elements as "Load_Cmds.xxxx". 

Then, when I pass out that structure, "Load_Cmds" becomes a Cluster.

Thanks,

Bang Nguyen, Clarkson University

 

0 Kudos
Message 1 of 3
(3,166 Views)

@BangNg wrote:

 

Here is the script, that you can refer 


No, that's just a picture.

 

(What you are describing is already covered in the help.)

0 Kudos
Message 2 of 3
(3,135 Views)

Here is the script:

-----------------------Access to Cluster named "Area1"-------

Pload(1)= Area1.Vtl_CrClg; Pload(2)= Area1.Vtl_CrElt; Pload(3)= Area1.Vtl_MsClg; Pload(4)= Area1.Vtl_MsElt;
Pload(5)= Area1.NVtl_CrClg; Pload(6)= Area1.NVtl_CrElt; Pload(7)= Area1.NVtl_MsClg; Pload(8)= Area1.NVtl_MsElt;
Pload(9)= Area1.MW_load; Pload(10)= Area1.IPNC_load; Pload(11)= Area1.Propulsion; Pload(12)= Area1.HRRL;

--------------------Define a Structure named "Load_Cmds"------

Load_Cmds.VCrClg_cd=O(1);Load_Cmds.VMsClg_cd=O(2);Load_Cmds.VCrElt_cd=O(3);Load_Cmds.VMsElt_cd=O(4);
Load_Cmds.NCrClg_cd=O(5);Load_Cmds.NMsClg_cd=O(6);Load_Cmds.NCrElt_cd=O(7);Load_Cmds.NMsElt_cd=O(8);
Load_Cmds.MW_cmd=O(9);Load_Cmds.IPNC_cmd=O(10);Load_Cmds.Prop_cmd=O(11);Load_Cmds.HRRL_cmd =O(12);

-------------------------------------------------------------------------------

If you have more questions, please let me know,

0 Kudos
Message 3 of 3
(3,128 Views)