On Monday 02 January 2017 22:01:16 Jan Bos wrote:

> Hello Peter,
>
> It works and I can read the value now. How can I scale this correctly?
> I have a 0-5V input and need my GladeVcp bar to show Maximum at 5V
> input but at 5V input it does not show maximum.
> I looked at the 'scale' command but all examples and descriptions I
> could find are for outputs and not for inputs.
>
> Here is what I did: *net spindle-load  hm2_5i25.0.7i76.0.0.analogin0
> and connected this to the Glade panel bar.*

I'm not using glade to do it, but pyvcp, for a tachometer dial on my mill. That 
is configured by an .xml file, and this can probably be fixed in a similar 
place in the glade file. In the .xml,  <max_>2750</max_> sets the value at the 
top or CW end of the scale, and if using a bar indicator in glade, there should 
be a value that sets full scale for the bar. In my case I don't recall the 
actual value fed to the meter pin, only that in the normal .hal, I have a scale 
module with a gain of 60 to convert the RPS out of the encoders velocity pin to 
RPM that I feed the tach with. ISTR I also have a lowpass module in that path 
to give a tach needle thats mearly nervous rather than completely spastic 
because of the quadrature noise from the encoder.

What I am saying is put the scale module in that signal path, and use a setp to 
set the scale gain in the hal file to make it read full scale when it is 
supposed to read full scale.  Because you are looking at the drive TO the 
spindle with that sample line above, I would verify that it is going to the 
full 5 volts. Something in the driver hardware may be giving you less than 
unity gain. So verify with a halmeter, that is is indeed reaching 5 volts. It 
may not be.

>
> *Could you explain how to use 'scale' correctly to scale this input to
> read 5V as maximum value for the Glade bar if needed at all.*
>
> *Thanks,*
>
> *G21*
>
> On Wed, Dec 28, 2016 at 12:00 PM, Jan Bos <rappyrip...@gmail.com> wrote:
> > Thanks Peter, will free up these and try again. Will let you know if
> > I have more issues getting this to work.
> >
> > G21
> >
> > On Wed, Dec 28, 2016 at 11:48 AM, Peter C. Wallace <p...@mesanet.com>
> >
> > wrote:
> >> On Wed, 28 Dec 2016, Jan Bos wrote:
> >> > Date: Wed, 28 Dec 2016 10:49:33 +0800
> >> > From: Jan Bos <rappyrip...@gmail.com>
> >> > Reply-To: "Enhanced Machine Controller (EMC)"
> >> >     <emc-users@lists.sourceforge.net>
> >> > To: "Enhanced Machine Controller (EMC)"
> >> > <emc-users@lists.sourceforge.n
> >>
> >> et>
> >>
> >> > Subject: [Emc-users] read analog input 7I76
> >> >
> >> > I am trying to read an analog input from a digital I/O pin on my
> >> > 7I76. According to the manual this is possible albeit in 8 bit
> >> > mode only
> >>
> >> which is
> >>
> >> > fine for me. I have a spindle drive that provides a 0 5V output
> >> > for
> >>
> >> spindle
> >>
> >> > load and I want to read this and show this in my Glade sidepanel.
> >> >
> >> > The manual says:
> >> > All field input pins are capable of reading the input voltage.
> >> > These are not highly
> >> > accurate or high resolution but can be useful for things like
> >>
> >> potentiometer
> >>
> >> > inputs. Input resolution is 8 bits and input full scale value is
> >> > 36.3V. Accuracy is +-5%. Software process data modes 1 and 2
> >> > allow reading the analog voltage on inputs 0 through 3, in
> >> > addition to the 32 digital bit inputs.
> >> >
> >> > I already used my 0 through 3 so I need to use one of my free
> >> > inputs
> >>
> >> left
> >>
> >> > on the 7I76 and 8 bit resolution is fine for this.  I looked at
> >> > PncConf
> >>
> >> and
> >>
> >> > there is no option to select an analog input for a digital I/O. I
> >> > run
> >>
> >> the
> >>
> >> > card in mode 2 combined with a 6I25.
> >> >
> >> > How do I go about this and read an analog voltage from a digital
> >> > I/O
> >>
> >> pin on
> >>
> >> > my 7I76?
> >>
> >> With standard 7I76 firmware you can only read analog data from
> >> inputs 0..3 so its easier to move some digital inputs around to
> >> free up 0..3
> >>
> >> > Thanks,
> >> >
> >> > G21
> >> > ------------------------------------------------------------
> >>
> >> ------------------
> >>
> >> > Check out the vibrant tech community on one of the world's most
> >> > engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> >> > _______________________________________________
> >> > Emc-users mailing list
> >> > Emc-users@lists.sourceforge.net
> >> > https://lists.sourceforge.net/lists/listinfo/emc-users
> >>
> >> Peter Wallace
> >> Mesa Electronics
> >>
> >> (\__/)
> >> (='.'=) This is Bunny. Copy and paste bunny into your
> >> (")_(") signature to help him gain world domination.
> >>
> >>
> >> ------------------------------------------------------------
> >> ------------------
> >> Check out the vibrant tech community on one of the world's most
> >> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> >> _______________________________________________
> >> Emc-users mailing list
> >> Emc-users@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/emc-users
>
> ----------------------------------------------------------------------
>-------- Check out the vibrant tech community on one of the world's
> most engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users


Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to