Page 1 of 2

Additional inputs with UC100

PostPosted: Sat Feb 11, 2017 5:30 pm
by QuebecCNC
Hi,

I have the UC100 controller and I would like to implement an MPG, FRO, SRO and so on for a control panel.

Can I add a LPT to usb converter and use it as port 2 (or any other port number)? My guess would be no.

Can I use an arduino as an interface and use Modbus?

Or do I have to buy a UC300ETH?

Thanks!

Re: Additional inputs with UC100

PostPosted: Sat Feb 11, 2017 9:55 pm
by A_Camera
Just answered on CNCZone.

Re: Additional inputs with UC100

PostPosted: Sun Feb 12, 2017 1:01 am
by cncdrive
Can I add a LPT to usb converter and use it as port 2 (or any other port number)? My guess would be no.


If you will write your own plugin to interface that LPT port then you could do it.
Writting your own plugin means that you take care of reading and writting your LPT port and then you could do calls to the UCCNC via the plugin interface to control the FRO, SRO or to execute other function calls of the UCCNC.
However doing this requires programming knowledge and I also have to note that there is no direct LPT port access on 64bit Windows, so you could only interface an LPT port on 32bit Windows.

Can I use an arduino as an interface and use Modbus?


Yes, the UCCNC talks RTU, ASCII and TCP modbus protocols so you could interface a modbus device via serial port or ethernet.
And then you can write macros, macro loops or plugins to take actions in the UCCNC.

Or do I have to buy a UC300ETH?


That is definitely your easiest, plug and play option to go.

Re: Additional inputs with UC100

PostPosted: Sun Feb 12, 2017 1:37 pm
by QuebecCNC
Is there any documentation for the modbus master plugin?

Re: Additional inputs with UC100

PostPosted: Sun Feb 12, 2017 1:54 pm
by ger21
Look in the UCCNC\Documentation folder. There's a manual, but I didn't see it show anything about using Modbus for inputs.

Re: Additional inputs with UC100

PostPosted: Sun Feb 12, 2017 2:42 pm
by QuebecCNC
Thank you all for your help

Re: Additional inputs with UC100

PostPosted: Sun Feb 12, 2017 3:18 pm
by ger21
Never used Modbus, so it's a bit confusing. But say you want to use a Modbus input as an Input trigger. How do you assign that value from the register? When all of the inputs settings need a port and pin #??

Re: Additional inputs with UC100

PostPosted: Sun Feb 12, 2017 4:23 pm
by cncdrive
Never used Modbus, so it's a bit confusing. But say you want to use a Modbus input as an Input trigger. How do you assign that value from the register? When all of the inputs settings need a port and pin #??


Modbus is just a communication protocol.
How the UCCNC handles it on a low level to provide the flexibility, the modbus plugin can copy registers from the UCCNC Modbus register array to the Modbus slave device and copy registers from the Modbus slave device to the UCCNC Modbus register array.
These copying is done with reading and writting operations of specified register numbers.
You can setup any number of communication channels (COM ports or Ethernet ports) and any numbers of Functions (read and write operations of a register or registers)
So, this is the only thing the UCCNC is doing with the Modbus plugin.

Everything else what you do with the register datas and how you do it is up to you.
You can access and work with the registers from macros, macroloops and plugins.

Re: Additional inputs with UC100

PostPosted: Sun Feb 12, 2017 11:00 pm
by Battwell
you saw my video showing 2 arduinos- i adapted schillings code- as he did all the hard work.!
it works perfectly with as many arduinos as you want to add as slaves- i only have had 2 on test but worked flawlessly for over a week.
it covers inputs , outputs, analogue in and analogues out.

https://github.com/devlware/ModBusSlave ... us_Slave.h

Re: Additional inputs with UC100

PostPosted: Mon Feb 13, 2017 6:49 pm
by QuebecCNC
Thanks that's great! Would you happen to have code with example inputs and outputs? Maybe it's in the code you gave me a link to, but on my phone I only see modbus slave.h

Thanks