Labview UI project for Linuxcnc

More
14 Sep 2019 05:30 #145105 by auto-mation-assist
Yesterday I got the spindle functions working and can control the spindle now. On, off, forward, reverse and speed adjustments are all working. The multi spindle functions in Linuxcnc are configured to use pins from what I have read and thus have no accessibility from the network right now on my test system. I need to work on how to route these to the network when other things are completed because my Axis is a configurable as an indexer or spindle.

I also have the MDI function working from the three panels I have attached as pictures. In tracking axis positions from status information the Dro's update rapidly and show the correct final axis positions. A lot of work ahead to figure out all the status info.

One of the problems I have noted is with the Linxcnc server itself is that It works perfectly but it does have issues with error handling. If it sees serious errors the server will shut down and will not restart by itself. It can usually handle minor errors such as sending more bits then told to read but these type of errors if they persist may trigger a server shutdown. It interprets these extra bits as the next uncompleted command and does not seem to discard them. Good or bad the machine will keep on doing what it was told to do since Linuxcnc itself does not stop.

On my end the network connections are coded to automatically reconnect. Perhaps on of the experts can figure out a way for the server to restart if it should ever shut down. This process would likely be very rapid.

I'm pretty happy with the results and progress thus far and here are some pictures for functions that use MDI commands that are all functional.





Attachments:
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

More
14 Sep 2019 06:38 - 14 Sep 2019 06:50 #145108 by auto-mation-assist
For those who wish to experiment on their own here is the present Labview code that I developed for the Mdi command encoder. The machine must be placed in MDI mode first so the array on the upper left hand side of the pictures needs to be encoded into a hex string and sent out and then immediately following send the string output of the encoder itself. All the code required to do this is in the picture. You should only have to add the TCP part that sends the generated command to port 5005 after configuring Labview to use the server.

If you turn on the debug functions in your .ini file you will see the commands being executed in your terminal window. I'm using run in place v2.8 right now. For those who wish to use Python is should not be to hard to convert the code into that which would be required by Python by looking at the flow and the requirements.


Attachments:
Last edit: 14 Sep 2019 06:50 by auto-mation-assist. Reason: Added a note about Python
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

More
17 Sep 2019 16:47 #145410 by andypugh
LabVIEW is the only programming language I have ever been paid to program in.
But I am not sure what the point of this GUI is, as most users simply won't be able to afford LabVIEW?
The following user(s) said Thank You: KCJ

Please Log in or Create an account to join the conversation.

More
19 Sep 2019 05:25 #145552 by auto-mation-assist
This gui is primarily a personnel project but I thought that sharing some information about may be helpful to others in some way. Labview is available to many in educational and other settings. Individual who use it at work are also likely to be using it at home.

I think that port 5005 has generally been ignored and it would be nice to see more development work that interfaces to it. It is a very speedy interface.

Please Log in or Create an account to join the conversation.

More
19 Sep 2019 05:36 #145553 by auto-mation-assist
I spent some time updating my system to use Linuxcnc 2.9 and have it working with my Gui. I did find that there has been some additions and changes to emc.hh in version 2.9 and also in a few files that refer to it.

I will be working on homing functions next.

Please Log in or Create an account to join the conversation.

More
25 Sep 2019 05:29 - 25 Sep 2019 05:40 #146130 by auto-mation-assist
I have been busy getting ready for winter but had some time to get the homing and auto mode functions working. Now able to remotely load gcode files and run them them from within the gui and watch the machine follow along nicely. For the Linuxcnc end I use my normal hal file and its .ini file with the display set to dummy. May start thinking about getting the graphical display working so it can follow axis movement.

Loading of .ngc files is done from within the auto mode panel window when the 'Load' button is pushed. When a file is selected and 'Enter' is pushed that window changes to its display Gcode mode for the selected file. Number of lines in the file is shown and also active line and the run from line when selected. All use highlighting in the list. After 9 lines are executed the display switches so that the line executing stays in the middle of the 19 line display.

I have attached some pictures for the homing and auto mode panels.

Home


Select Gcode file


Gcode file selected


I forgot to fix the button that is slightly out of alignment.
Attachments:
Last edit: 25 Sep 2019 05:40 by auto-mation-assist.

Please Log in or Create an account to join the conversation.

More
28 Sep 2019 01:50 #146448 by KCJ
Replied by KCJ on topic Labview UI project for Linuxcnc
Absolutely fastening, thank you for taking the time to document your efforts!

I made a GRBL interface for a plasma tube notcher using LabVIEW, and later redone using MATLAB GUIDE (What a disaster that was!). These days I could not imagine choosing to use LabVIEW for a hobby project, but my enjoyment of it may be tainted from some of the circumstances I've used it in...

Cheers!
Kurt

Please Log in or Create an account to join the conversation.

More
28 Sep 2019 04:41 #146450 by auto-mation-assist
Kurt, I have always enjoyed using Labview. Perhaps it is because before retiring I spend most of my life as an electronics technician. As a electronics technician a lot of my time was spent doing design work which required working with a lot of complex diagrams. Thus a diagram on top of underlying C code works extremely well for me.

Please Log in or Create an account to join the conversation.

More
28 Sep 2019 05:17 - 28 Sep 2019 05:28 #146451 by auto-mation-assist
I have been thinking about what will be required to get a 3D preview working to show Gcode travel paths. So as the first step I needed to get a Gcode parser coded in Labview for Linuxcnc.

Back in Feb/March of 2015 johnwu130 on github had posted a gcode parser for Labview 2014 that was partially completed as a sample but written for NI Motion hardware controllers. His code however looked like a good starting point for use with Linuxcnc and I was able to make the required changes and additions to get it working with Linuxcnc .ngc files.

For my preliminary work on getting a Gcode 3D preview working I'm using the arcspiral.ngc file from the NC folder with some minor changes in Z axis values to keep my machine from going into limits if it is raised more than .05 above its homed zero.

I have the Gcode parser breaking out my added line numbers, Gcode, Mcode, Ocode, R, X, Y, Z, I , J, K, P, feed and speed data for now. A code will carry forward in a line until changed by another code. The arcspiral.ngc test file has 1007 lines of Gcode

The first 10 lines of the input file. The spaces are removed and all are changed to upper case prior to entering the parser.



The parsed result in a array containing the values in clusters.




I can now use the data in the clusters to start work on the 3D preview display.
Attachments:
Last edit: 28 Sep 2019 05:28 by auto-mation-assist.

Please Log in or Create an account to join the conversation.

More
29 Sep 2019 15:04 #146589 by andypugh
Have you spotted the Stand Alone Interpreter?
github.com/LinuxCNC/linuxcnc/tree/master/src/emc/sai
I suspect that passing the G-code to that would provide something more easily rendered.
The following user(s) said Thank You: auto-mation-assist, KCJ, Grotius

Please Log in or Create an account to join the conversation.

Time to create page: 0.248 seconds
Powered by Kunena Forum