Hello Guest it is April 19, 2024, 08:16:23 AM

Author Topic: [CSMIO-IP/S + MACH3] using an analogue output to control an external device  (Read 7728 times)

0 Members and 2 Guests are viewing this topic.

Re: [CSMIO-IP/S + MACH3] using an analogue output to control an external device
« Reply #10 on: November 27, 2020, 08:32:47 AM »
Hi TPS,

Thank you very much for the idea.
Here is an additional question.

If I create a macro M100 as below,
SetModOutput(81,GetDro(5)*4.095)

Then, what should the G-code be?
Can I run M100 just once at the beginning? or should I use it every time when I want to change the analogue output? After the motion command?

X.. Y.. Z.. A.. B..
M100
X.. Y.. Z.. A.. B..
M100

Like this?

Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: [CSMIO-IP/S + MACH3] using an analogue output to control an external device
« Reply #11 on: November 28, 2020, 03:04:39 AM »
if you put the code in a custom macro like M100, it Needs to be called in G-Code every time you want to Change
the analog Output, and Motion will stop on every macro call.

that is why i was talking about macropump macro, this is a macro witch is running in Background, and it will
read the B-Axis Position every 10ms and write the analog Output, and because it is running in Background,
it will not pause Motion.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: [CSMIO-IP/S + MACH3] using an analogue output to control an external device
« Reply #12 on: November 30, 2020, 07:59:25 AM »
Hi TPS,

I tried the method, but it didn't work.
I think the problem is related to the value for GetDro().
For B-axis, is it right to put 5? How can I know if it is a correct value or not?

Best Regards,
Eric.

Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: [CSMIO-IP/S + MACH3] using an analogue output to control an external device
« Reply #13 on: November 30, 2020, 02:14:04 PM »
GetDro(5) is the right value for B-axis.
have you enabled macropump macro in General cofig?
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: [CSMIO-IP/S + MACH3] using an analogue output to control an external device
« Reply #14 on: December 01, 2020, 11:05:26 AM »
Hi TPS,

I checked the analog output only by using the following command in a normal M command before trying the macropump.

SetModOutput(81,2000)

I’ve tried the address number 80.
But there was no output.

Any idea?

Best Regards,
Eric.

Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: [CSMIO-IP/S + MACH3] using an analogue output to control an external device
« Reply #15 on: December 02, 2020, 02:12:05 AM »
Hello Eric,

will have a look this afternoon at my machine.
i have used a analog Output there.
let you know.

Regards Tom
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: [CSMIO-IP/S + MACH3] using an analogue output to control an external device
« Reply #16 on: December 02, 2020, 08:25:13 AM »
Hi Tom,

I managed to make the analog output itself is working using a normal M command.
The problem was the analog output 1 was allocated to the spindle output, and when the spindle was enabled, the analog output didn't work.
Now I need to check if GetDRO is working properly or not.
According to the MACH3 macro handbook, it is not recommended to use GetDRO.
Please see the descriptions below. What is the difference from GetOEMDRO and GetUserDRO?
And do you know where I can check the full scale of the B-axis range?

GetDRO
Function GetDRO(DRONum As Integer) As Double
This legacy function takes the DRO number passed as its argument, and returns the value of the Mach DRO of that number.
The use of GetDRO is no longer recommended practice and this function exists only to support preexisting legacy scripts. This function is deprecated, and its use is strongly discouraged.
Legacy script note: Over time, there have been two different DRO numbering schemes used with Mach; the “DRO number” series and the “OEMDRO number” series. This function uses the “DRO number” series.
The “DRO number” series was further subdivided into “User” and “OEM” ranges. Within the “OEM” range, valid DRONums were from 0 to 200, which, at one time, corresponded to OEM DRO numbers 800 to 1000.
The numerical correspondence between the numbering series is not guaranteed for future releases of Mach.
Use the GetOEMDRO and GetUserDRO functions instead of this function.

Best Regards,
Eric.

Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: [CSMIO-IP/S + MACH3] using an analogue output to control an external device
« Reply #17 on: December 02, 2020, 09:01:24 AM »
hello Eric,

here: https://www.machsupport.com/forum/index.php?topic=9312.0

is a oemdro list.

correct code would be:
Code: [Select]
SetModOutput(81,GetOemDro(804)*4.095)

UserDro's are for free usage.

what do you mean with the full scale of the B-axis range?
 
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: [CSMIO-IP/S + MACH3] using an analogue output to control an external device
« Reply #18 on: December 02, 2020, 10:06:56 AM »
Hi Tom,

Thank you for your information.
I meant the value of the GetOemDro(804).
Your assumption is that its range is 1-1000. But, where can we set that range?
Is it like a default value?

Re: [CSMIO-IP/S + MACH3] using an analogue output to control an external device
« Reply #19 on: December 02, 2020, 12:00:01 PM »
Hi Tom,

GetOemDro worked quite well.
But, the problem is that when I put B... if the value is over a certain value, the GetOemDro value went completely wrong.
I don't quite understand why this happens.
Any thought?