aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Scripting/OnExecuteParameters.cs
blob: c87355e6b1e8f973c6fa544365fed869451eb436 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tango.Scripting
{
    /// <summary>
    /// Represents a base class for a global object which will be embedded in the scripting engine.
    /// </summary>
    public abstract class OnExecuteParameters
    {

    }
}
String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
using System;
using System.Text;
using System.Linq;
using System.Drawing;
using System.Diagnostics;
using System.Windows.Forms;
using System.Threading;
using System.Threading.Tasks;
using System.Collections.Generic;
using Tango.PMR.Stubs;
using Tango.Stubs;

const Int32 x_GET_STATUS    = 0xD0;
const Int32 x_ABS_POS    = 0x01;
const Int32 x_EL_POS     = 0x02;
const Int32 x_MARK       = 0x03;
const Int32 x_SPEED      = 0x04;
const Int32 x_ACC        = 0x05;
const Int32 x_DEC        = 0x06;
const Int32 x_MAX_SPEED  = 0x07;
const Int32 x_MIN_SPEED  = 0x08;
const Int32 x_FS_SPD     = 0x15;
const Int32 x_KVAL_HOLD  = 0x09;
const Int32 x_KVAL_RUN   = 0x0A;
const Int32 x_KVAL_ACC   = 0x0B;
const Int32 x_KVAL_DEC   = 0x0C;
const Int32 x_INT_SPD    = 0x0D;
const Int32 x_ST_SLP     = 0x0E;
const Int32 x_FN_SLP_ACC = 0x0F;
const Int32 x_FN_SLP_DEC = 0x10;
const Int32 x_K_THERM    = 0x11;
const Int32 x_ADC_OUT    = 0x12;
const Int32 x_OCD_TH     = 0x13;
const Int32 x_STALL_TH   = 0x14;
const Int32 x_STEP_MODE  = 0x16;
const Int32 x_ALARM_EN   = 0x17;
const Int32 x_CONFIG     = 0x18;
const Int32 x_STATUS     = 0x19;
//-------------------------------
const Int32 x_GET_PARAM  = 0x20;
const Int32 x_SET_PARAM  = 0x00;


public void OnExecute(StubManager stubManager)
{

	Uint32 SpeedSet1 = 0x7000062;
	Uint32 SpeedSet2 = 0x7000053;
	Uint32 Move1 = 0x4000026c;
	Uint32 MoveFor = 0x400007D0;
	Uint32 MoveBack = 0x410007D0;
	var response = stubManager.Run<StubMotorResponse>("StubMotorRequest" ,14, SpeedSet1, 0, 0);
	response = stubManager.Run<StubMotorResponse>("StubMotorRequest" ,14, (x_GET_STATUS)<<16, 0, 0);
		stubManager.WriteHex(response.RecivedData,4);
		stubManager.Write("\n\n");

	 response = stubManager.Run<StubMotorResponse>("StubMotorRequest" ,14, Move1, 0, 0);
	response = stubManager.Run<StubMotorResponse>("StubMotorRequest" ,14, (x_GET_STATUS)<<16, 0, 0);
		stubManager.WriteHex(response.RecivedData,4);
		stubManager.Write("\n\n");
	 response = stubManager.Run<StubMotorResponse>("StubMotorRequest" ,14, MoveFor, 0, 0);
	response = stubManager.Run<StubMotorResponse>("StubMotorRequest" ,14, (x_GET_STATUS)<<16, 0, 0);
		stubManager.WriteHex(response.RecivedData,4);
		stubManager.Write("\n\n");
	 response = stubManager.Run<StubMotorResponse>("StubMotorRequest" ,14, SpeedSet2, 0, 0);
	response = stubManager.Run<StubMotorResponse>("StubMotorRequest" ,14, (x_GET_STATUS)<<16, 0, 0);
		stubManager.WriteHex(response.RecivedData,4);
		stubManager.Write("\n\n");
	 response = stubManager.Run<StubMotorResponse>("StubMotorRequest" ,14, MoveBack, 0, 0);
	response = stubManager.Run<StubMotorResponse>("StubMotorRequest" ,14, (x_GET_STATUS)<<16, 0, 0);
		stubManager.WriteHex(response.RecivedData,4);
		stubManager.Write("\n\n");


		
		
	// Request ----
// UInt32 : MotorID
// Boolean : ClearStatus

// Response ----
// UInt32 : MotorID
// Boolean : SCKMOD
// Boolean : STEPLOSSB
// Boolean : STEPLOSSA
// Boolean : OCD
// Boolean : THSD
// Boolean : THWRN
// Boolean : UVLO
// Boolean : WRONGCMD
// Boolean : NOTPERFCMD
// UInt32 : MOTSTATUS
// Boolean : DIR
// Boolean : SWEVN
// Boolean : SWF
// Boolean : BUSY
// Boolean : HiZ
//response = stubManager.Run<StubMotorStatusResponse>("StubMotorStatusRequest" ,12, true);
}