2026-06-05 13:44:39 +09:00

143 lines
7.9 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AuroraTriggerBoard.SJTV3
{
// Manual없음. 코드 컨버팅만 실시하자.
partial class SJTTriggerV3
{
public struct TIMECNT
{
public sbyte year;
public sbyte day;
public sbyte month;
public sbyte hour;
public sbyte minute;
public sbyte seconds;
public sbyte reserve1;
public sbyte reserve2;
};
public const string DLL_TIME = "221107"; // used by DLL version
public const int SJT_TRIGSTATUS = 0x0200;
public const int SJT_TRIGPULSEWIDTH = 0x0210;
public const int SJT_LOWCLK_VALUE = 0x0220; //?
public const int SJT_FND_CHANGE = 0x0238;
public const int SJT_TRIGOUT_EN = 0x0240;
public const int SJT_MB_START = 0x0250;
public const int SJT_HW_FW_VER = 0x0000; // read only
public const int SJT_BUILDSTAMP = 0x0001; // read only
public const int SJT_SJTRESET = 0x0002; // write only
public const int SJT_TRIG_GEN_OUT_MODE = 0x0003; // read & write
public const int SJT_MB_DATA_TYPE = 0x0004; // write // read == 0x03 : Type of insert MB data. 0 : ENC / 1 : Position
public const int SJT_FPGA_CALC_CHK = 0x0004; // read only // 0 : FPGA_CALC not Support. / 1912 : Support
public const int SJT_NEXT_REF_VAL = 0x0006; // read only
public const int SJT_REF_FF_STATUS = 0x0007; // read only
public const int SJT_SEQ_IMPROVE_CHK = 0x0009; // read only // 0 or x : Sequnece Gen's Iteration bit is 20, Total Seq num Max 254 / 1912 : Iteration bit become 32, Total Seq num Max 160
public const int SJT_70T_160T_CHK = 0x000A; // read only // 0 or 70 : Kintex7-70T(buffer 16384) / 160 : Kintex7-160T(buffer 65536)
public const int SJT_ENC_DIRECTION = 0x0013; // write & read
public const int SJT_ENC_WHEN_START = 0x001E; // read only 45 bit
public const int SJT_ENC_WHEN_STOP = 0x001F; // read only 45 bit
public const int SJT_TRIG_CNT = 0x0020; // read only 20 : SJT_TOTAL_TRIG_CNT / 21~28 Each Channel Trigger Output
public const int SJT_ERROR_CNT = 0x0029; // read only 29, 2a, 2b, 2c, 2d, 2e, 2f, 30 / Each Channel Error Count
public const int SJT_REF_FF_CHANGE = 0x0102; // read & write
public const int SJT_REF_FF_MATCHING_TYPE = 0x0103; // read & write 0 : Encoder, 1 : Timer 10Mhz
public const int SJT_CUR_MODECNT = 0x0110; // read & write
public const int SJT_CUR_ENCCNT = 0x0111; // read only Real Enc 45 bit
public const int SJT_SIM_ENC_CNT = 0x0112; // read only Simulation Enc 45 bit
public const int SJT_SIM_ENC_CHANGE_FREQ = 0x0113; //
public const int SJT_SIM_ENC_INIT = 0x0114; //
public const int SJT_TRIG_TIMER_FREQ = 0x0115; //
public const int SJT_TRIG_LIMIT_VAL = 0x0116; //
public const int SJT_CUR_POS = 0x0300; // read only Get Current position
public const int SJT_POSENCTABLE_OFF = 0x0301; // write & read only for off, restore 0 when Enc/Pos Error mapping table use
public const int SJT_REFFF_PFULL_THREAD = 0x0307; // write only default : 16380 / 131000
public const int SJT_REFFF_PEMPTY_THREAD = 0x0308; // write only default : 1000
public const int SJT_FPGA_CALC_MODE_SET = 0x0500; // write only //1bit
public const int SJT_FPGA_CALC_START = 0x0501; // write only //45bit
public const int SJT_FPGA_CALC_INTERVAL = 0x0502; // write only //45bit
public const int SJT_FPGA_CALC_ITERATION = 0x0503; // write only //32bit
public const int SJT_FPGA_CALC_WD_SEL = 0x0504; // write only //3bit
public const int SJT_FPGA_CALC_SEQMASK_NUM = 0x0510; // write only //4bit
public const int SJT_FPGA_CALC_WD_SET = 0x0511; // write only //511 ~ 518(8Set), 16bit each
public const int SJT_POS_TABLE_INIT = 0x1000; //0x1C00 //0x1000
public const int SJT_ENC_TABLE_INIT = 0x1100; //0x1D00 //0x1100
public const int SJT_TRIGSET = 0x1300; // 1300 : number of TrigCmdSet , 1301~14FC : TrigCmdSet[0] ~ [253]
public const int SJT_TRIGPOSDIRECT = 0x1200; // 1200 ~ 12FF : Direct Pos input -> MB calculate -> Ref FF
public const int SJT_MASK_SEQ_SET = 0x1500; // 1500~150F 16Bit Mask 8 Sequence 8 set
public const int SJT_STROBESET = 0x2000; // 2000~2016 : Ch0 / 2017~2033 : Ch1 / 2034~2050 : Ch2 / 2051~2067 : Ch3 /......
public const int SJT_REFFIFO_MAX_70T = 16380;
public const int SJT_REFFIFO_MAX_160T = 65530;
// INTERNAL VALUE_SPEC
public const int TRIG_FREQ_MIN = 650; // 6.5 us
public const int TRIG_FREQ_MAX = 650; // 6.5 us
public const int TRIG_PULSEWIDTH_MIN = 1;
public const int TRIG_PULSEWIDTH_MAX = 65535; // us
public const double POS_TABLE_MIN = -9223372036854775.808;// double
public const double POS_TABLE_MAX = 9223372036854775.807; // double
public const double POSITION_MIN = -17592186044.416; // double
public const double POSITION_MAX = 17592186044.415; // double
public const double ENCODER_MIN = -17592186044416; // signed 45 bit -> 0x100000000000
public const double ENCODER_MAX = 17592186044415; // signed 45 bit -> 0x0FFFFFFFFFFF
public const int GENMODE0_ITERATION_MAX = 1048575; // old version iteration max 20bit
public const int BOARD_REF_CLK = 100000000; // 100Mhz
public const int OK_RETURN = 0;
public const int ERR_VAL_TRIG_FREQ = 0x0101;
public const int ERR_VAL_TRIG_PULSEWIDTH = 0x0102;
public const int ERR_VAL_TRIG_TIME_TOOLONG = 0x0103;
public const int ERR_VAL_BURST_DATANUM = 0x1100;
public const int ERR_VAL_POS_ENC_TABLE = 0x1101;
public const int ERR_VAL_TRIGGENMODE = 0x1102;
public const int ERR_VAL_TRIGOUTMODE = 0x1103;
public const int ERR_VAL_TRIGSET_ARRAY = 0x1104;
public const int ERR_OVER_MASKSET_NUMBER = 0x1105;
public const int ERR_OVER_TRIGDIRECT_BUFFER = 0x1106;
public const int ERR_VAL_TRIGDIRECT_ARRAY = 0x1107;
public const int ERR_VAL_TRIGDIRECT_GENMODE = 0x1108;
public const int ERR_VAL_CHANNEL_NUM = 0x1109;
public const int ERR_VAL_ENC_DIRECTION = 0x110A;
public const int ERR_VAL_STROBE_NUM = 0x110B;
public const int ERR_VAL_ENCCNT = 0x110C;
public const int ERR_VAL_ENCSETMAXMIN = 0x110D;
public const int ERR_VAL_SIMULENC = 0x110E;
public const int ERR_VAL_DIRECTMASK = 0x110F;
public const int ERR_NORESPONSE = 0x5100;
public const int ERR_RTN_NOT_OK = 0x5200;
public const int ERR_RTN_CHECKSUM = 0x5300;
public const int ERR_TRIG_ERR_OCCURED = 0x6000;
public const int ERR_NOT_DEVELOPED_YET = 0x9999;
public const int DATA_WR_TYPE_BIN_WRITE = 0;
public const int DATA_WR_TYPE_DEC_WRITE = 1;
public const int DATA_WR_TYPE_HEX_WRITE = 2;
}
}