171
Mach4 General Discussion / Re: Servo spindle stops briefly - How do I diagnose problem?
« on: May 16, 2019, 10:55:59 AM »
I'm pretty sure the DMM DYN4 has a software setting for max acceleration which should do the same thing.
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.
rs232 = require("luars232")
port_name = "COM1"
local out = io.stderr
---------------------------------------------------------------
-- Initialize Communications --
---------------------------------------------------------------
--Open Serial Port 8N1 38400 baud
local e, p = rs232.open(port_name)
if e ~= rs232.RS232_ERR_NOERROR then
mc.mcCntlSetLastError(inst, "Cannot Open Serial Port")
return
end
-- set port settings
assert(p:set_baud_rate(rs232.RS232_BAUD_38400) == rs232.RS232_ERR_NOERROR)
assert(p:set_data_bits(rs232.RS232_DATA_8) == rs232.RS232_ERR_NOERROR)
assert(p:set_parity(rs232.RS232_PARITY_NONE) == rs232.RS232_ERR_NOERROR)
assert(p:set_stop_bits(rs232.RS232_STOP_1) == rs232.RS232_ERR_NOERROR)
assert(p:set_flow_control(rs232.RS232_FLOW_OFF) == rs232.RS232_ERR_NOERROR)
err, len_written = p:write(string, timeout)
err, data_read, size = p:read(read_length, timeout)