Ron Beaufort
Lifetime Supporting Member
Greetings to all,
someone recently posted a couple of forum requests (here and here) which went something like this:
this got me to thinking about all of the people that I’ve run into over the years who have needed help with this particular topic ... (and that once included myself) ... what follows is my attempt to cover the subject in enough detail so that anyone can “start from scratch” and end up feeling comfortable with the material and how to use it ...
I’ve decided to attack this particular subject in reverse ... specifically, I’m not going to start out with an introduction and then work through all of the underlying math involved – and then finally end up with the “cherry on top” shortcut that I personally use ... instead I’m going to get right to the punch line and share the shortcut at the very beginning ...
that having been said, you need to get your hands on a Texas Instruments TI-36X calculator ... they sell for about $19.95 at Wal-Mart ... I’m about to show you a “no math” shortcut that I just know you’re going to love ... and while I’m sure that other calculators will do the same type magic, I can give you the exact keystrokes for the TI-36X ... and incidentally, if they’re sold out of the TI-36X, do NOT get the TI-30 model ... it’s not magic ...
before we use the TI-36X, we need to talk about two of its keys ... the first one is marked with an “X” and a “Y” separated by two little triangles ... (you can see a picture of it in a figure coming up soon) ... I personally call this the “flip/flop” key ... basically it swaps the X and the Y registers – but you don’t even need to know that ... the other key is marked with the Greek letter “sigma” and a plus sign ... (sigma looks like a sloppy capital “E”) ... I personally call this one the “sum” key ... you’re welcome to call these two keys anything you like ... just be sure that you press the right one when the time comes ...
and now let’s talk about the SCL (Scale Data) instruction that our original poster needs to use in his program ... note that he’s using an SLC-5/02 processor which does not support floating point math ... and unfortunately the easier-to-use SCP (Scale with Parameters) instruction is also not available in his processor ... in simplest terms, with the hardware that he has available, our friend MUST use an SCL to get this scaling job done ...
our poster is working with the very common 1746-NI4 analog input module ... for the 0 to 10 VDC input signal that he mentioned, the NI4 will give us raw input data values which range from 0 to 32767 ... and luckily he told us about the 0 to 3000 range that he needs for his scaled output (in psi) ...
Figure 1 shows a very common programming approach which should satisfy our poster’s basic scaling requirements ...
notice that the SCL’s “Rate” entry has been set for 916 ... the “Offset” entry has been set for 0 ... and this brings us to the big question for today: “so how do you come up with those particular numbers?” ... now let’s see exactly (keystroke by keystroke) how I used the TI-36X to calculate the values required to scale the signal for this example ...
someone recently posted a couple of forum requests (here and here) which went something like this:
I have an SLC-5/02 processor and I want to know how to set up the SCL function to read a 0 to 10 volt signal and scale it in my program so that I can display 0 to 3000 psi on my PanelView. I need to know how the math behind this works step by step. I have no experience with analog inputs – this will be my first. I have read the help menu about the SCL instruction and I am lost at obtaining the values I need for Rate, Offset, etc. Scaled max-scaled min and divided by input max-input min. Am I anywhere close? I would appreciate any help anyone could offer.
this got me to thinking about all of the people that I’ve run into over the years who have needed help with this particular topic ... (and that once included myself) ... what follows is my attempt to cover the subject in enough detail so that anyone can “start from scratch” and end up feeling comfortable with the material and how to use it ...
I’ve decided to attack this particular subject in reverse ... specifically, I’m not going to start out with an introduction and then work through all of the underlying math involved – and then finally end up with the “cherry on top” shortcut that I personally use ... instead I’m going to get right to the punch line and share the shortcut at the very beginning ...
notice: the author has no connection whatever with the Texas Instruments Company and will receive no compensation, financial or otherwise, from the reader’s purchase of any recommended calculators
that having been said, you need to get your hands on a Texas Instruments TI-36X calculator ... they sell for about $19.95 at Wal-Mart ... I’m about to show you a “no math” shortcut that I just know you’re going to love ... and while I’m sure that other calculators will do the same type magic, I can give you the exact keystrokes for the TI-36X ... and incidentally, if they’re sold out of the TI-36X, do NOT get the TI-30 model ... it’s not magic ...
before we use the TI-36X, we need to talk about two of its keys ... the first one is marked with an “X” and a “Y” separated by two little triangles ... (you can see a picture of it in a figure coming up soon) ... I personally call this the “flip/flop” key ... basically it swaps the X and the Y registers – but you don’t even need to know that ... the other key is marked with the Greek letter “sigma” and a plus sign ... (sigma looks like a sloppy capital “E”) ... I personally call this one the “sum” key ... you’re welcome to call these two keys anything you like ... just be sure that you press the right one when the time comes ...
and now let’s talk about the SCL (Scale Data) instruction that our original poster needs to use in his program ... note that he’s using an SLC-5/02 processor which does not support floating point math ... and unfortunately the easier-to-use SCP (Scale with Parameters) instruction is also not available in his processor ... in simplest terms, with the hardware that he has available, our friend MUST use an SCL to get this scaling job done ...
our poster is working with the very common 1746-NI4 analog input module ... for the 0 to 10 VDC input signal that he mentioned, the NI4 will give us raw input data values which range from 0 to 32767 ... and luckily he told us about the 0 to 3000 range that he needs for his scaled output (in psi) ...
Figure 1 shows a very common programming approach which should satisfy our poster’s basic scaling requirements ...
notice that the SCL’s “Rate” entry has been set for 916 ... the “Offset” entry has been set for 0 ... and this brings us to the big question for today: “so how do you come up with those particular numbers?” ... now let’s see exactly (keystroke by keystroke) how I used the TI-36X to calculate the values required to scale the signal for this example ...