Comunication COM1: and a CNC milling machine (timeout?)

Sarah sarahr at genesearch.com.au
Wed Sep 17 19:31:16 EDT 2003


Hi Malte,

You might want to try out my Serial test stack - available from my web 
page at
<http://www.troz.net/Rev/>
I have just updated it so that it allows you to select termination 
characters i.e. whether sends should end with CR (ASCII 13), LF (ASCII 
10) or CRLF and the same for receives.

Although not of interest to you, it now also works with OS X, but only 
for Rev 2.1

I think it will solve your reading problem, because it doesn't do a 
single read, but reads continuously as long as the port is open, 
reporting whenever it gets any data. One other thought: you probably 
have to send a command to the milling machine first, to tell it to send 
it's data and which data to send.

Cheers,
Sarah
sarahr at genesearch.com.au
http://www.troz.net/Rev/

On Wednesday, September 17, 2003, at 08:59  pm, Malte Brill wrote:

> Hi List,
>
> my dad asked me if I could build an app. that stores the Programs of 
> his CNC
> milling machine on his Windows PC. I promised him to try it.
>
> The Machine is connected with the computer on com1 and seems to be 
> sending
> plain text.
>
> So I walked through the Dictionary and set up the following:
>
> I set the serialControlString to:
>
> baud=300 parity=E data=7 stop=1
>
> (Looking at the old DOS program he has, thats what the machine needs)
>
>
> I created a button:
>
> on mouseUp
>   put empty into fld "fehler"
>   open file "COM1:" for read
>   put "opened"&cr into fld "log"
>   read from file "COM1:" until end
>   put "reading done"&cr after fld "log"
>   put the result into fld "Fehler"
>   put it into fld "Ausgabe"
>   close file "COM1:"
>   put "closed"&cr after fld "log"
> end mouseUp
>
> When I hit the button, it instantly reports EOF in fld "fehler".
> How do I tell Revolution to wait until the data is sent by the CNC 
> milling
> machine? Can I set a timeout somehow to wait let´s say for about 2 
> minutes?
>
> Any help is greatly apreciated!
>
> Regards,
>
> Malte




More information about the use-livecode mailing list