Hello Guest it is April 18, 2024, 06:36:12 PM

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.


Topics - xLocksmith

Pages: 1
1
VB and the development of wizards / 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

Pages: 1