LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing from max to min value

Hi there.

 

Im build a program in LabView 8.5 and I have a problem.

 

Im calculating an angle to use it after as a comparison with another value to stop the loop. The problem is that when the value gets to 180º its supposed to continue from the -180 but instead he stays at 180 value.

 

The problem here is that if he doesnt get from 180 to -180 i cant activate the while loop again and i have part of my program stuck until i start the problem again :/.

 

If any1 could help im happy to answer any questions you may have from this msg and the problem here.

 

 

Thanks:)

0 Kudos
Message 1 of 17
(4,688 Views)

Hi Jan,

 

I think it might be best to post an example to illustrate what you mean exactly. Can you give us a minimal working example that demonstrates this behaviour?



Remember Cunningham's Law
0 Kudos
Message 2 of 17
(4,678 Views)

How are you calculating the angle?  Where is any of this data coming from?  Any code you can share to help enlighten us to the issue?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 17
(4,676 Views)

Sorry there.

 

Its there on the 2 png, he cant get from 180 to -180 

Download All
0 Kudos
Message 4 of 17
(4,663 Views)

I think I would do a shift so that all of the angles are positive.  All you need to do this is add 360 degrees to the negative angles.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 5 of 17
(4,600 Views)

That solved the problem, thank you :).

 

If you could help with another thing i´d apreciate.

 

Do you know a way to create a indicator from a file path?

I want to show the progress of the motors but since i write and read one data at the time, he only displays what is in that read or write function. I can´t find a function that can read the hole value of the txt file and show its progress.

 

Ex: its at -100 at first, then it starts to walk forward, -98, -96 etc. Is there a function that i can use to get this as an indicator of this progress?

 

png in anex with the path file and write/read.

 

Ps: there is more write and read functions ahead of the print screen.

 

 

Thanks in advance

0 Kudos
Message 6 of 17
(4,585 Views)

Right click >> create indicator.

 

BTW: if you pass the path to the open/create/replace VI you should use the reference it gives you for the write function. The way you programmed it, the o/c/p VI is obsolete.

BTWW: you can select a region in your BD and use Edit >> create SubVI to pack some of your code into sub VIs and make your code more readable.



Remember Cunningham's Law
0 Kudos
Message 7 of 17
(4,580 Views)

@Janitor wrote:

Hi there.

 

Im build a program in LabView 8.5 and I have a problem.

 

Im calculating an angle to use it after as a comparison with another value to stop the loop. The problem is that when the value gets to 180º its supposed to continue from the -180 but instead he stays at 180 value.

 

The problem here is that if he doesnt get from 180 to -180 i cant activate the while loop again and i have part of my program stuck until i start the problem again :/.

 

If any1 could help im happy to answer any questions you may have from this msg and the problem here.

 

 

Thanks:)


There is a vi call Wrap Angle.vi in the Mathematics ->  Geometry  -> Angle palette that does that.

 

Wrap Angle.png

 

Ben64

Message 8 of 17
(4,555 Views)

Thanks for the tips but right know i dont have time to build sub-VI´s.

 

In regards to the indicator, that only creates a indicator of the path file, what i want is the number inside the path, in this case in the .txt file.

0 Kudos
Message 9 of 17
(4,513 Views)

@Janitor wrote:

Thanks for the tips but right know i dont have time to build sub-VI´s.

 

In regards to the indicator, that only creates a indicator of the path file, what i want is the number inside the path, in this case in the .txt file.



What do you mean by "the number inside the path"?

 

You had asked "Do you know a way to create a indicator from a file path?" and that is what you were given.

0 Kudos
Message 10 of 17
(4,473 Views)