Hello Guest it is April 16, 2024, 08:30:31 AM

Author Topic: Mach4 - hicon pn7766 - an0, an1 in J6  (Read 2604 times)

0 Members and 1 Guest are viewing this topic.

Mach4 - hicon pn7766 - an0, an1 in J6
« on: July 10, 2017, 02:41:09 AM »
Hi everyone

I need to gather information to input analog on hicon an0 and an1 in mach4

I have been reading and only found that the J6 pin need Hicon-adc, but I do not know how to access those data from mach4

Can anybody help me?

Thanks in advance, Raúl
Re: Mach4 - hicon pn7766 - an0, an1 in J6
« Reply #1 on: July 10, 2017, 07:42:05 PM »
If you want to read the AN0 or AN1 ADC input you would need to activate the Analog Input feature.  You can purchase the activation key from the website.

The HiCON plugin diagnostic/status window displays a readout of the ADC input from 0-3300mV. You can also add a DRO using the screen editor and read the ADC registers using code similar to below:

Code: [Select]
local inst = mc.mcGetInstance() --Get the instance of Mach4
local hReg = mc.mcRegGetHandle(inst, 'HiCON/VADC_0');
local ADCCount = mc.mcRegGetValue(hReg);
scr.SetProperty("droADC0", "Value", tostring(ADCCount));

Re: Mach4 - hicon pn7766 - an0, an1 in J6
« Reply #2 on: July 12, 2017, 03:31:21 AM »
On the website, i only meet this:

http://www.vitalsystem.com/portal/purchase.php?id=HiCON-ADC

Is this what i need to get those values?

I understand that after buying that plugin I have to get the value with a code similar to the one you said

I'm right?

Thanks in advance, Raúl

Re: Mach4 - hicon pn7766 - an0, an1 in J6
« Reply #3 on: July 12, 2017, 03:01:08 PM »
That is the correct activation key you would need.

Yes, the information in the prior post about reading the values from AN0 and AN1 in Mach is correct.