Hello Guest it is January 26, 2021, 02:14:11 PM

Author Topic: Adding more inputs or outputs to Mach3  (Read 771 times)

0 Members and 1 Guest are viewing this topic.

Re: Adding more inputs or outputs to Mach3
« Reply #10 on: May 08, 2020, 04:58:44 AM »
Sorry I mean variable type not modifier. :-[
Re: Adding more inputs or outputs to Mach3
« Reply #11 on: May 08, 2020, 05:19:02 AM »
Here is the CDIO.DLL file and the CDIO Help file I found if you want to have a try.

Cheers,
Mark

Offline TPS

*
  •  1,897 1,897
    • View Profile
Re: Adding more inputs or outputs to Mach3
« Reply #12 on: May 09, 2020, 02:25:20 AM »
i think the Problem is that the variable Id is not specified

try a

Id = 0 at the begin of code
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Adding more inputs or outputs to Mach3
« Reply #13 on: May 09, 2020, 04:34:59 AM »
Hi TPS,

Yes i had tried that but with no luck. I have also done "dim Id as Integer" And I have changed the short to integer and to many other data types.

Mach3 talks to the cards fine in the Pins and ports setup and i can operate as many I/O as listed in the setup.
The PCI cards are listed as Port3 And Port4 in Mach3. so if i set Mach3 OUTPUT1 to Port3 pin1 then the card will output the pin1 on the first card.  Can i link OEM buttons or LEDs to Mach3 ports and pins without the OUTPUT1 command.

ie   OEMLED1 = port3.pin2 or something like that??

Cheers,
Mark

Offline TPS

*
  •  1,897 1,897
    • View Profile
Re: Adding more inputs or outputs to Mach3
« Reply #14 on: May 09, 2020, 05:49:53 AM »
so if you are able to Access the Card via the regular port/pin Setup, they should be also be red/writeable via

GetPortByte(PortAddr)

and

PutPortByte(PortAddr)
as shown in this example i did
Code: [Select]
  ' Our port address
  PortAddr = 1016 ' 0x3f8
  ' Read data register of parallel port at 0x3f8
  PortData = GetPortByte(PortAddr)
  ' write the data to OEMLed's
  SetUserLed(2001,PortData And &H01)
  SetUserLed(2002,PortData And &H02)
  SetUserLed(2003,PortData And &H04)
  SetUserLed(2004,PortData And &H08)
  SetUserLed(2005,PortData And &H10)
  SetUserLed(2006,PortData And &H20)
  SetUserLed(2007,PortData And &H40)
  SetUserLed(2008,PortData And &H80)

you have to out in there the same port adress as in Mach3 setup   
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline TPS

*
  •  1,897 1,897
    • View Profile
Re: Adding more inputs or outputs to Mach3
« Reply #15 on: May 09, 2020, 05:58:07 AM »
example to write UserLed's to a port

Code: [Select]
'example to write UserLed 2201-2208 to port
'Our port address
PortAddr = 1016 '0x3f8
PortData = 0

If (GetUserled(2201) = 1) Then
  PortData = PortDate + 1
End If
If (GetUserled(2202) = 1) Then
  PortData = PortDate + 2
End If
If (GetUserled(2203) = 1) Then
  PortData = PortDate + 4
End If
If (GetUserled(2204) = 1) Then
  PortData = PortDate + 8
End If
If (GetUserled(2205) = 1) Then
  PortData = PortDate + 16
End If
If (GetUserled(2206) = 1) Then
  PortData = PortDate + 32
End If
If (GetUserled(2207) = 1) Then
  PortData = PortDate + 64
End If
If (GetUserled(2208) = 1) Then
  PortData = PortDate + 128
End If

PortData = PutPortByte(PortAddr, PortData)

anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Adding more inputs or outputs to Mach3
« Reply #16 on: May 09, 2020, 06:08:52 AM »
The cards are running through a Mach3 plugin to allow Mach3 to see them.

The port address in windows hardware manager are E480 for one card and E800 for the other card.
I tried these values with no success.

I think its only readable because of the plugin but dont really know. there is basically no information about the plugin but it allows for up to 4 cards so they must have made it to run over 100 odd inputs or outputs, i just do not know how to access them. There must be a way.

Cheers,
mark

Offline Graham Waterworth

*
  • *
  •  2,255 2,255
  • Yorkshire Dales, England
    • View Profile
Re: Adding more inputs or outputs to Mach3
« Reply #17 on: May 09, 2020, 07:39:00 AM »
I think the port get and put only work with the parallel port driver loaded.
Without engineers the world stops

Offline TPS

*
  •  1,897 1,897
    • View Profile
Re: Adding more inputs or outputs to Mach3
« Reply #18 on: May 09, 2020, 12:58:56 PM »
do you have some more Information about the  Cards and the plugin?
there must be way to get Access to These in- Outputs.
because, if the plugin get Access there must be a way to get access.
 the plugin must reflect These IOs to somewhere,i think into modbus IO aeria, like all the other
Motion Controller do it.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Adding more inputs or outputs to Mach3
« Reply #19 on: May 09, 2020, 09:01:18 PM »
The plugin is on the downloads page of mach3 website and the documentation is there also. there is even a forum like here too which ive also asked in but no response form anyone. The plugin is CONTEC. I have two CONTEC PIO-16/16T(PCI) cards in the computer. they are hooked to the tool changer and work perfectly in camsoft. Mach3 works with both cards when setting the ports/pins to OUTPUT#

I have attached all the info and some sample programs that came with the DLL file. You maybe able to make sense of it.

Cheers,
Mark