LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Use LABVIEW charts with Mathscript

Hi,

   I recently tried to work on Mathscript and it is really amazing. what I tried to figure out is:

  •     Instead of plotting using traditional "plot" statement, how to use LabVIEW chart ( I know how to Add output but the graph were not as expected
  • Is there any mean to get rid of this "Lengthy" delay that "ALL MATLAB User know" for first time compilation?

 

Thanks in advance

Waleed El-Badry MSc.,MCPD, ISTQB Certified Tester
Assistant Lecturer
Mechatronics Department
Faculty of Engineering
Misr University for Science & Technology



View Waleed El-Badry's profile on LinkedIn

0 Kudos
Message 1 of 8
(8,883 Views)

Hi,

 

What kind of graph do you expect? Would you please give some examples?

 

In LabVIEW, you can customize the graph control to give better UI.

0 Kudos
Message 2 of 8
(8,872 Views)

hi ttr,

       I actually try to plot using LABVIEW chart x from -2 to 2 step 0.1 and y(sqaure x) using mathscript as implementation.

Waleed El-Badry MSc.,MCPD, ISTQB Certified Tester
Assistant Lecturer
Mechatronics Department
Faculty of Engineering
Misr University for Science & Technology



View Waleed El-Badry's profile on LinkedIn

0 Kudos
Message 3 of 8
(8,842 Views)

Hi,

 

From your reply, I can not think of any difficulty in using LabVIEW chart.

 

Do you use MathScript Node? Could you please attach your VI? Then, I can exactly know what you want.

0 Kudos
Message 4 of 8
(8,838 Views)

VBCoder,

 

If you are creating the vectors x and y then plotting them against each other, you should probably use an XY Graph.  Create two outputs on the MathScript node, one for x and one for y, then bundle them together and connect the cluster to an XY Graph.  The attached VI (saved in LabVIEW 8.5) shows how to do this.  Make sure that you set the datatypes of the outputs to "DBL 1D" from the right-click shortcut menu.

 

Chris M

0 Kudos
Message 5 of 8
(8,830 Views)

Well Chris,

         I was about to post the solution, but as I said, I'm in a middle of experts 🙂

 

It took me 3 hours to figure it out. I should've checked your answer 🙂 . I resolved to the same suggesstion of yours. I only added some functionality to get the newbies like me being acquainting with how easy to work with LABVIEW mathscript based on MATLAB knowledge.

 

Waleed El-Badry MSc.,MCPD, ISTQB Certified Tester
Assistant Lecturer
Mechatronics Department
Faculty of Engineering
Misr University for Science & Technology



View Waleed El-Badry's profile on LinkedIn

0 Kudos
Message 6 of 8
(8,823 Views)

VBCoder,

 

Good to hear that you've got it working the way you like.  Note that you can remove the "Build Array" and "Array to matrix" functions before the upper MathScript node and get the same result.  If you're interested, here are some demos that might help getting started with MathScript.

 

Chris M

0 Kudos
Message 7 of 8
(8,806 Views)
righ click your output, select 1D-array then hook up you xy graph
0 Kudos
Message 8 of 8
(8,522 Views)