//將軸參寫入m1x1 slave private void setMotion() { U16 hMode; //初始化給1 且限制在 1~3,這邊又把home mode變成12 or 9 if (axisPara.HomeMode == HomeMode.TwoPoint) { hMode = 12; } else { hMode = 9; } initErr = CCMNet.CS_mnet_m1_set_alm(RingNoOfMNet, axisPara.SlaveIP, Convert.ToUInt16(axisPara.LogicALM), 0); initErr = CCMNet.CS_mnet_m1_set_inp(RingNoOfMNet, axisPara.SlaveIP, 0, Convert.ToUInt16(axisPara.LogicINP)); initErr = CCMNet.CS_mnet_m1_set_erc_on(RingNoOfMNet, axisPara.SlaveIP, 0); initErr = CCMNet.CS_mnet_m1_set_erc(RingNoOfMNet, axisPara.SlaveIP, Convert.ToUInt16(axisPara.LogicERC), 0, 0); initErr = CCMNet.CS_mnet_m1_set_home_config(RingNoOfMNet, axisPara.SlaveIP, hMode, Convert.ToUInt16(axisPara.LogicORG), Convert.ToUInt16(axisPara.LogicZ), 0, 0); initErr = CCMNet.CS_mnet_m1_set_sd(RingNoOfMNet, axisPara.SlaveIP, 0, Convert.ToInt16(axisPara.LogicSD), 0, 0); initErr = CCMNet.CS_mnet_m1_set_ltc_logic(RingNoOfMNet, axisPara.SlaveIP, Convert.ToUInt16(axisPara.LogicLTC)); initErr = CCMNet.CS_mnet_m1_set_feedback_src(RingNoOfMNet, axisPara.SlaveIP, 3); initErr = CCMNet.CS_mnet_m1_set_pls_outmode(RingNoOfMNet, axisPara.SlaveIP, (U16)axisPara.PulseMode); initErr = CCMNet.CS_mnet_m1_set_pls_iptmode(RingNoOfMNet, axisPara.SlaveIP, (U16)axisPara.EncMode, (U16)axisPara.EncDir); initErr = CCMNet.CS_mnet_m1_fix_speed_range(RingNoOfMNet, axisPara.SlaveIP, MmToPulse(axisPara.MaxVel)); }