Hello Guest it is May 16, 2024, 05:41:02 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 - The_black_cat_dies

Pages: « 1 2
11
General Mach Discussion / Re: Serial Port control under cypress enable
« on: August 23, 2007, 02:32:12 PM »
Hi
Thanks for the input, I now have mach sending the file using the last bit of script. What may be of of interest to you all is that Mach will receive serial through the VB script, if you plug into another PC using a NULL modem cable and run hyperterminal then run this on your Mach machines VB script.

For i = 1 to 1000
x = getportbyte(1016)     ' Assumes you are using COM1 at &h3F8
putpportbyte(1016)
next i

You will see that every key you press on the terminal PC will be returned to the terminal PC via the VB script of Mach, not very usefull at the momment but just shows bi directional communication is possible, if I can now find the data flow control bits I think it will be possible that Mach can talk to any serially controlled hardware I hope :-)   

12
VB and the development of wizards / Re: Yes/No or Ok/Cancel dialog
« on: August 23, 2007, 08:07:11 AM »
Hi
Scott Have you had any experiance of using the serial port, and how did you get on do you have any code to share?

13
General Mach Discussion / Re: Serial Port control under cypress enable
« on: August 23, 2007, 07:50:24 AM »
Hi Thanks for that poppabear I see your point but that isn't the problem, the macro as it was just would not work when running in a script.

I managed to get the file to write to serial by using the following



Sub intialise_boxford()

For i = 1 To 100
getfifoentry()
Next i                                                         ' clear input buffer if there is one?


message "Initialising Boxford"                          ' Start message

Open "c:\mach3\duet.dat" For Input As #1      ' Open file.

Do While Not EOF(1)                                     ' Loop until end of file.

outint = Asc(Input (1,#1))                             ' Read byte into variable.

PutPortByte(1016,outint)                               ' write byte to COM1 Low level but works

GetFIFOentry()                                              ' either adds delay or clears buffer ?
 
Loop                                           ' Get another byte

message "Boxford Initialised"           ' completiion message

playwave "c:\tada.wav"                  ' file has been sent works :-) 

Close #1 ' Close file.                       ' Close file "Duet.dat"

For i = 1 To 1000000                     ' delay give message time to be seen
Next i

message ""                                    ' clear messages off screen

End Sub

Although this works, I think I need to check the transmit status bit on the serial port instead of the (GetFIFOentry()) which I think is just adds a delay, this is a major success and I will be moving on the receiving data soon. however Mach still seems to want to show all messages within the macro when the G code file is loaded, this is stange it doesn't appear to actually run any code it just displays the messages ?
any ideas greatfully received also are the macros running in their own thread ie multitasking?



14
General Mach Discussion / Serial Port control under cypress enable
« on: August 22, 2007, 12:28:04 PM »
Hi
I have been trying for some time now to get the serial control to work reliably sending a file "900 bytes text" to my Boxford Duet. When I use the VB script editor and run it, it works perfectly however when I run a G code file and include it as a macro "M20" it stalls after 20-30 bytes, I have HyperTerminal observing the output. Also Mach seems to want to run the macro immediately the G code is loaded, what am I doing wrong I include the small macro I have written. 

Sub intialise_boxford()

message "Initialising Boxford"

For count = 1 To 255 ' Clear buffer seems to help
x = getfifoentry()
Next count

Open "c:\mach3\duet.dat" For Input As #1 ' Open file.

Do While Not EOF(1) ' Loop until end of file.

char = Input (1,#1) ' Read value into variable.

Call sendfifo(char)

Loop

message "Boxford Initialised"

Close #1 ' Close file.

End Sub

Any help would be gratefully appreciated, as this is frustrating as I’m very close to getting everything running.

Pages: « 1 2