Labview UI project for Linuxcnc

More
7 years 2 months ago #143099 by dgarrett

In older versions of Lcnc "extern int
emcTaskSetMode(int mode);" is present in emc.hh
but not in more recent versions versions of
emc.hh. It does make me wonder if past clean up
work on Lcnc removed some NML related items that
should have stayed in order to maintain full
functionality of TCP port 5005. Is this a
possibility ??


commit: df74db6f9 Thu Nov 28 12:40:17 2013 -0700
task: move a bunch of function declarations
to a more specific header

Ref: github.com/LinuxCNC/linuxcnc/commit/df74db6f9

First incorporated in v2.6.0:
Code:
$ git tag --contains df74db6f9 v2.6.0 ...
The following user(s) said Thank You: auto-mation-assist

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

More
7 years 2 months ago #143118 by auto-mation-assist
I have now downloaded all available versions of Lcnc from start in 2003 to present latest 2.9 for ref. I do see the changes that were made in 2.6.0 as compared to 2.5.0 and will look at those carefully in the next few days.

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

More
7 years 2 months ago - 7 years 2 months ago #143191 by auto-mation-assist
My additions of all the older extern integers did not get the results I had hoped for as a simple resolution. I did change void emcTaskPlanExit() to 'int' from void and the other locations required and recompiled. It only gave me this warning, emc/task/emctask.cc:516:1: warning: no return statement in function returning non-void [-Wreturn-type]. Adding a return statement did not help. I will bring it back to "void' and recompile to see that makes a difference. I shall continue to figure out on how to get the enum variables entered via hex encoded commands to port 5005 for the commands that require them.

I also took some time to look at the status request responses and noticed that entering NMLTYPE 1499 actually routes to 1999 internally by Lcnc since this is what is reported in a typical status message. The same for other status requests using type 1599. This leads me to suspect that there is a possibility that NMLTYPE 1999 is being used for every type of status request now. My byte count shows 8244 for type 1999 status request and it has a message length of 139741. This using my QTvcp development system not updated since around march of this year..

An additional 20 byte message is send just prior to sending status data and contains the below items (all 4bytes in length).
Typically looks like (Hex): 0000 0001 0000 0002 0000 2034 0002 21DD 0000 0001
0 - 0000 0001 Remote Request type
4 - 0000 0002 Buffer number
8 - 0000 2034 Status part of the message in bytes (8244)
12 - 0002 21DD message lenght (139741)
16 - Serial number echo that user sent.
This is immediately followed by: FFFF FFFF FFFF FFFF FFFF FFFF and then the status message itself in my tests.
Last edit: 7 years 2 months ago by auto-mation-assist.
The following user(s) said Thank You: tommylight

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

More
7 years 2 months ago - 7 years 2 months ago #143194 by auto-mation-assist
I checked my earlier file modifications and found that a problem with my editing. I have been able to enter the enum values now.
1 = manual mode, 2 = auto, 3 = mdi.
I need to check on this value further: (read 35 bytes from 4) in the below responses
.
Manual Mode
(time=1566803508.455991,pid=14498): Socket opened by host with IP address 10.10.20.1.
(time=1566803519.480054,pid=14498): read 20 bytes from 4
(time=1566803519.480080,pid=14498): TCPSVR request received: fd = 4, serial_number=1, request_type=2, buffer_number=1
(time=1566803522.060326,pid=14498): read 35 bytes from 4
(time=1566803522.060359,pid=14498): rcs_sem_post(6750208) called.
(time=1566803522.060391,pid=14498): wrote 12 bytes to 4
Issuing EMC_TASK_SET_MODE -- ( +504,+24, +3, +1,)

Auto Mode
(time=1566803618.732544,pid=14498): Socket opened by host with IP address 10.10.20.1.
(time=1566803622.541164,pid=14498): read 20 bytes from 4
(time=1566803622.541190,pid=14498): TCPSVR request received: fd = 4, serial_number=1, request_type=2, buffer_number=1
(time=1566803626.041421,pid=14498): read 35 bytes from 4
(time=1566803626.041455,pid=14498): rcs_sem_post(6750208) called.
(time=1566803626.041488,pid=14498): wrote 12 bytes to 4
Issuing EMC_TASK_SET_MODE -- ( +504,+24, +4, +2,)

MDI Mode
(time=1566803813.570980,pid=14498): Socket opened by host with IP address 10.10.20.1.
(time=1566803818.783676,pid=14498): read 20 bytes from 4
(time=1566803818.783711,pid=14498): TCPSVR request received: fd = 4, serial_number=1, request_type=2, buffer_number=1
(time=1566803822.563868,pid=14498): read 35 bytes from 4
(time=1566803822.563901,pid=14498): rcs_sem_post(6750208) called.
Issuing EMC_TASK_SET_MODE -- ( +504,+24, +8, +3,)

in the above: the +505 is NMLType, +24 is bytes for the task, +8 is serial number, +3 is enum selection value
Last edit: 7 years 2 months ago by auto-mation-assist.
The following user(s) said Thank You: tommylight

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

More
7 years 2 months ago - 7 years 2 months ago #143416 by auto-mation-assist
Progress has been good. I have the status polling working out of TCP port 5005 now and did the basic decoding for position data and display for X, Y , Z and A. Testing at the rate of 200 times per second for full status buffer updates and transferring 8264 bytes of status buffer data each time. Sending status update requests every 5ms. Nice and speedy.
Last edit: 7 years 2 months ago by auto-mation-assist. Reason: Added the word 'for' in (decoding for position data)

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

More
7 years 2 months ago - 7 years 2 months ago #143471 by auto-mation-assist
For my testing the status 5005 TCP port I developed this small sub program as part of my labview gui to verify that things were working well. It ran for 4 hours with no problems. Will work on decoding additional status items next. A while back I mentioned adding some external task parameters back it. This involved three files. emc.hh, emctask.cc and task.hh.

This a a snap shot of the temporary vi that I used for communicating with LinuxCnc over the network using the NML interface on port 5005.

You may notice that C axis position display is not present. I forgot to add the display for it but its position data is being processed.

Last edit: 7 years 2 months ago by auto-mation-assist. Reason: Added note for the missing C axis position display.
The following user(s) said Thank You: phillc54

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

Time to create page: 0.180 seconds
Powered by Kunena Forum