LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Replace numbers and invert time normalizations

Good morning everyone,


I am using LabVIEW for CAD/CAM purposes, and the aim of my program is to control a trajectory along several consecutive straight lines defined by its corner points (x and y coordinates).

My program uses only mathematical equations (parametric equations) and I am using a simulate signal (time normalization) between 0 and 1. To perform the straight lines my idea is to replace the position of the points and, at the same time, invert the time (from 0 to 1 to 1 to 0) - please see the attached image - and so on.

Because I am a new Labview user, I would like to know it this point replacement is in fact possible, and also how to invert the time normalization.

Hope to have been the clearest as possible.

Thanks you very much in advance.


0 Kudos
Message 1 of 7
(3,228 Views)

Hi fgoulao,

 

I would like to know it this point replacement is in fact possible

Yes.

 

how to invert the time normalization.

You can assign any value you like to your "variable" t…

 

Why do you want to "invert" t in your equations? When you apply a linear interpolation those "ups and downs" are handled by the sign/direction of your vectors between the points…

Best regards,
GerdW


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

Cheers,

The inversion of the variable t (time) is made with the purpose of having a continuous time signal and also to allow us to replace only one of the two points when a segment is finished.

Thus, I need to know how to invert these variable, and also how to replace the points, "automatically", in the block diagram window. I suppose that some loops will have to be used.

Although this is a mathematical problem, my inexperience using Labview makes me wonder how to perform such an apprach.

Perhaps, the attached note can help you understand to understand what I exactly would like to do in Labview.

Thank you very much,

Francisco

0 Kudos
Message 3 of 7
(3,178 Views)
To turn 0 to 1 into 1 to 0, negate the number and then add 1.

1 becomes -1, + 1 = 0
0 becomes 0, + 1 = 1
.25 become -.25, +1 = .75

And so on...

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 7
(3,163 Views)

Hi Francisco,

 

so why don't you use the formula given in your PDF, just after "Indeed … is the same…"? You need to replace your variable t by x, where x is the result of the equation (1-t)!

 

Yes, it is just a mathematical problem and all you have to do is applying some (very basic) math operation…

Best regards,
GerdW


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

Good morning,

 

 

The difficult "thing" for me to do under Labview, since I am a new user, is the loop. I mean, I have to implement a loop where: WHEN a value of input signal EQUAL 0 OR 1, it REPLACES the first of the two points by a new one.

 

This red-highlighted words are the mechanisms I would like to know how to do. I have tried to find them out and implement them by myself, as well, but without success.

At least, I think the most difficult part for me is the replacement, as I do not know which Labview functionality allows me to do this.

Sorry for being insistent.

Many thanks,

 

Francisco Goulão

0 Kudos
Message 6 of 7
(3,123 Views)

Hi Francisco,

 

the words "WHEN condition THEN do" usually (aka "in most programming languages") are translated to "IF-THEN-ELSE".

This is not a LOOP, it's a CASE structure:

 

IF value == 0 OR value ==1 THEN
   first_point := new_point
ENDIF
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 7
(3,117 Views)