Hello Guest it is April 24, 2024, 09:09:25 PM

Author Topic: Constantly sending DRO to serial port  (Read 6176 times)

0 Members and 1 Guest are viewing this topic.

Constantly sending DRO to serial port
« 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
« Last Edit: September 16, 2008, 02:57:24 AM by xLocksmith »

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: Constantly sending DRO to serial port
« Reply #1 on: September 16, 2008, 08:51:25 AM »
What version of Mach are you running?

Brett
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!
Re: Constantly sending DRO to serial port
« Reply #2 on: September 16, 2008, 11:46:27 AM »
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

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: Constantly sending DRO to serial port
« Reply #3 on: September 16, 2008, 12:53:12 PM »
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
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!
Re: Constantly sending DRO to serial port
« Reply #4 on: September 17, 2008, 10:09:46 PM »
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.

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: Constantly sending DRO to serial port
« Reply #5 on: September 18, 2008, 10:17:46 PM »
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
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!
Re: Constantly sending DRO to serial port
« Reply #6 on: September 18, 2008, 10:54:38 PM »
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