Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: jpryder5 on January 20, 2022, 03:50:02 PM

Title: User Led not setting
Post by: jpryder5 on January 20, 2022, 03:50:02 PM
I've bounced all over the place online looking for a answer to this issue.
For whatever reason I cant change the state of any user defined LEDs.
If I'm not mistaken Its just SetUserLED(***,1) for on, this for whatever reason doesn't do anything to the LED, I don't know if its because I'm doing my testing on a computer that's not even connected to a cnc or what.

The script I'm using it in is supposed to find the end line for any code loaded into mach3 and once its done it should light up the led but it doesn't.
Dro 1202 is just to show that its running through, it doesn't actually do anything
Code: [Select]
Dim I
Dim textLine

Open FileName For Input As #1

While Not EOF(1)
Line Input #1, textLine
I = I + 1
SetuserDro(1202, I)
Wend

Close #1

Call SetUserDRO(1200,I)
Call SetUserLED(500, 1)
Title: Re: User Led not setting
Post by: Klaus1311 on January 23, 2022, 05:56:52 AM
Hi    jpryder5
I suppose you want to set LED1202. But in your sample code you are trying to set DRO 1202.

Klaus
Title: Re: User Led not setting
Post by: jpryder5 on February 05, 2022, 01:12:35 PM
Hi    jpryder5
I suppose you want to set LED1202. But in your sample code you are trying to set DRO 1202.

Klaus
Dro 1202 is used to show what line the code is currently at as it reads the gcode. Dro 1200 is used to store the end line so that it can be used to calculate the percentage of code ran.

At the bottom of the code I'm trying to set a led after everything has been ran as a sort of indicator for when it's finished running the script. But for some reason SetUserLed doesn't do anything to any user defined LEDs.
Title: Re: User Led not setting
Post by: Graham Waterworth on February 05, 2022, 05:50:54 PM
From memory I think user LED's start at 1000 anything below 1000 is usually system related.
Title: Re: User Led not setting
Post by: Klaus1311 on February 05, 2022, 06:02:10 PM
Try using a LED number > 1000.

Klaus
Title: Re: User Led not setting
Post by: Dirtboater on October 25, 2023, 11:37:41 PM
Try using a LED number > 1000.

Klaus
Thanks for that information, but how does a person determine or set what number a User Led is for a script to call it?
Title: Re: User Led not setting
Post by: TPS on October 26, 2023, 03:19:23 AM
see attachment