Advanced Search

Search Results (Searched for: )

  • PCW
  • PCW's Avatar
11 Apr 2025 21:51 - 11 Apr 2025 21:58

Running an external program from a HAL pin

Category: HAL

Another possibility would be a script with halcmd  in a loop,
watching the desired pin/signal  (halcmd -s show pin spindle.0.on | grep TRUE)
(this could also turn off the spindle if LinuxCNC was not running)
  • Grotius
  • Grotius's Avatar
11 Apr 2025 21:50

Connecting TURCK B20 Gateway through EtherLab EtherCat

Category: EtherCAT

Hi,

Here is a example project how to read & write to ethercat-master from any device.
I called the project twincat, because it is able to get and send info to the bus system.

The  ethercat-master source is slightly updated, It can print out more info as normal.
And the source had a nasty bug related to c code configuration wich i found.

This bug is still not resolved in etherlab master. I did tell them the bug, but i did not do a push request.

I think with this project you will be able to figur out how to use the TURCK device.
The project can print all details of the TURCK device. And you can send any data you want to the TURCK device.
1 bit send . Or 8bit, 16bit, and you can add more types if you need.
  • pgf
  • pgf
11 Apr 2025 21:39 - 11 Apr 2025 21:46

Running an external program from a HAL pin

Category: HAL

I run Home Assistant (open source, no cloud involved) which does a good job of managing the devices. It's not the interface to zigbee that's the issue -- it's the interface to HAL. :-)

