I have been successfully using Mach 4 and my computer's embedded serial port for some months now (using the LUARS232 module included with Mach 4). I definitely had some trouble understanding it at the beginning, but now it is a framework for serial communications with my servo drives and works great.
At the recommendation of several members and admins on this forum, I have implemented rigorous error checking and handling throughout all of my scripting. Unfortunately this has been giving me new headaches by... catching errors
I have been able to correct my code to fix all but a handful of errors, mostly thrown by calls to the serial API. Those calls do return error codes to help troubleshoot, however I have been completely unable to find documentation on the RS232 module, either within the Mach 4 documentation or on the greater internet.
For example, I have the line of code:
local err, data_read, size = p:read(4096, 100)
where 4096 is the length of buffer to be read and 100 is the timeout in ms.
This returns the error code "09", but I cannot find ANYTHING to tell me what "09" indicates or how to correct it. I am at a loss.
Any suggestions where to look would be greatly appreciated.
Thanks! - Mike