LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

matlab script

Hi there...

I have a matrix from an opened loop system in matlab, the input is X(s) and the output is Y(s), where Y(s)/X(s) = [0;1;2;3;4;5;6;...;50]
I want to use the matlab script in labview to write the Y(s)/X(s).
Is anyone know how to make the script become the closed loop system in labview?
0 Kudos
Message 1 of 5
(3,210 Views)
My apologies but I am not exactly sure what you would like to do.  Are you trying to include some sort of feedback to your loop, such as the value of Y/X?  What do you mean write the Y/X?  If you would like to add feedback to your loop, the easiest way would be to use a shift register.  I am assuming that you have some sort of update formula based on Y/X for X, that you could pass to the shift register that would allow the next iteration of the loop to access this information (see below).



This could possibly be implemented in just LabVIEW, but you could certainly do it using a script node.  Repost with some more information and I will be glad to help.

Andy F.

Message Edited by Andy F. on 01-17-2006 04:48 PM

-----------------------------------------------------------------
National Instruments
0 Kudos
Message 2 of 5
(3,209 Views)
I suppose I could explain the diagram a little better... The input of the application would be your X(s), this is the starting value that is passed to the while loop.  The loop then calculates Y(s) (which is your code), then divides Y(s) by X(s), which gives Y/X.  This is then used to update X(s) (again your code).  The exit condition of the while loop is to see if Y/X is equal to any give array.  Each element is compared, which gives an array of booleans.  Each element is passed through a Not function, and then the entire array is converted to a number.  If the entire array at that point is 0 then that would mean that every element is equal to the exit array. 

Andy F.
-----------------------------------------------------------------
National Instruments
0 Kudos
Message 3 of 5
(3,204 Views)
Actually, I have a measurement data. I want to use labview as a PID control simulation like what I have done in simulink, but there is a problem, the output of the system that I've made in labview was not the same with the output of matlab. I also want to ask you how to make a transfer function in labview and use the transfer function like what I do in matlab? Here is my system. Emmm..I also want to ask you about how to build the ARMAX structure in labview?
0 Kudos
Message 4 of 5
(3,181 Views)
Hi there:

There is a transfer function VI included as part of the Control Design Toolkit. You would however have to purchase this toolkit to get this VI. Do you have LabVIEW Real-Time or the PID Toolkit? I would try to see if anything comes up in the search when you type 'transfer function'.

http://zone.ni.com/devzone/conceptd.nsf/webmain/7D612A09FAD5D3B18625703D004D7FF5
http://zone.ni.com/reference/en-XX/help/371361A-01/ptbypt/transfer_function_ptbypt/ (This is the Transfer Functon PtbyPt VI)

Let me know if this helps.

Best Regards,

Jaideep J.
0 Kudos
Message 5 of 5
(3,158 Views)