Labview UI project for Linuxcnc

More
14 Jan 2022 14:53 #231765 by Reinhard

I'm interest in looking at your work but have no idea where I can find it.

Really? Well, my both project are right below yours in the same category "Other User Interfaces".

First I worked out the java UI to see, whether I could create an UI following my ideas and the current project is like porting the java UI to Qt and research what is possible with Qt and how to solve Qt's shortcomings.

Actually I'm reworking the linuxcnc-interface, so you could have a look at my project, but interface to linuxcnc will change. Anyway - might be worth a look ;)

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

More
14 Jan 2022 22:16 #231809 by auto-mation-assist
I have not spent much time in looking at the forum for a long time been very busy working on laying out printed circuit boards a those are now being manufactured.

I found the link in your project to the code and forked you project. Took me a while since it was incorporated in text and not as a separate item. I will look at your code after I get Redis working. Recent Linuxcnc master changes that I'm not familiar with yet are causing a bit of confusion.

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

More
16 Jan 2022 17:37 #232034 by auto-mation-assist
I have Redis 6.2.6 installed and complied as an addition of Linuxcnc on my develepment system which is running the current Linuxcnc master. I think it will be very useful for routing command, status and other data between Linuxcnc's various blocks of code internally and also externally, not only to Labview but also to other alternatives.

I installed Redis in linuxcnc 2.9 master and compiled it as part of it. After starting Linuxcnc  I opened up two terminal windows from within my Linuxcnc folder (CncMaster) in order to talk to Redis. The below are the results.

Opening the  Redis server :

Open terminal in linuxcnc folder
$ . ./scripts/rip-environment
$ redis-server configs/cnc1/redis_configure/cnc1.redis.conf

From terminal display:

cnc1@cnc1-OptiPlex-9020:~/CncMaster$ redis-server configs/cnc1/redis_configure/cnc1.redis.conf
8941:C 16 Jan 2022 07:03:15.562 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
8941:C 16 Jan 2022 07:03:15.562 # Redis version=6.2.6, bits=64, commit=00000000, modified=0, pid=8941, just started
8941:C 16 Jan 2022 07:03:15.562 # Configuration loaded
8941:M 16 Jan 2022 07:03:15.562 * Increased maximum number of open files to 10032 (it was originally set to 1024).
8941:M 16 Jan 2022 07:03:15.562 * monotonic clock: POSIX clock_gettime
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 6.2.6 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                  
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 8941
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           redis.io       
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'                                               

8941:M 16 Jan 2022 07:03:15.563 # Server initialized
8941:M 16 Jan 2022 07:03:15.563 * Loading RDB produced by version 6.2.6
8941:M 16 Jan 2022 07:03:15.563 * RDB age 60 seconds
8941:M 16 Jan 2022 07:03:15.563 * RDB memory usage when created 0.77 Mb
8941:M 16 Jan 2022 07:03:15.563 # Done loading RDB, keys loaded: 0, keys expired: 0.
8941:M 16 Jan 2022 07:03:15.563 * DB loaded from disk: 0.000 seconds
8941:M 16 Jan 2022 07:03:15.563 * Ready to accept connections

Shutting down linuxcnc gives:

8941:signal-handler (1642349593) Received SIGTERM scheduling shutdown...
8941:M 16 Jan 2022 07:13:13.654 # User requested shutdown...
8941:M 16 Jan 2022 07:13:13.654 * Saving the final RDB snapshot before exiting.
8941:M 16 Jan 2022 07:13:13.716 * DB saved on disk
8941:M 16 Jan 2022 07:13:13.716 * Removing the pid file.
8941:M 16 Jan 2022 07:13:13.716 # Redis is now ready to exit, bye bye...


Redis has a command line interpreter (CLI) available.
Starting the Redis CLI, and getting server info and ability to program via the CLI:

Open a terminal in linuxcnc folder
$ . ./scripts/rip-environment
$ redis-cli
$ info server

This is the display from terminal from the info server command:

