Coordinate output via USB

This Section is for users to discuss hardware

Coordinate output via USB

Postby CADdy » Mon Apr 22, 2019 4:33 pm

Hi all,

is there a way to output the current X, Y, Z values via a USB interface? It should be the field numbers 226-228 (XposDRO, YposDRO and ZposDRO) found in UCCNC MACROS - 1-2105.pdf ? Is there anything to read about how to tackle such a project?

Background: I want to display the coordinates via the USB interface on a LC-display in a pendant.

Sincerely
Peter
CADdy
 
Posts: 148
Joined: Sun Sep 17, 2017 2:26 pm

Re: Coordinate output via USB

Postby dezsoe » Mon Apr 22, 2019 5:54 pm

Hi Peter,

To output the coords is simple if you have the protocol to the display. It can be done in a macroloop or a plugin, depending on your USB device.
dezsoe
 
Posts: 2093
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Coordinate output via USB

Postby CADdy » Mon Apr 22, 2019 9:10 pm

Hi dezsoe,

my idea would be to send the coordinates via USB interface to an Arduino Leonardo, which then displays the values on a 20 x 4 LCD. Could something like this be realized?

Sincerely
Peter
CADdy
 
Posts: 148
Joined: Sun Sep 17, 2017 2:26 pm

Re: Coordinate output via USB

Postby dezsoe » Mon Apr 22, 2019 9:43 pm

Hi Peter,

Yes. My problem was that USB is a hardware protocol, but as you wrote the Arduino, now it means a virtual serial port. That works fine. How do you want to get the coordinates in the Arduino? I mean, one string with all the three coords or any coded format? Do you have the Arduino side ready or you'll make it later?
dezsoe
 
Posts: 2093
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Coordinate output via USB

Postby CADdy » Tue Apr 23, 2019 10:38 am

Hi dezsoe,

the Arduino side isn't finished yet. I wanted to clarify first whether my project is realizable. Since the Leonardo has the possibility to simulate keyboard keys, I would like to add a few keys to the pendant, which e.g. set the mode of the handwheel, or switch the spindle on and off, etc..

I know that there are ready-made pendants that have all this already integrated. But I want to do it myself, just because it's fun. If it works, I would publish all the information here. However, I would be happy if I could get support for the implementation in UCCNC.

Sincerely
Peter
CADdy
 
Posts: 148
Joined: Sun Sep 17, 2017 2:26 pm

Re: Coordinate output via USB

Postby dezsoe » Tue Apr 23, 2019 4:43 pm

Hi Peter,

I'm afraid that the keyboard emulator uses HID standard. Then it emulates a keyboard and you cannot send out info. (Or maybe you can, but then you have to modify the library and write your own HID data sender.) I think it's much easier to have a normal serial communication between the Arduino and UCCNC. Then you have the key to anything. You can send commands to UCCNC from the Arduino and your macroloop or plugin can call buttons or do anything and also UCCNC can also send any data to the Arduino.
dezsoe
 
Posts: 2093
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Coordinate output via USB

Postby CADdy » Tue Apr 23, 2019 5:30 pm

Hi dezsoe,

yes, the library emulates a normal HID keyboard. Of course you're right, I haven't thought about that yet. There is your suggestion to work on a serial communication the better way.

But I don't know how to program macroloops or plugins for UCCNC. A little help would be necessary. The Arduino part would be the smaller problem. If I understand that correctly, it should be possible with almost every Arduino. HID would only be a hindrance.

Greetings
Peter
CADdy
 
Posts: 148
Joined: Sun Sep 17, 2017 2:26 pm

Re: Coordinate output via USB

Postby ger21 » Tue Apr 23, 2019 6:54 pm

You'll need to learn C# or VB.NET, as that's what the macros are written in.
The basics are not that hard to learn. What you want is a bit more difficult for a beginner.

Or you'll need someone to write them for you.
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2714
Joined: Sat Sep 03, 2016 2:17 am

Re: Coordinate output via USB

Postby CADdy » Wed Apr 24, 2019 7:04 am

Hi Gerry,

the basics of C# and VB.NET are not the problem. More is needed. In order to develop a useful and working macro, the possibilities and functions that UCCNC provides must also be known. I know that it is not trivial to implement something like this. To start with, I just wanted to send the coordinates to the pendant and a few functions to UCCNC. Learning by doing...

I'm reading the UCCNC MACROS - 1-2105.pdf - manual right now. Is that ok? Do I find in it what I need? Can I ask if there are any problems and hope that someone will help me?

Greetings
Peter
CADdy
 
Posts: 148
Joined: Sun Sep 17, 2017 2:26 pm

Re: Coordinate output via USB

Postby dezsoe » Wed Apr 24, 2019 7:29 am

Hi Peter,

I attach a small macro which handles my serial LCD. You can find ideas to start with, but it uses my own LCD protocol, so you have to modify it. However, you can see a basic communication. It is a macroloop, not a standalone macro.
Attachments
M25006.txt
(1.67 KiB) Downloaded 775 times
dezsoe
 
Posts: 2093
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Next

Return to Hardware

Who is online

Users browsing this forum: No registered users and 4 guests