protected void btnResetNode3_Click(object sender, EventArgs e) { lock (nmt_Master) { nmt_Master.nodeReset(3); } }
public CanOpenStatus startupNode(byte nodeId) { CanOpenStatus ret = CanOpenStatus.CANOPEN_ERROR; this.node_id = nodeId; ret = client_sdo.connect(nodeId); if (ret != CanOpenStatus.CANOPEN_OK) { return(ret); } nmt_mlaster.nodeGuardPollStart(nodeId, 3000); if (ret != CanOpenStatus.CANOPEN_OK) { return(ret); } ret = receive_pdo.setCobid((uint)0x180 + this.node_id); if (ret != CanOpenStatus.CANOPEN_OK) { return(ret); } ret = transmit_pdo.setup((uint)0x200 + this.node_id, this.output_mirror_values, 1); if (ret != CanOpenStatus.CANOPEN_OK) { return(ret); } ret = transmit_pdo.periodicTransmission(true); if (ret != CanOpenStatus.CANOPEN_OK) { return(ret); } ret = nmt_mlaster.nodeReset(node_id); if (ret != CanOpenStatus.CANOPEN_OK) { return(ret); } Thread.Sleep(4000); ret = configureIoInputs(); if (ret != CanOpenStatus.CANOPEN_OK) { return(ret); } ret = configureIoOutputs(); if (ret != CanOpenStatus.CANOPEN_OK) { return(ret); } uint canopenErrorCode; ret = client_sdo.objectWrite(0x100c, 0, (ushort)1000, out canopenErrorCode); if (ret != CanOpenStatus.CANOPEN_OK) { return(ret); } ret = client_sdo.objectWrite(0x100d, 0, (byte)3, out canopenErrorCode); if (ret != CanOpenStatus.CANOPEN_OK) { return(ret); } return(ret); }