cnc1@cnc1-OptiPlex-9020:~/CncMaster$ . ./scripts/rip-environment
cnc1@cnc1-OptiPlex-9020:~/CncMaster$ redis-cli
127.0.0.1:6379> info server
# Server
redis_version:6.2.6
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:4dfbfc6a1caecbd5
redis_mode:standalone
os:Linux 5.10.0-9-rt-amd64 x86_64
arch_bits:64
multiplexing_api:epoll
atomicvar_api:c11-builtin
gcc_version:9.3.0
process_id:8941
process_supervised:no
run_id:ad17c2616987d8f3e3a3ab1c063db8ae7f4910d5
tcp_port:6379
server_time_usec:1642349330430826
uptime_in_seconds:335
uptime_in_days:0
hz:10
configured_hz:10
lru_clock:14959378
executable:/home/cnc1/CncMaster/redis-server
config_file:/home/cnc1/CncMaster/configs/cnc1/redis_configure/cnc1.redis.conf
io_threads_active:0
127.0.0.1:6379>


CLI does not shut down when linuxcnc terminates so programming work is able to proceed.

Typing help as in the first line below in the CLI gives back the second and following lines:

127.0.0.1:6379> help
redis-cli 6.2.6
To get help about Redis commands type:
      "help @<group>" to get a list of commands in <group>
      "help <command>" for help on <command>
      "help <tab>" to get a list of possible help topics
      "quit" to exit

To set redis-cli preferences:
      ":set hints" enable online hints
      ":set nohints" disable online hints
Set your preferences in ~/.redisclirc
127.0.0.1:6379>

A lot more to do but its running and thus a good start.





 

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

More
17 Jan 2022 06:11 #232089 by auto-mation-assist
Reinhard,

I had a brief look at you control code and I'm very impressed. Your code looks extremely well written and very clean. I have attached a basic diagram I generated to help me understand the routing between its various components.
Attachments:
The following user(s) said Thank You: Grotius

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

More
17 Jan 2022 16:16 #232133 by Reinhard
Thank you very much for the flowers.

You don't need to care about most classes of the diagram. To get a working preview of the workpaths I had to setup a new instance of linuxcnc-interpreter - and as interpreter is doing lot of bullshit to keep python folks happy, I got a big bullshit-section in my app. Don't get lost in that part.

For communication with backend, there are 3 classes:
- StatusReader - polls the linuxcnc status and translates polling sequence into real event-based handling
- CommandWriter - runs in its own thread and ipc works with Qt-signals
- ErrorReader

So to understand the translation of polling into event-handling, have a look at ValueModel and ValueManager. That's my sort of global vars, which all over the app is used and no application part needs to know anything about linuxcnc-code.

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

More
02 Sep 2022 05:10 #250975 by auto-mation-assist
I have not had much interest to work on this project at all this year and when I think about it I don't have a real need to operate any of my machines anymore and that thus they could be in another persons hands in the future.  Thus my motivation to continue work on this project has diminished. It is of coarse possible to make a great UI with Labview but there has to be a need to spend the time required to work on it and right now I do not have the time or need. So my efforts are parked.

With the free versions of Labview for Linux and Windows along with their Python interface abilities I suspect that there will be a lot more interest in pursuing this in the future.
The following user(s) said Thank You: rodw

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

More
02 Oct 2022 00:05 - 02 Oct 2022 00:06 #253211 by auto-mation-assist
Recently I have  been working on some upgrade work on my milling machine's UI and looked at some of the options available on the forum, most of which are using some form of QT. But for me Qt is not the best option and I still prefer a Labview solution, and thus I dug up all my Labview code to refresh my memory of were I was in this project.

Most of the code I used to interface with LinuxCNC in this project interfaces directly into NML and has proven to be functional  via its network TCP links. The last problem that I was working on was the status decoding from raw data that NML sends out via its TCP link. Decoding that data was and may still be a bit of challenge via the NML route. It also presented a problem because it date stream does not appear to contain all status info.

It looks like a solution to the problems I recall running into is to use the Labview 'Python node from the Labview recently developed Python module and interface it directly into the LinuxCNC python module either using a local connection or via a network connection.

Labview remains my preferred choice for building a UI. It is fully programmable, has a built methods to generate its own UI front panels, and also has available front panel controls that are designed specifically for control of all types of industrial and scientific equipment.

I'm thinking that it may be possible to have Gremlin embedded into a Labview front panel. Just a thought at this point.

 
Last edit: 02 Oct 2022 00:06 by auto-mation-assist.
The following user(s) said Thank You: yangkkokk

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

More
19 Jan 2024 19:25 #291139 by yangkkokk
This is a great project, and I hope to see the follow-up

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

Time to create page: 0.103 seconds
Powered by Kunena Forum