Hello Guest it is April 26, 2024, 02:00:43 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - stirling

1851
Hi Terry - with regard to your last question to Graham - you need to read my earlier reply about the format of hex strings in BASIC. The syntax is &H0378 or whatever address you're using. The &H is instead of Grahams 0x at the front of the string.

A word of caution which I hope isn't too late. You have to be VERY careful which port or address you write to - you can seriously screw up your system - even trash the hard disk if you're not careful.

Ian

1852
Hi Terry
Hi Ian, THe machine has 3 lpts, 2 for MACH and one for windows(;-) SO far they have behaved ok but???
Cool

Well I gleamed a little more info last night on serial ports and mach. Seems the sendserial only works IF you have NOT set up the event serial control, and it is send only.

If the event control is active it it bidirectional and you use getfifo, sendfifo
The SendSerial command is used only for sending one way traffic.
> It cannot
>> recieve.
>> The GetFifo is used only in 2 way serial communication. This two-
> way mode is
>> selected by
>> config/ports&Pins and selecting "Event driven Serial mode" .
> Then , to send
>> you use
>>
>> SendFiFo( "This is what I want to send')
>> and recieve using GetFiFo()
>>
>> Do not use SendSerial if you want to get a return, only the
> event driven
>> serial is separate threaded
>> and available for realtime back and forth..
>>
>> Thanks,
>> Art

***** NO wonder I could not get the monitor to run and use sendserial (;-)
Cool again

Documentation is a wonderfull thing IF you have any(;-)
LOL - after 20+ years in software engineering I've learned there are two things that are as rare as rocking horse sh*t - code commenting and documentation updating... and no (Brian) I'm not volunteering.

Hi Stirling I almost missed your question. AS part of this project I would like to send a copy of the tool table AND a copy of the current slots assignment to a printer from a mach button. BUT it seems that the MACH VB does not support printing to an lpt port,at least not that I can get to work. It errors with,  not a supported object or command.
How are you trying to do this - i.e. what command/routine is failing?

Ian

1853
Sorry Ian, its a reply to VMAX about his Denford ATC, I need to create a new thread, should not have hijacked this one.

Graham.

Hi Graham - no problem - I did wonder if I'd missed some posts somewhere  ;D

HI IAN, Same subject but a different project(;-)

 We have a denford mill with a tool changer that is converted to MACH control. Now we have to interface the ATC (toolchanger) to mach. THe atc runs from a serial connection. We have captured all the control codes needed to run the ATC and can make the TC cycle by sending the codes through Hyperterm to the atc.

Question? How do we get VB to send the controls codes over the com port when needed?

Hi Terry - according to this your ATC is on your serial port (COM). To write to that I think you must use "sendserial" not "putportbyte" and set up the baud rate and handshake etc. on the Config page.

I think we all may be getting a little confused because the port address that Graham has given you (Hi again Graham) is the address of the default PARALLEL port. (PS - for 0x378 (C hex style) use &H378 (BASIC hex style))

Question Can I send a copy of the tool table to a printer port? Say LPT1
Your second requirement is indeed for the parallel port (well assuming your printer is on the parallel port). BUT, you can't just write raw data to the parallel port and have it come out on a printer. You either have to figure out all the particular manufacturers formatting/hanshaking codes OR of course more usually, you need to print via their driver which does all that for you. However - I'm not sure whether Mach can tolerate a printer driver to exist along side it's pulse engine - maybe on two separate LPTs it can - I don't know.

Cheers

Ian

1854
Hi Graham - just so we don't get confused here - I take it you mean parallel port where you've written serial port. :)
Also - out of interest - what's the 9ms delay for?

Ian

1855
Question? How do we get VB to send the controls codes over the com port when needed?
see "sendserial" at http://www.machsupport.com/MachCustomizeWiki/index.php?title=Mach_specific_Subroutines/Functions_grouped_by_purpose or 4.4.10 in the customization guide.

Question Can I send a copy of the tool table to a printer port? Say LPT1
Not sure I understand what you mean.

1856
NOW if I can make it look the OLD way and do it the new way ???????

No problem - you revert to a previously mentioned scheme. You use your screen to load a table or whatever and your code operates on the table rather than on your DROs. In fact this is probably what you should do anyway - its good software engineering practice to keep a separation between the code and the interface.

Ian

1857
Hi Terry - If you want to use my hotswap routine logic then you'll need to flip your tool/carousel numbers. Doing it your way you'll have to search for the slot by stepping through each slot in turn looking for the required tool. Doing it my way you go straight to the tool and lookup the slot - simple.

1858
OK Terry - keep posting  :)

1859
Hi Terry - OK - not a problem.

Still concerned about my question re lookahead though because that's fundamental to what you're doing.

Ian

1860
Hi IAN, WHen Mac see a t# it stores it in a var or buffer. At the M6 call it processes that var.
Yep - agreed - no problem so far.

After the M6 has finished mach then loads up the NEXT t# into the var/buffer.
Well - not quite I think - from what I've seen, Mach doesn't store the T# in the var until it subsequently processes the line the T# is on. Let's be exact here - its the only (good) way to spec software. And here's the first issue. You want to be able to read the next T# as soon as you've loaded the previous tool into the spindle - that's why you need a lookahead mechanism OR you need to pre-process the gcode to move the next T# to immediately after the M6 so that your macro pump routine can get started on it asap.

SO that var is available to use from a brain/pump to active a MACH ouput pin that can control a relay.
OK - this is what I was looking for in my last post - I thought Art may have sneeked a soft interrupt in there somewhere but polling is ok - I can go for that.

the brain/pump then can watch for the proper ID signal combination from the abs encoder to let mach know when to deactive or resignal for a stop.
OK

You will notice that the example page has the SLOT# as the primary id and the TOOL# as the variable. THis will be the easiest for the operator to track. He first has to load the carousel and inoput what tool went into what slot. Also at any time he must be able to verify the tool# and slot. SO I thought a PAGE with dros would work well here.
Mach can keep the dros as persistant dros and we never loose the info from job to job or shut down to startup.(I think)(;-)
The GoToSlot# allows the operator to rotate to a slot to unload/load a tool from the carousel.
OK - personally I wouldn't worry about all this at the moment - I'd get a basic simple harness working and worry about this later - but hey - its your call. FWIW I personally think the practice of using DROs as variables is messy but whatever - I know a lot of people do it.

Would I need a table to load up from the dros so VB could work its magic and track the hotswapping and keep the dros updated as well??
Well not really - if you can access your DROs from your code to populate a table (which of course you can) then you can do whatever directly on them. Different types of data structures are used because of the particular advantages they bring over each other in manipulating their data. VB has pretty p*ss poor data structures anyway so I wouldn't worry about it.
Now - hotswapping - if you can rotate your carousel whilst the axis are moving - the whole point here - why do you need hotswapping?

Can your example of hot swap work in this instance?? I know you had the tool# as prim ID and the slot as the variable(;-)
Well it was just that - an example - but it could be changed to do whatever you want - but see above - hotswapping - why do you need it?

Ian