macro wymiany narzędzia

Dyskusje dotyczące najpopularniejszego programu sterującego maszynami CNC

sfugiel
Nowy użytkownik, używaj wyszukiwarki
Nowy użytkownik, używaj wyszukiwarki
Posty w temacie: 1
Posty: 4
Rejestracja: 19 maja 2010, 10:11
Lokalizacja: Bydgoszcz

#11

Post napisał: sfugiel » 19 maja 2010, 10:46

Witam,
Szukam oprogramowania, które umożliwi skanowanie wymiarów 3D przedmiotu postawionego na stole frezarki wygenerowanie kodu, zapisanie kodu i wykonanie żądanej liczby kopi przedmiotu w żądanej skali /powiększenie lub pomniejszenie wymiarów orginału/
Stanisław



Tagi:


Maq
Specjalista poziom 1 (min. 100)
Specjalista poziom 1 (min. 100)
Posty w temacie: 1
Posty: 297
Rejestracja: 14 gru 2009, 15:05
Lokalizacja: podkarpacie

#12

Post napisał: Maq » 19 maja 2010, 10:51

W tym poście jest coś o tym, także o programach: https://www.cnc.info.pl/topics85/skaner-3d-vt7070.htm

Awatar użytkownika

k-m-r1
ELITA FORUM (min. 1000)
ELITA FORUM (min. 1000)
Posty w temacie: 5
Posty: 1418
Rejestracja: 23 cze 2008, 10:38
Lokalizacja: OOL lub DW
Kontakt:

#13

Post napisał: k-m-r1 » 21 maja 2010, 23:50

ja radze jakis port wykorzystac

Kod: Zaznacz cały

Input/Output signals, Modbus I/O, a serial port and "foreign" ports 
[edit] 
Signals 

Scripts can access the input signals (both on parallel ports and defined virtually in response to keycodes) such as the state of home and limit switches and can control output signals. 
Function IsActive (sigNo as Integer) as Boolean
Function IsOutputActive (sigNo as Integer) as Boolean
Sub ActivateSignal (sigNo as Integer) 
Sub DeActivateSignal (sigNo as Integer) 

IsActive tests input signals. IsOutputActive tests output signals. They will return True if the signal is active (i.e. its LED would be lit on the Diagnostics screen). In other words this test is after the application of the Active Hi/Active Lo configuration of the signal hot a test of "0 volts" or "5 volts" on the signal's pin. 

ActivateSignal and DeActivateSignal similarly control the logical state of output pins. Mach3 will apply the Active Hi/Active Lo configuration to establish the electrical state required. 
Function IsSuchSignal (sigNo as Integer) as Boolean

Returns TRUE if the signal is enabled. It is used to avoid things like digitising if the machine has no probe input defined. 

For all these routines, the required signal is coded using the values defined on the VB Constants for Signal Names page. 
Sub SetTriggerMacro (MacroNo as Integer) 

Defines the number of a macro to be executed when an OEMTrigger is set (slightly unexpectedly on the Config>Set System Hotkeys dialog) to generate OEM code 301. This provides script execution without the requirement for a screen button as intermediary. 

For example if SetTriggerMacro 456 has been executed then a signal on any OEMTrigger configured to 301 will run the code in the file M546.M1S when activated. 
[edit] 
Modbus

