06-26-2015 06:02 AM
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:)
06-26-2015 06:16 AM
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?
06-26-2015 06:16 AM
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?
06-26-2015 06:40 AM
Sorry there.
Its there on the 2 png, he cant get from 180 to -180
06-26-2015 07:07 AM - edited 06-26-2015 07:07 AM
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.
06-26-2015 07:24 AM
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
06-26-2015 07:29 AM
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.
06-26-2015 07:48 AM
@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.
Ben64
06-26-2015 08:43 AM
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.
06-26-2015 10:53 AM
@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.