Machsupport Forum
Mach Discussion => VB and the development of wizards => Topic started by: xLocksmith on September 16, 2008, 02:16:21 AM
-
Hey all,
I would like to send the current DRO values to the serial port, I found that : Call SendSerial (GetOEMDRO(83) & " " & GetOEMDRO(84) & " " & GetOEMDRO(85) & "*") does this with no problem :).
Now I would like to send the values constantly while running a part. I have tried putting it in a while loop with a short sleep but it seems to hang the system. It looks like the sleep is actually causing the problems. Perhaps there is some event based approach I could be using, any ideas? Current script is below:
'Loop endlessly writing the current DRO values to the serial port
'While true
'Write the DRO values
Call writeDROSerial()
'Sleep for a bit so we dont flood the serial port
Sleep(100)
'Wend
'Dump the DRO values out to the serial port with a * as the end line (Not sure how to create a CRLF!!! so a * will do for now)
Sub writeDROSerial()
Call SendSerial (GetOEMDRO(83) & " " & GetOEMDRO(84) & " " & GetOEMDRO(85) & "*")
End Sub
-
What version of Mach are you running?
Brett
-
I believe I am running the version 3.041 from this link: http://www.machsupport.com/downloads/Mach3VersionR3.041.exe
I will confirm this tomorrow when I get back to work. Can you suggest the best version to try for sleeps / serial coms ?
Cheers,
Ross
-
I'm not sure on the serial com. I have seen others try but I don't recall anyone suceeding.
If you want to try and use the sleep command, use the bleeding edge version 3.042.008. This will come with its on share of humps to get over but for the sleep command, it's the only one.
Brett
-
No luck with the beta version :(
It does sort of work, but the sleep seems to just make everything jerky. Looks like it might be a threading priority problem.
Does anyone know if you can capture events from the VBScript interface?? It would be perfect if there was an event that was generated when the mill is moving. I could only see the isMoving() function which is not event based as far as i can see.
-
Russ, I have been doing some talking and right now it looks like you will need to do this in C++. I know little about Vb and far less about C++. Good luck.
Brett
-
Does mach 3 offer an interface lib? or is this something only the developers can do?
I can easily write the c++ code, so if there is some interface that would be great :)
regards,
Ross