Modbus is a standard (details here) serial protocol which allows control of a device such as a Programmable Logic Controller (PLC) or dedicated interface (like Peter Homann's ModIO). Typically thois expands the input/output capability of Mach systems for non-time-critical functions. 

Mach supports direct access to the registers of a Modbus device and will perform autopolling to map registers into ports and pins and to give simple access to the state of analog inputs and MPG counters. 
[edit] 
Direct input routines
Function FillFromCoil (slave as Integer, startAddress as Integer, nBytes as Integer) as Integer
Function FillFromStatus (slave as Integer, startAddress as Integer, nBytes as Integer) as Integer 
Function FillFromHolding (slave as Integer, startAddress as Integer, nBytes as Integer) as Integer
Function FillFromInput(slave as Integer, startAddress as Integer, nBytes as Integer) as Integer 


These routines will request a memory transfer from the current ModBus device's Coil, Status, Holding and Input registers. The requested number of bytes starting from the address specified will be transfered to an internal buffer in Mach. Routine returns a 1 if successful in its transfer. 


Function GetModWord(index as Integer) as Integer

This rotuine will return a "16 bit word". All data transfered from the device using the Fill routines, sends its information to a buffer. This routine will return a 16 bit word in the buffer selected by index. The first word is selected by index = 0 
Function ModGetInputBit(nBit as Integer) as Integer 

This routine will return the bit chosen by the index nBit as a one or a zero from the input buffer above. The first bit (i.e. most significant in the first word) is selected by nBit = 0 

Example: 
FillFromInput( 1, 102, 5 ) ' this will transfer 5 bytes to the buffer system from address 102 in the device.
i = ModGetInputBit (6) ' will get the 6th bit from that 5 byte array which you transfered


[edit] 
Polled input/output
Function GetInput (buffIndex as Integer) as Integer
Sub SetModOutput (buffIndex as Integer, value as Integer) 

Reads or writes a 16 bit word from/to the buffers updated by polling the Modbus. Access to these buffers is a memory access rather than an I/O transaction implied by the raw reading routines so these calls can be made as frequently as desired. 

buffIndex values 0 through 63 are single bits corresponding to the input and output pins of Port 0. The mapping of these to Modbus device registers is defined in the Config>Setup Modbus Control dialog. 

buffIndex values 64 through 127 are 16 bit words. These are mapped in Config>Setup Modbus Control dialog. For full details see Modbus in Mach. 
Sub SetModIOString (slave as Integer, xDisp as Integer, yDisp as Integer, Text as String) 


Writes the string on the ModIO LCD screen (if present). 

Notes: 

(a) xDisp must be an even number, i.e. writing must start at a 16 bit word boundary in the ModIO. 

(b) SetHomannString (xDisp as Integer, yDisp as Integer, Text as String) is a legacy routine equivalent to SetModIOString, with Slave = 1 
[edit] 
Serial port 

You can send bytes of raw data to a serial port. The port number (i.e. n in COMn) to be used and the baud rate for transmission is set in Config>Logic. RTS/CTS hardware flow control protocol will be used to control large volumes of data but this will not be normally required. Data is transmitted 8 data bits, 1 stop bit No Parity by a call of SendSerial. 
Sub SendSerial (chars as String) 

Example: to write the value of X DRO to an LCD display connected to the serial (RS232) port. 
Call SendSerial ("X-Axis = " & GetDRO (0)) 


[edit] 
Foreign ports 

Scripts can access ports on the PC which are additional to the one (or perhaps two) parallel port(s) defined in Config>Ports and Pins. These are accessed at the basic hardware port address level and you will have to be aware of the details of the individual port addresses, allocation of data and status bits etc. 
Function GetPortByte (pAddr as Integer) as Byte
Sub PutPortByte (pAddr as Integer, bData as Byte) 

This feature should be used with great care as, if misused, it can interfere with any peripheral on your system, including the hard-drive.
skoro piszesz makra to zrozumiesz
zrubzinnego portu sterowanie bez zabawy w jakies sygnałyzwrotne i magazynek jak coś siądzie to bedziesz miał dopiero cyrki
MACH3 cncTworzenie Makr do palników magazynków THC OHC inneEKRANY dla firm producentów maszyn Budowa sprzedaż wypalarki plazma gaz obrotnice Elektrodrążarki Frezarki Tokarki Giętarki3D inne wg zlecenia 888 703 196 Tomek Komor [email protected]


Autor tematu
kamil1986
Specjalista poziom 2 (min. 300)
Specjalista poziom 2 (min. 300)
Posty w temacie: 3
Posty: 316
Rejestracja: 10 cze 2007, 15:09
Lokalizacja: Ostrów

#14

Post napisał: kamil1986 » 04 cze 2010, 19:04

witam naskrobałem nowe makro do wymiany narzędzia tylko jest z nim mały problem
maszynka jedzie w wybrane miejsce oś z jedzie do góry na "0"
potem maszynka jedzie nad czujnik z osia podniesioną do góry
następnie maszynka dokonuje pomiaru dł narzędzia i zapisuje je
w tabeli narzędzi np frez ma dł 50mm jak dokonam ponownego pomiaru tym samym frezem to długość narzędzia pokazuje "0" i tak w koło a jak ustawie zero materiału to już całkiem cyry wychodzą mach nie liczy dł narzędzia od zera osi tylko od tego co jest na liczniku osi "z"

Dim zmienna,zdro,wz 'deklaracja zmiennych

Code "g0"
Code "g53 x1.56 y-31.84 "'ruch do pozycji XY czujnika dlugosci narzędzi

While IsMoving()
Wend

GetVar(2002)

Code "G31 Z" & -100 & "f600" ' pomiar narzędzia
While ismoving()
Sleep 100
Wend

zdro=getdro(2)'zapamietanie położenia osi z gdy sonda da sygnał

Call SetOEMDRO(42,zdro)
Tool = GetDRO( 24 ) ' wpisanie wyliczonej wartosci Do rejestru dlugosci narzedzia
code "g43 H"&tool

Code "g0"
Code "G53 z0"
While ismoving()
Sleep 100
Wend
MsgBox("zmieniono długość narzędzia") 'komunikat

ODPOWIEDZ Poprzedni tematNastępny temat

Wróć do „Mach 2 / 3 / 4 (ArtSoft software)”