LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

My Outputs are not getting Updated

So Based on my input in mathscript, I am finally calculating the Velocity. 

There are some quaries related to my Labview codes are - 

1. Why my input to Inverse Kinematics are incompatible as it is showing warning.

2. Why my every values not updated i.e all output are 1D array and it should store all the calculated values.

3. How to configure the loop rate and calculation rate together using Mathscript.

 

0 Kudos
Message 1 of 5
(536 Views)

Hi rishab,

 


@rishab_kr wrote:

So Based on my input in mathscript, I am finally calculating the Velocity. 

There are some quaries related to my Labview codes are - 

1. Why my input to Inverse Kinematics are incompatible as it is showing warning.

2. Why my every values not updated i.e all output are 1D array and it should store all the calculated values.

3. How to configure the loop rate and calculation rate together using Mathscript.


  • Why do you need to use MathScript so heavily? I guess all of this could be replaced by "plain" LabVIEW functions... (There are a lot of functions in the Math palette, including matrix calculations.)
  • Why do you need to place this sequence frame for no good reason?
  • What's the point of the TimedWhileLoop? How often do you need to recalculate the equations?
  • Why do you want to "configure the loop rate using MathScript"?
  • You didn't attach the global variable(s) that you use in your VI...

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(513 Views)

1. Basically I am new to graphical programming and I have implemented code in MATLAB, so I started with Mathscript because of text based coding. 

 

2. Okay, I need to understand the purpose of using it. 

3. So, the idea was to itrate the loop at a particular time instant till the desired time (T).

4. I don't understand this actually, what I saw while running the code is the loop exectuion become to fast and the calculation was not happening at that particular rate.

5.  I have attached the global varibles in this reply.

0 Kudos
Message 3 of 5
(499 Views)

Hi rishab,

 


@rishab_kr wrote:

1. Basically I am new to graphical programming and I have implemented code in MATLAB, so I started with Mathscript because of text based coding. 

 

2. Okay, I need to understand the purpose of using it. 

3. So, the idea was to itrate the loop at a particular time instant till the desired time (T).

4. I don't understand this actually, what I saw while running the code is the loop exectuion become to fast and the calculation was not happening at that particular rate.

5.  I have attached the global varibles in this reply.


  1. To learn LabVIEW it would help to start with a simple calculation (like sine amplitude over time) instead of a full-blown Matlab script splitted into several MathScript nodes...
  2. Usually you don't need sequences in LabVIEW as you need to (learn) THINK DATAFLOW!
  3. I don't see anything in the loop where you do something related to "time". The "desired time T" is just a control where you set a fixed (?) value...
    I just noticed the "dt=0:0.1:T" statement in the first MathScript node: here you create an array of time values - and all later calculations are done with an array of data. You don't need a loop to calculate each single element in this array, LabVIEW can use polymorphism to work with array data...
  4. Using the TimedWhileLoop you define the iteration rate. As long as the code finishes within the defined time frame the behaviour is fully defined by the loop settings! (According to "THINK DATAFLOW!" mantra.)
  5. Thanks for this. Why do you need to access the global variables multiple times in your VI instead of reading it once and use more wires???
    Again: THINK DATAFLOW! is the basic LabVIEW principle!

There is a chapter on "DATAFLOW" in the LabVIEW help, please read it as often as you need to learn the mechanism implied by the simple words THINK DATAFLOW...

(LabVIEW behaves different than most/all(?) text-based programming languages due to THINK DATAFLOW!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 5
(466 Views)

Hi rishab,

 

example for LabVIEW code:

In LabVIEW you can use wire labels to name the wires, no need for "variables" like w or dt.

There are predefined constants like 2pi or pi/2, again no need for variables like a.

And there is CompoundArithmetic, that simplifies add/subtract or multiply/divide operations!

 

I don't have a MathScript license, so I cannot change your MathScript nodes (no editing of the whole node, not even resizing!). I guess there is some hidden code after the visible lines: it is always BAD (in any programming language) to hide code!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 5
(458 Views)