LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to import matrix entries into State Space Funktion.vi?

I'm creating a state space funktion in labview. Now i want to specify the entries of the matrices A,B,C and D. I have the entries in an excel table and i'm looking for a solution to import this entries into labview. I don't want to define them by hand because the matrices are of a wide structure.

0 Kudos
Message 1 of 4
(2,470 Views)

Hi corleone13375,

 

if need to import it only once you can use this trick. If you need to copy data in each run, this VI can be useful.

 

Best regards,

CaravagGIO

0 Kudos
Message 2 of 4
(2,447 Views)

First you need to convert the A,B,C,D matrices from 'string' to a State-Space model. You can use this example VIs as reference:

 

C:\Program Files (x86)\National Instruments\LabVIEW 2013\examples\Control and Simulation\Control Design\Model Construction\CDEx Creating SS Model from String Matrix.vi

 

Then if you create a Indicator out of the "CD Construct State-Space Model" like this:

 

SS copy.PNG

Then you have the cluster that represents the state-space model, you can select the control, then use <CTRL-C> to copy into the 'clipboard'.

SS copy 2.PNG

 

Then, open you State-Space function from simulation,  select the 'state-space' parameter and use the 'Paste from clipboard' button. You should see your model parameters showing for you.

SS copy 3.PNG

Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 3 of 4
(2,431 Views)

That works well, thank you!

0 Kudos
Message 4 of 4
(2,409 Views)