Hello Guest it is April 26, 2024, 05:57:34 AM

Author Topic: Read specific data from a parameter list (txt file) into MACH3???  (Read 1686 times)

0 Members and 1 Guest are viewing this topic.

Offline Vido

*
  •  25 25
    • View Profile
Re: Read specific data from a parameter list (txt file) into MACH3???
« Reply #10 on: July 17, 2023, 01:10:11 PM »
did a quick search
1501 1502 1503 are used by the encoder module
1510 1511 by spindle positioning
1511 1512 1513 by probing
1511 1512 1513 1514 by riggid tapping

Oou, okay. I used 1500- 1504 for the DROs

Offline Vido

*
  •  25 25
    • View Profile
Re: Read specific data from a parameter list (txt file) into MACH3???
« Reply #11 on: July 18, 2023, 03:10:39 AM »
did a quick search
1501 1502 1503 are used by the encoder module
1510 1511 by spindle positioning
1511 1512 1513 by probing
1511 1512 1513 1514 by riggid tapping

i tried other OEM Codes (1203-1207) for the DROs and it works. Thank you!
By the way: where did you get the information that CS LAB use the OEM Codes 1500+? I've looked through various documents from MACH3 but found nothing; I only have an application description from CS Lab but it doesn't say anything about OEM codes.

Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: Read specific data from a parameter list (txt file) into MACH3???
« Reply #12 on: July 18, 2023, 06:51:10 AM »
i got some information years ago from Wojtek (CSLAB) and som others you can find in their example script's.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline Vido

*
  •  25 25
    • View Profile
Re: Read specific data from a parameter list (txt file) into MACH3???
« Reply #13 on: July 18, 2023, 08:49:06 AM »
i got some information years ago from Wojtek (CSLAB) and som others you can find in their example script's.

Sorry to ask again: I would now like to use the number read from the text file, which is displayed in a DRO, to set a delay. The delay should ideally be directly in macro M771. Macro M771 opens the valve. After opening the valve, a delay time (depending on the material and material thickness - value read from the material list into the corresponding DRO) should occur before the program continues. I tried the following (written directly in macro M771):

1) AcivateSignal (Output8)
    Sleep(GetOEMDRO(1207))

2) AcivateSignal (Output8)
    #1 = GetOEMDRO(1207)
    Sleep([#1])

3) AcivateSignal (Output8)
    GetOEMDRO(1207) = a%
    Sleep(%a)

Case 1 shows no error, the valve opens (it should) but it is not delayed?
Case 2) shows the error "Scripter Compile Error. In:M771.mis"?
Case 3) shows the error "Error on line: 2- Type mismatch"?

Is it possible to run the "G4 P" command via the macro, where the value from the DRO should be after the "P"?

Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: Read specific data from a parameter list (txt file) into MACH3???
« Reply #14 on: July 18, 2023, 08:58:14 AM »
i have tested this code in VBScripter window:

Code: [Select]
SetOEMDro(1207,5000)

msgbox GetOemDro(1207)

ActivateSignal(OUTPUT8)

Sleep(GetOEMDRO(1207))
   
MsgBox "After"

and it works like expected
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline Vido

*
  •  25 25
    • View Profile
Re: Read specific data from a parameter list (txt file) into MACH3???
« Reply #15 on: July 18, 2023, 09:37:44 AM »
i have tested this code in VBScripter window:

Code: [Select]
SetOEMDro(1207,5000)

msgbox GetOemDro(1207)

ActivateSignal(OUTPUT8)

Sleep(GetOEMDRO(1207))
   
MsgBox "After"

and it works like expected

It works with my variant all the time too. In the settings I set the dwell to seconds. What I missed is that for the "Sleep" function, the time is always given in msec. Since I had readings of around 3 seconds (which turned out to be 3 msec for the sleep function), this is barely noticeable, so I figured there was no dwell at all.

Offline Vido

*
  •  25 25
    • View Profile
Re: Read specific data from a parameter list (txt file) into MACH3???
« Reply #16 on: July 20, 2023, 09:32:14 AM »
Hi TPS!
Do you perhaps have a list of which pound variables are occupied or free in MACH3? I would like to read the feeds out of the DROs depending on the material and put these values ​​after the "F" in the G-code. When selecting the variables, I selected the command "SetVar(1234, GetOEMDRO(1203)) in a macro M123, i.e. variable 1234 always reads the feed - that works. But if I write "SetVar(1235,GetOEMDRO(1203)), then the error message comes up: "Cannot do G1 with zero feed!"
I also tried using variables 1233, 1236, 1001, etc. but got the error message every time. When selecting variable 1, it suddenly worked again. There must probably be some variable numbers in use here as well, but I can't find a list of which they are or which variables are still free.

Offline Vido

*
  •  25 25
    • View Profile
Re: Read specific data from a parameter list (txt file) into MACH3???
« Reply #17 on: July 20, 2023, 10:13:38 AM »
I've tried various variables. The error message "Cannot do G1 with zero feed!" appears when the G- code ist loading for the first time, the program can be started and the machine moves with the correct feed rates. As a result, the error message no longer appears (unless there really is zero in the DRO - then the program stops at this point, which is also clear). Is it possible not to get the error message? It works, but it's annoying when the error message appears when loading the G-code for the first time! I habe to click the button "Rewind" and then start the program.

Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: Read specific data from a parameter list (txt file) into MACH3???
« Reply #18 on: July 20, 2023, 12:06:06 PM »
the simpies way to set the feedrate is:

Code: [Select]
Code "G1 F" & GetOEMDRO(1203)

or just
Code: [Select]
Code "F" & GetOEMDRO(1203)
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline Vido

*
  •  25 25
    • View Profile
Re: Read specific data from a parameter list (txt file) into MACH3???
« Reply #19 on: July 21, 2023, 07:49:12 AM »
the simpies way to set the feedrate is:

Code: [Select]
Code "G1 F" & GetOEMDRO(1203)

or just
Code: [Select]
Code "F" & GetOEMDRO(1203)

Ok, when I do it with your variant, then the error message doesn't come at all. It's funny that the error message with my variant ONLY occurs when the G-code is loaded for the first time - but the program runs perfectly... funny.
Thanks!