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

dave at b-i-s.org dave at b-i-s.org
Wed Sep 17 07:06:01 EDT 2003


Hi Malte,

I'm very new to RR myself, but I've done lots of comms work. Maybe it could be this 
line;

read from file "COM1:" until end

The documentation states;

If you specify any of EOF, end, or empty, the read continues reading until it reaches the 
end of the file. (If you’re reading from a serial port, you must use the form read from 
file portname until empty.)

It could be that using "until end" simply returns an empty rs232 buffer regardless of 
data, whereas "until empty" transfers data out of the buffer until it's....er.....empty.

Hope this little bit helps.

Regards,
Dave.



On 17 Sep 2003 at 12:54, 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
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 





More information about the use-livecode mailing list