shift & stretch

  • techwiz
  • Beginner
  • Beginner
  • User avatar
  • Joined: Dec 31, 2007
  • Posts: 46
  • Status: Offline

Post May 30th, 2009, 9:59 am

I am writing a program, I have a varible that contains a number -1 thru 1 the negative values don't help me. is there anyway to change the range to 0 thru 1. But I don't want to truncate the values, I just want to shift & stretch the values.
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post May 30th, 2009, 9:59 am

  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Joined: Jul 25, 2005
  • Posts: 2735
  • Loc: Nashville, TN
  • Status: Offline

Post May 30th, 2009, 10:38 am

What language & what variable type? Any code you could share would be helpful. We're here to assist, but we can't read minds. ;)
I'd love to change the world, but they won't give me the source code.
  • techwiz
  • Beginner
  • Beginner
  • User avatar
  • Joined: Dec 31, 2007
  • Posts: 46
  • Status: Offline

Post May 30th, 2009, 1:00 pm

i am programming in labview.

it is the value being read form a variable resistor(potentiometer) dial

the variable, is the value of the resistor, at a particular place in time. I can't use the negative values.

but i dont want the middle of the resistor to be zero.

When the dial is set all the way to the left it should be zero.
  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Joined: Jul 25, 2005
  • Posts: 2735
  • Loc: Nashville, TN
  • Status: Offline

Post May 30th, 2009, 2:01 pm

So you are programming in the G language then? If so, I'm afraid I can't be of much help - not one I've tried before.
I'd love to change the world, but they won't give me the source code.
  • devilwood
  • Silver Member
  • Silver Member
  • User avatar
  • Joined: Nov 18, 2007
  • Posts: 429
  • Status: Offline

Post May 31st, 2009, 8:40 pm

First off, I think most of the community is going to have difficulty helping with custom labview programs. If you have the language type and code snippet then that could be a start to getting some help.

I'm actually curious as to why you want your range to start at zero? The negative range correlates to the alternating current if you're using AC which would be most currents. I would suggest using the -1 to 1 range and plotting your graph cause that will give you your actual wave (sine, cosine, tangent) and then you can mathematically adjust your wave to make 0 = -1 and then replot that function. Another option, I think the software should have a calibrator that you may be able adjust to your needs, but rewriting the wave function would probably be easier and more precise.

For fun, remember you must have DC for all rail guns. :-)


We definetly need more info to help.
  • techwiz
  • Beginner
  • Beginner
  • User avatar
  • Joined: Dec 31, 2007
  • Posts: 46
  • Status: Offline

Post June 1st, 2009, 2:21 pm

well, I got it, i changed the y intercept of my function from, 1 to zero and re plotted the points, and created a function.

Thanks, a bunch!

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 186 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.