Is the NML channel documented somewhere?   [ Edit:  Never mind, I found it.   No, I won't be going there...  ]
  • andypugh
  • andypugh's Avatar
11 Apr 2025 21:34
Replied by andypugh on topic Strange behaviour of custom component

Strange behaviour of custom component

Category: Advanced Configuration

Okay I got it... But how to customize them to not hard code them
 

In this case the answer is simple, just move the two variables above the ;; separator and create them as parameters. Then you will end up with independent static variables for each instance of the component. 

So: 
;;
...
enum MODESWAP{WRITEMODE, WAITVELOMODE, INITIAL, WORKING, WAITINGFORENABLE, HOMING};
enum MODESWAP modeSwap;
enum HOMESTATE{HOMETRIGGER, HOMECONFIRM, HOMESEEKING};
enum HOMESTATE homeState;

becomes
param out unsigned modeSwap;
param out unsigned homeState;
...
;;

You _may_ still be able to use the enum, that would be something I would experiment with to find out. If not you could create the state names as macros to preserve readability. (but you can always use something like:
switch(modeSwap){
   case 1: // Waiting
...
   case 10: // Exploding
)
  • Grotius
  • Grotius's Avatar
11 Apr 2025 21:27 - 11 Apr 2025 21:29
Replied by Grotius on topic Running an external program from a HAL pin

Running an external program from a HAL pin

Category: HAL

Hi,

Maybe we can use the zigbee-api

Then we make a tiny connection to the nml channel, as a client.
Then the zigbee can follow the emergency status. on - off.
 
  • pgf
  • pgf
11 Apr 2025 21:16

Running an external program from a HAL pin

Category: HAL

Right. that's exactly what I'm trying to accomplish -- disable the spindle with EStop. The spindle is a Makita router, with an on-off switch. I'd like to simply plug it into one of my zigbee-controlled smart switches, which are trivial to control from just about anywhere. Obviously a hard-wired relay would be better, but it's only a hobby mill, and that's not going to happen anytime soon.
  • Grotius
  • Grotius's Avatar
11 Apr 2025 21:14
Replied by Grotius on topic Strange behaviour of custom component

Strange behaviour of custom component

Category: Advanced Configuration

Hi,

but Grotius is on another level so what do I know.
I am on the same level as you Hakan.

Halcompile preprocess gives you bad c code. The preprocess option can be helpfull in some cases,
like reverse engineering a component.

This is a cmake project for a component called "test", i made years ago. It can be used for linuxcnc directly.

codeberg.org/skynet/hal-core/src/branch/.../test/CMakeLists.txt
  1. here should be "linuxcnchal"
  2. your relative paths to linuxcnc dirs
  3. Then this is the function to write your home sequence in.
  4. This is how you load the component in hal.

Then you can look at threads.c source code to use RTAPI ... text's inside the c code, so you can use
multiple instances of the component.

Just ask DeepSeek to add this feature to the test.c file and tell it what you want.
Do it step by step, and test so now and then. In fact it's quite easy.

If you don't succeed in 24hours, i will do it for you.




 
  • PCW
  • PCW's Avatar
11 Apr 2025 21:12

Running an external program from a HAL pin

Category: HAL

How is the spindle controlled? 

The spindle should be disabled by  EStop
 
  • pgf
  • pgf
11 Apr 2025 21:12

Running an external program from a HAL pin

Category: HAL

Also, I'm not wedded to doing this with MDI -- I'd much rather use an interface that didn't require editing four different config files just to get it setup. ;-)

It seems like what I want should be part of halui somehow, but as far as I can tell, it's not.
  • PCW
  • PCW's Avatar
11 Apr 2025 21:09
Replied by PCW on topic 7i92 firmware issue

7i92 firmware issue

Category: Driver Boards

Here's a more complete set of utilities:

( note that you should not use Mesa's MAC in the addresses in the scripts )

freeby.mesanet.com/unixfpgainit.zip
 
  • wrhammer
  • wrhammer
11 Apr 2025 20:54
Remap M6 in python was created by wrhammer

Remap M6 in python

Category: General LinuxCNC Questions

Pretty much got everything up and ready on my Biesse conversion but stuck on running the M6 tool change from auto mode in g-code. The M6 works great from the MDI and is really responsive using the self.execute command to execute the M64 and M65 motion output pins, G43 tool offsets etc. but nothing activates when I try and run an M6 in g-code. I've tried adding delays and waits on the interpreter, have messages printing to the log and the code runs but no outputs actually happen. I did see that the entire g-code is read first and it will immediately try the tool change but it doesn't actually happen. I get a successful tool change in my logs but the DRO and tool info don't update and none of the outputs actually fire to raise and lower solenoids for that bit. It seems like this is something really simple but struggling to find it! Any suggestions?
  • unknown
  • unknown
11 Apr 2025 20:38
Replied by unknown on topic 7i92 firmware issue

7i92 firmware issue

Category: Driver Boards

I understand now, silly me.
Ok found I had to use setname & found the Linux version here
www.forum.linuxcnc.org/27-driver-boards/...board?start=10#65737

and I can communicate.

Thanks again
  • pgf
  • pgf
11 Apr 2025 20:31

Running an external program from a HAL pin

Category: HAL

I want to shut off my spindle. (A Makita router.) I certainly won't be turning it on this way. And it would be a lot safer to do this than what I have now, which is "nothing". (From the software side, that is. The hardware switch on the mill does cut power to the spindle.)

As a less dangerous sounding example -- I'd also like to control my shop vacuum dust collector automatically. That's less likely to involve e-stop, but it would certainly be nice to shut it down automatically in that case.
  • unknown
  • unknown
11 Apr 2025 20:27
Replied by unknown on topic 7i92 firmware issue

7i92 firmware issue

Category: Driver Boards

Oh the 93c46 has to be programmed separately ?

I thought the firmware did that
  • PCW
  • PCW's Avatar
11 Apr 2025 20:26

Running an external program from a HAL pin

Category: HAL

It does seem a bit dangerous and contrary to the purpose of EStop
to do motion commands automatically after an EStop event.

What is the intended operation and with what kind of EStop is further motion
safe?
Displaying 3616 - 3630 out of 26051 results.
Time to create page: 1.322 seconds
Powered by Kunena Forum