LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

360 degree Rotation - Always need in range of 0 to 359°

Hello,

 

I cannot seem to figure out a way to keep my signal in a range of 0-359°. I am using an encoder to gather angle. My VI works great at 0-359°. once it goes great than or equal to 360° or - degrees, my VI no longer knows what to do with the signal. I am looking for a way if the angle is greater than 359°, subtract 360° (360°=0°, 720°=0°, 410°=50°, 1230°=150°, etc). I do not need to keep tract of #rotations.

 

Thank you for any and all help.

0 Kudos
Message 1 of 4
(795 Views)

For the description, it seems your angle is an integer. If it is floating point, you would also need to consider e.g. an angle of 359.999, for example.

 

Yes, in both cases quotient&remainder would work fine. (For example an angle of -5 would turn into 355, 400 would turn into 40, and 360 would turn into 0)

 

altenbach_0-1678209019125.png

 

Message 3 of 4
(785 Views)

Thanks! This worked great! so much to learn on LabVIEW!

0 Kudos
Message 4 of 4
(766 Views)