InovanceMotionCard.cs 243 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using TeamAAS.Motion.Events;
  7. using TeamAAS.Motion.Interfaces;
  8. using static TeamAAS.Motion.Events.CardAxisEventArgs;
  9. using TeamAAS.Motion.Models;
  10. using System.Runtime.InteropServices;
  11. namespace TeamAAS.Motion.Motions
  12. {
  13. /// <summary>
  14. /// 汇川IMC60运动控制卡
  15. /// </summary>
  16. public class InovanceMotionCard : IMotionControl
  17. {
  18. private readonly MotionDeviceConfig _cfg;
  19. private readonly int _maxAxisCount;
  20. private bool _isConnected = false;
  21. private readonly object _lock = new object();
  22. public string CardName => _cfg.Name;
  23. public bool IsConnected { get; private set; }
  24. public int MaxAxisCount => _cfg.AxisCount;
  25. public event EventHandler<ConnectionStateChangedEventArgs> ConnectionStateChanged;
  26. public event EventHandler<ErrorOccurredEventArgs> ErrorOccurred;
  27. public InovanceMotionCard(MotionDeviceConfig cfg)
  28. {
  29. _cfg = cfg ?? new MotionDeviceConfig();
  30. short nCardNum = 0;
  31. // ret = Imc60.IMC_GetCardsNum(ref nCardNum, pCardIndex);
  32. }
  33. public bool Connect(string connectionString)
  34. {
  35. uint ret = Imc60.IMC_OpenCard(Convert.ToInt16( connectionString));//根据卡号开卡,默认是从0开始,在PC端分配板卡资源
  36. return false;
  37. }
  38. public void Disconnect()
  39. {
  40. throw new NotImplementedException();
  41. }
  42. public void EmergencyStop()
  43. {
  44. throw new NotImplementedException();
  45. }
  46. public IList<IAxis> GetAxes()
  47. {
  48. throw new NotImplementedException();
  49. }
  50. public IAxis GetAxis(int axisNo)
  51. {
  52. throw new NotImplementedException();
  53. }
  54. public void MoveArc(double[] centerPoint, double[] targetPositions, double velocity)
  55. {
  56. throw new NotImplementedException();
  57. }
  58. public void MoveLinear(double[] targetPositions, double velocity)
  59. {
  60. throw new NotImplementedException();
  61. }
  62. public bool ReadDI(int portIndex)
  63. {
  64. throw new NotImplementedException();
  65. }
  66. public void WriteDO(int portIndex, bool value)
  67. {
  68. throw new NotImplementedException();
  69. }
  70. }
  71. public class Imc60
  72. {
  73. #region STATIC
  74. public const string Imc60ApiDllName = "IMC_Library_x64.dll";
  75. #endregion
  76. #region FUNCTION RETURN DEFINE
  77. public const uint EXE_SUCCESS = 0x00000000;
  78. public const uint ERR_HANDLE = 0xFFFFFFFF;
  79. #endregion
  80. /// @brief 主站信息结构体
  81. [StructLayout(LayoutKind.Sequential)]
  82. public struct TMasterInfo
  83. {
  84. public UInt32 cycleTime; // 规划周期
  85. public Int16 sysHwCfg; // 系统类型: 0: Ecat+端子板, 1 Ecat, 2: 端子板
  86. public Int16 aliasMode; // 别名模式: 0 未开启, 1 开启
  87. public Int16 pdoLen; // pdo总长度
  88. public Int16 slaveCnt; // 从站个数
  89. public Int16 axisCnt; // 轴个数
  90. public Int16 dioModuleCnt; // dio模块个数
  91. public Int16 aioModuleCnt; // aio模块个数
  92. public Int16 regModuleCnt; // reg模块个数
  93. public Int16 diCnt; // di数量
  94. public Int16 doCnt; // do数量
  95. public Int16 aiCnt; // ai,AD数量
  96. public Int16 aoCnt; // ao, DA数量
  97. public Int16 regInCnt; // reg输入数量
  98. public Int16 regOutCnt; // reg输出数量
  99. public Int16 encCnt; // enc通道数量
  100. public Int16 align;
  101. };
  102. /// @brief 从站信息结构体
  103. [StructLayout(LayoutKind.Sequential)]
  104. public struct TSlaveInfo
  105. {
  106. public Int16 devType; // 设备类型
  107. public UInt32 vendorId; // 设备ID
  108. public UInt32 productCode; // 产品编码
  109. public UInt32 revisionNo; // 版本号
  110. public Int16 axChn; // 从站起始通道号
  111. public Int16 axisCnt; // 当前从站轴数
  112. public Int16 actStation; // 当前从站对应的实际站号
  113. public UInt32 aliasNo; // 别名
  114. public UInt32 align;
  115. };
  116. /// @brief PdoEntry结构体
  117. [StructLayout(LayoutKind.Sequential)]
  118. public struct TPdoEntry
  119. {
  120. public UInt16 Index; // 索引
  121. public Byte SubIndex; // 子索引
  122. public Byte DevType; // entry类型
  123. public Int16 BitOfs; // 位偏移
  124. public UInt32 BitLen; // 位长度
  125. };
  126. /// @brief 回零参数结构体
  127. [StructLayout(LayoutKind.Sequential)]
  128. public struct THomingPara
  129. {
  130. public Int16 homeMethod; // 回原点方法
  131. public UInt32 highVel; // 高速搜索减速点速度 pulse/s
  132. public UInt32 lowVel; // 搜索原点低 pulse/s
  133. public UInt32 acc; // 加速度 pulse/s^2
  134. public Int32 offset; // 回原点后的零点偏执 pulse
  135. };
  136. /// @brief 多维位置比较数据结构体
  137. [StructLayout(LayoutKind.Sequential)]
  138. public struct TMultiCmpData
  139. {
  140. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
  141. public Int32[] compareData; // 比较的位置
  142. };
  143. /// @brief 规划运动限制参数结构体
  144. [StructLayout(LayoutKind.Sequential)]
  145. public struct TMtPara
  146. {
  147. public double bgVel; // 起始速度值 unit/s
  148. public double maxVel; // 最大速度 unit/s
  149. public double maxAcc; // 最大加速度 unit/s^2
  150. public double maxDec; // 最大减速度 unit/s^2
  151. public double maxJerk; // 最大加加速度 unit/s^3
  152. public double stopDec; // 平滑停止减速度 unit/s^2
  153. public double eStopDec; // 急停减速度 unit/s^2
  154. };
  155. /// @brief 轴属性配置结构体
  156. [StructLayout(LayoutKind.Sequential)]
  157. public struct TAxAttriPara
  158. {
  159. public Int16 arrivalBand; // 到位误差 pulse
  160. public UInt16 arrivalTime; // 到位保持时间 周期
  161. public Int32 errorLmt; // 最大跟随误差 pulse
  162. public Int32 softPosLimitPos; // 软正限位 pulse
  163. public Int32 softNegLimitPos; // 软负限位 pulse
  164. };
  165. /// @brief 轴安全检查配置结构体
  166. [StructLayout(LayoutKind.Sequential)]
  167. public struct TAxCheckEn
  168. {
  169. public Int16 alarmEn; // 报警是否有效标志
  170. public Int16 softLmtEn; // 软限位是否有效标志
  171. public Int16 hwLmtEn; // 硬限位是否有效标志
  172. public Int16 errorLmtEn; // 跟随误差是否检查标志
  173. };
  174. /// @brief 插补高级参数结构体
  175. [StructLayout(LayoutKind.Sequential)]
  176. public struct TCrdAdvParam
  177. {
  178. public Int16 userVelMode; // 用户速度规划模式: 0 系统前瞻速度规划, 1 用户设定速度规划(默认: 0)
  179. public Int16 transMode; // 过渡模式 0: 无过渡 1: 圆弧过渡 (默认:1)
  180. public Int16 noDataProtect; // 数据断流保护: 0不保护, 1保护 (默认: 1)
  181. public Int16 circAccChangeEn; // 圆弧变加速使能: 0不变加速, 1变加速 (默认: 0)
  182. public Int16 noCoplaneCircOptm; // 异面圆弧优化: 0不开启, 1开启
  183. public double turnCoef; // 拐弯系数:[0.01,100](默认:1.0)
  184. public double tol; // 插补精度:[0,1e9](默认:0 , 单位取决于设置的当量)
  185. };
  186. /// @brief 电子齿轮参数结构体
  187. [StructLayout(LayoutKind.Sequential)]
  188. public struct TGearParam
  189. {
  190. public Int32 masterScale; // 主轴齿数: (0,intMax]
  191. public Int32 slaveScale; // 从轴齿数: [intMin,0) || (0,intMax]
  192. public Int16 masterNo; // 主轴轴号: [0,63]
  193. public Int16 masterType; // 主轴类型: 0 轴规划, 1 轴编码器, 10 端子板编码器, 11 EtherCAT编码器
  194. public Int16 dirMode; // 方向模式: 0 跟随方向不限制, 1 正向绝对位置跟随, 2 负向绝对位置跟随, 3 正向相对位置跟随, 4 负向相对位置跟随
  195. public Int32 masterSlopeDis; // 主轴离合区:[0,intMax], 0表示没有加速过程,直接跟随
  196. };
  197. /// @brief 表补偿参数结构体
  198. public struct TTableCompParam
  199. {
  200. public Int16 tableId; // 表索引:[0,0]
  201. public Int16 dimension; // 补偿维数:{1,2,3}
  202. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
  203. public Int16[] srcAxNo; // 参考轴号:[0,63],数组有效的元素与补偿维数有关,如补偿维数=1,仅用到srcAxNo[0], 下同
  204. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
  205. public Int16[] srcType; // 参考轴类型:0 轴规划, 1 轴编码器
  206. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
  207. public Int32[] startPos; // 补偿起始位置:[intMin,intMax]
  208. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
  209. public Int32[] count; // 补偿点个数:[2,40000] (有效的元素的乘积不得超过40000,且各不小于2)
  210. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
  211. public Int32[] step; // 补偿间隔:[1,intMax]
  212. };
  213. /// @brief 采样配置参数结构体
  214. [StructLayout(LayoutKind.Sequential)]
  215. public struct TSamplePara
  216. {
  217. public Int16 interval; // 采样时间间隔
  218. public Int16 trigType; // 触发采样类型: 0 立即 1 延时 2 本地di 3 ECAT di
  219. public Int16 delay; // 延时时间 单位:周期
  220. public Int16 diNo; // di输入号
  221. public Int16 diLevel; // di的触发输入值 0或1
  222. };
  223. /// @brief 事件配置参数结构体
  224. ///
  225. #region Event
  226. [StructLayout(LayoutKind.Sequential)]
  227. public struct TEvent
  228. {
  229. public Int16 type; //事件类型
  230. public Int16 index; //事件变量索引
  231. public UInt32 loop; //事件最大允许触发次数
  232. public double value; //设置比较值
  233. public Int16 condition; //事件条件
  234. };
  235. [StructLayout(LayoutKind.Sequential)]
  236. public struct TTaskCrdStart
  237. {
  238. public Int16 crdNo;
  239. };
  240. [StructLayout(LayoutKind.Sequential)]
  241. public struct TTaskStartPtp
  242. {
  243. public Int16 axNo;
  244. public Int16 posType;
  245. public double tgtPos;
  246. };
  247. [StructLayout(LayoutKind.Sequential)]
  248. public struct TTaskStartJog
  249. {
  250. public Int16 axNo;
  251. public double tgtVel;
  252. };
  253. [StructLayout(LayoutKind.Sequential)]
  254. public struct TTaskStartGear
  255. {
  256. public Int16 axNo;
  257. };
  258. [StructLayout(LayoutKind.Sequential)]
  259. public struct TTaskStartPt
  260. {
  261. public Int16 sysNo;
  262. };
  263. [StructLayout(LayoutKind.Sequential)]
  264. public struct TTaskStartPvt
  265. {
  266. public Int16 axNum;
  267. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
  268. public Int16[] axArray;
  269. };
  270. [StructLayout(LayoutKind.Sequential)]
  271. public struct TTaskUpdatePtpMvPara
  272. {
  273. public Int16 axNo;
  274. public double tgtVel;
  275. public double tgtAcc;
  276. public double tgtDec;
  277. };
  278. [StructLayout(LayoutKind.Sequential)]
  279. public struct TTaskUpdateJogMvPara
  280. {
  281. public Int16 axNo;
  282. public double tgtVel;
  283. public double tgtAcc;
  284. public double tgtDec;
  285. };
  286. [StructLayout(LayoutKind.Sequential)]
  287. public struct TTaskUpdatePtpTgtPos
  288. {
  289. public Int16 axNo;
  290. public double tgtPos;
  291. };
  292. [StructLayout(LayoutKind.Sequential)]
  293. public struct TTaskSetEcatDoBit
  294. {
  295. public Int16 doNo;
  296. public Int16 value;
  297. };
  298. [StructLayout(LayoutKind.Sequential)]
  299. public struct TTaskSetEcatGrpDo
  300. {
  301. public Int16 groupNo;
  302. public Int16 value;
  303. };
  304. [StructLayout(LayoutKind.Sequential)]
  305. public struct TTaskSetEcatDoBitInverse
  306. {
  307. public Int16 doIndex;
  308. public Int16 value;
  309. public Int16 inverseTime;
  310. };
  311. [StructLayout(LayoutKind.Sequential)]
  312. public struct TTaskSetEcatDaVal
  313. {
  314. public Int16 daIndex;
  315. public Int16 value;
  316. };
  317. [StructLayout(LayoutKind.Sequential)]
  318. public struct TTaskStopMove
  319. {
  320. public Int16 axNo;
  321. public Int16 stopType;
  322. };
  323. [StructLayout(LayoutKind.Sequential)]
  324. public struct TTaskPulseDo
  325. {
  326. public Int16 taskPulseDoIndex;
  327. public Int16 firstLevel;
  328. public Int32 highLevelTime;
  329. public Int32 lowLevelTime;
  330. public Int16 pulseNum;
  331. };
  332. [StructLayout(LayoutKind.Sequential)]
  333. public struct UTask
  334. {
  335. public TTaskCrdStart taskCrdStart;
  336. public TTaskStartPtp taskStartPtp;
  337. public TTaskStartJog taskStartJog;
  338. public TTaskStartGear taskStartGear;
  339. public TTaskStartPt taskStartPt;
  340. public TTaskStartPvt taskStartPvt;
  341. public TTaskUpdatePtpMvPara taskUpdatePtpMvPara;
  342. public TTaskUpdateJogMvPara taskUpdateJogMvPara;
  343. public TTaskSetEcatDoBit taskSetEcatDoBit;
  344. public TTaskSetEcatGrpDo taskSetEcatGrpDo;
  345. public TTaskSetEcatDoBitInverse taskSetEcatDoBitInverse;
  346. public TTaskSetEcatDaVal taskSetEcatDaVal;
  347. public TTaskUpdatePtpTgtPos taskUpdatePtpTgtPos;
  348. public TTaskPulseDo taskPulseDo;
  349. public TTaskStopMove taskStopMove;
  350. };
  351. #endregion
  352. /// @defgroup EcatDef EtherCAT相关宏定义
  353. /// @brief EtherCAT相关宏定义
  354. #region
  355. /// @defgroup MasterSts 主站状态码
  356. /// @brief 板卡ECAT主站状态定义
  357. #region
  358. public const uint EC_MASTER_IDLE = (0); ///< EtherCat主站尚未初始化
  359. public const uint EC_MASTER_INIT = (1); ///< EtherCat主站初始化
  360. public const uint EC_MASTER_SCAN_SLAVE = (2); ///< EtherCat主站正在扫描从站设备
  361. public const uint EC_MASTER_SCAN_SLAVE_END = (3); ///< EtherCat主站扫描从站设备结束
  362. public const uint EC_MASTER_SCAN_MODULES = (4); ///< EtherCat主站正在扫描从站设备MODULES
  363. public const uint EC_MASTER_SCAN_MODULES_END = (5); ///< EtherCat主站扫描从站设备MODULES结束
  364. public const uint EC_MASTER_OP = (6); ///< EtherCat主站进入OP状态
  365. public const uint EC_MASTER_ERR = (7); ///< EtherCat主站链路状态有错误
  366. #endregion
  367. /// @defgroup SlaveSts 从站状态码
  368. /// @brief 板卡EtherCAT从站状态定义
  369. #region
  370. public const uint EC_SLAVE_STATE_UNKNOWN = (0x00); ///< EtherCat从站在未知状态
  371. public const uint EC_SLAVE_STATE_INIT = (0x01); ///< EtherCat从站在初始状态
  372. public const uint EC_SLAVE_STATE_PREOP = (0x02); ///< EtherCat从站在PREOP状态
  373. public const uint EC_SLAVE_STATE_BOOT = (0x03); ///< EtherCat从站在BOOT状态
  374. public const uint EC_SLAVE_STATE_SAFEOP = (0x04); ///< EtherCat从站在SAVEOP状态
  375. public const uint EC_SLAVE_STATE_OP = (0x08); ///< EtherCat从站在OP状态
  376. public const uint EC_SLAVE_STATE_ACK_ERR = (0x10); ///< EtherCat从站有错误
  377. #endregion
  378. /// @defgroup EcatError 协议栈错误码
  379. /// @brief 协议栈错误码EcatErrorCode定义
  380. #region
  381. public const uint ERROR_CODE_NO_SUCH_SLAVE = (0x0003); ///< 配置阶段, 没有这个从站, 处理方法: 检查从站是否掉线, 重新扫描配置
  382. public const uint ERROR_CODE_INVALID_PDO = (0x0004); ///< 配置阶段, 非法PDO, 处理方法: 检查从站厂家是否更新xml配置文件, 与汇川默认配置不一致
  383. public const uint ERROR_CODE_INVALID_SDO = (0x0005); ///< 配置阶段, 非法SDO, 处理方法: 检查从站厂家是否更新xml配置文件, 与汇川默认配置不一致
  384. public const uint ERROR_CODE_INVALID_ENTRY = (0x0006); ///< 配置阶段, 非法ENTRY, 处理方法: 检查从站厂家是否更新xml配置文件, 与汇川默认配置不一致
  385. public const uint ERROR_CODE_PASECFGFAIL = (0x000D); ///< 解析XML设备配置失败, 处理方法: 设备配置文件已经被破坏, 重新扫描配置
  386. public const uint ERROR_CODE_CFGREGISTFAIL = (0x0015); ///< 配置reg失败, 处理方法: 检查从站厂家是否更新xml配置文件, 与汇川默认配置不一致
  387. public const uint ERROR_CODE_CFGDIFFONLINE = (0x0016); ///< 在线从站与配置不一致, 处理方法: 检查从站是否掉线, 重新扫描配置
  388. public const uint ERROR_CODE_AXIS_NUM_BEYOND = (0x0017); ///< 轴配置数量超过板卡最大支持轴数;
  389. public const uint ERROR_CODE_SLAVE_OFFLINE = (0x001a); ///< 从站掉线错误, 高8位为从站号, 即bit[15:8]-轴号, 处理方法: 检查从高8位数字开始从站是否掉线, 或者重新扫描配置
  390. public const uint ERROR_CODE_SDOBF_NONECAT = (0x001b); ///< SDO缓冲区收到非ECAT帧错误, 处理方法: 检查线路是否接错, 是否有其他非Ethercat设备接入
  391. public const uint ERROR_CODE_PORT0_NOTLINK = (0x001c); ///< 端口未接ECAT设备错误, 处理方法: 检查板卡端线路是否正常接线, 是否接线不可靠
  392. public const uint ERROR_CODE_SET_CYCLETIME_PARA_ERR = (0x001e); ///< 设置周期时间参数错误, 处理方法: 错误的DC时钟配置, 只支持125us, 250us, 500us, 125us, 1000us, 2000us, 4000us, 8000us周期
  393. public const uint ERROR_CODE_COE_SDO_INIT_ERR = (0x001f); ///< 在初始化阶段coe配置错误, 处理方法: 检查从站厂家是否更新xml配置文件, 与汇川默认配置不一致; 或者可能例如RTU模块配置错误
  394. public const uint ERROR_CODE_SLAVE_STATE_ERR = (0x0020); ///< 从站状态错误, 高8位为轴号, 即bit[15:8]-轴号, 处理方法: 检查从高8位数字从站状态, 检查从站设备异常原因
  395. public const uint ERROR_CODE_SLAVE_SII_ERR = (0x0037); ///< E2ROM 信息有误, 处理方法: 一般为从站保存的e2rom信息有误, 可以使用twincat确认并联系厂家
  396. public const uint ERROR_CODE_SLAVE_NUM_BEYOND = (0x003b); ///< 从站在线超过最大64个站
  397. #endregion
  398. /// @defgroup AbortCode SDO访问舍弃码
  399. /// @brief 以下宏定义针对IIMC_GetEcatSdo, IMC_SetEcatSdo函数
  400. #region
  401. public const uint ABORT_CODE1 = (0x05030000); ///< 从站Toggle bit 没有变化
  402. public const uint ABORT_CODE2 = (0x05040000); ///< SDO 访问超时
  403. public const uint ABORT_CODE3 = (0x05040001); ///< 客户端/服务器 命令非法或未知
  404. public const uint ABORT_CODE4 = (0x05040005); ///< 内存溢出
  405. public const uint ABORT_CODE5 = (0x06010000); ///< 不支持访问该对象
  406. public const uint ABORT_CODE6 = (0x06010001); ///< 尝试去读一个只写对象
  407. public const uint ABORT_CODE7 = (0x06010002); ///< 尝试去写一个只读对象
  408. public const uint ABORT_CODE8 = (0x06020000); ///< 对象字典中不存在该对象
  409. public const uint ABORT_CODE9 = (0x06040041); ///< 该对象不能映射成PDO
  410. public const uint ABORT_CODE10 = (0x06040042); ///< 对象映射成PDO超出 PDO长度
  411. public const uint ABORT_CODE11 = (0x06040043); ///< 通用参数非法
  412. public const uint ABORT_CODE12 = (0x06040047); ///< 设备内不兼容
  413. public const uint ABORT_CODE13 = (0x06060000); ///< 由于硬件原因访问失败
  414. public const uint ABORT_CODE14 = (0x06070010); ///< 数据类型不匹配, 长度参数
  415. public const uint ABORT_CODE15 = (0x06070012); ///< 数据类型不匹配, 长度太大
  416. public const uint ABORT_CODE16 = (0x06070013); ///< 数据类型不匹配, 长度太小
  417. public const uint ABORT_CODE17 = (0x06090011); ///< 该对象子索引不存在
  418. public const uint ABORT_CODE18 = (0x06090030); ///< 参数超出范围
  419. public const uint ABORT_CODE19 = (0x06090031); ///< 参数超出范围太大
  420. public const uint ABORT_CODE20 = (0x06090032); ///< 参数超出范围太小
  421. public const uint ABORT_CODE21 = (0x06090036); ///< 最大值小于最小值
  422. public const uint ABORT_CODE22 = (0x08000000); ///< 一般错误
  423. public const uint ABORT_CODE23 = (0x08000020); ///< 数据不能被传输或被保存
  424. public const uint ABORT_CODE24 = (0x08000021); ///< 数据不能被传输或被保存由于本地控制
  425. public const uint ABORT_CODE25 = (0x08000022); ///< 数据不能被传输或被保存由于当前状态
  426. public const uint ABORT_CODE26 = (0x08000023); ///< 缺乏对象字典或者对象字典创建失败
  427. #endregion
  428. /// @defgroup ServoOpMode 伺服操作模式定义
  429. /// @brief 定义了伺服402协议中的控制模式
  430. #region
  431. public const Int16 TQ_OP_MODE = (4); ///< TQ模式
  432. public const Int16 HM_OP_MODE = (6); ///< 回零模式
  433. public const Int16 CSP_OP_MODE = (8); ///< CSP模式
  434. public const Int16 CSV_OP_MODE = (9); ///< CSV模式
  435. public const Int16 CST_OP_MODE = (10); ///< CST模式
  436. #endregion
  437. /// @defgroup EcatHomingMethod 402回零方法定义
  438. /// @brief 定义了伺服402回零模式的回零方法类型
  439. #region
  440. public const uint HOME_NLIMT_ZINDEX = (1); ///< 负限位+Z信号
  441. public const uint HOME_PLIMT_ZINDEX = (2); ///< 正限位+Z信号
  442. public const uint HOME_PHOME_FEDGE_ZINDEX = (3); ///< 正原点开关下降沿+Z信号
  443. public const uint HOME_PHOME_REDGE_ZINDEX = (4); ///< 正原点开关上升沿+Z信号
  444. public const uint HOME_NHOME_FEDGE_ZINDEX = (5); ///< 负原点开关下降沿+Z信号
  445. public const uint HOME_NHOME_REDGE_ZINDEX = (6); ///< 负原点开关上升沿+Z信号
  446. public const uint HOME_PLIMT_PHOME_FEDGE_ZINDEX = (7); ///< 正限位+正原点开关下降沿+Z信号
  447. public const uint HOME_PLIMT_PHOME_REDGE_ZINDEX = (8); ///< 正限位+正原点开关上升沿+Z信号
  448. public const uint HOME_PLIMT_NHOME_REDGE_ZINDEX = (9); ///< 正限位+负原点开关上升沿+Z信号
  449. public const uint HOME_PLIMT_NHOME_FEDGE_ZINDEX = (10); ///< 正限位+负原点开关下降沿+Z信号
  450. public const uint HOME_NLIMT_NHOME_FEDGE_ZINDEX = (11); ///< 负限位+负原点开关下降沿+Z信号
  451. public const uint HOME_NLIMT_NHOME_REDGE_ZINDEX = (12); ///< 负限位+负原点开关上升沿+Z信号
  452. public const uint HOME_NLIMT_PHOME_REDGE_ZINDEX = (13); ///< 负限位+正原点开关上升沿+Z信号
  453. public const uint HOME_NLIMT_PHOME_FEDGE_ZINDEX = (14); ///< 负限位+正原点开关下降沿+Z信号
  454. public const uint HOME_NLIMT = (17); ///< 负限位
  455. public const uint HOME_PLIMT = (18); ///< 正限位
  456. public const uint HOME_PHOME_FEDGE = (19); ///< 正原点开关下降沿
  457. public const uint HOME_PHOME_REDGE = (20); ///< 正原点开关上升沿
  458. public const uint HOME_NHOME_FEDGE = (21); ///< 负原点开关下降沿
  459. public const uint HOME_NHOME_REDGE = (22); ///< 负原点开关上升沿
  460. public const uint HOME_PLIMT_PHOME_FEDGE = (23); ///< 正限位+正原点开关下降沿
  461. public const uint HOME_PLIMT_PHOME_REDGE = (24); ///< 正限位+正原点开关上升沿
  462. public const uint HOME_PLIMT_NHOME_REDGE = (25); ///< 正限位+负原点开关上升沿
  463. public const uint HOME_PLIMT_NHOME_FEDGE = (26); ///< 正限位+负原点开关下降沿
  464. public const uint HOME_NLIMT_NHOME_FEDGE = (27); ///< 负限位+负原点开关下降沿
  465. public const uint HOME_NLIMT_NHOME_REDGE = (28); ///< 负限位+负原点开关上升沿
  466. public const uint HOME_NLIMT_PHOME_REDGE = (29); ///< 负限位+正原点开关上升沿
  467. public const uint HOME_NLIMT_PHOME_FEDGE = (30); ///< 负限位+正原点开关下降沿
  468. public const uint HOME_NEGZINDEX = (33); ///< 负向Z信号
  469. public const uint HOME_POSZINDEX = (34); ///< 正向Z信号
  470. public const uint HOME_CURRENT_POS = (35); ///< 当前位置
  471. #endregion
  472. /// @defgroup EcatHomingSts 402回零状态定义
  473. /// @brief 定义了伺服402回零模式下的工作状态
  474. #region
  475. public const Int16 HOME_IN_PROGRESS = (0); ///< 正在回零中
  476. public const Int16 HOME_INTERRUPTED_OR_NOT_START = (1); ///< 回零中断或者没有开始启动
  477. public const Int16 HOME_ATTAINED_BUT_NOT_REACH = (2); ///< 回零结束, 但没有到设定的目标位置
  478. public const Int16 HOME_SUCESS = (3); ///< 回零成功
  479. public const Int16 HOME_ERR_VEL_NOT_ZERO = (4); ///< 回零中发生错误, 同时速度不为0
  480. public const Int16 HOME_ERR_VEL_ZERO = (5); ///< 回零中发生错误, 同时速度为0
  481. #endregion
  482. /// @defgroup CSPHomingMethod CSP回零方法定义
  483. /// @brief 定义了板卡CSP回零模式的回零方法
  484. #region
  485. public const Int32 HOMING_ECAT_CSP_METHOD_NONE = (-1); ///< 非回零模式
  486. public const Int32 HOMING_ECAT_CSP_METHOD_DI = (0); ///< DI回零方式
  487. public const Int32 HOMING_ECAT_CSP_METHOD_INDEX = (1); ///< Index回零方式
  488. public const Int32 HOMING_ECAT_CSP_METHOD_LIMIT_INDEX = (2); ///< 限位+Index回零方式
  489. public const Int32 HOMING_ECAT_CSP_METHOD_LIMIT_DI = (3); ///< 限位+Di回零方式
  490. #endregion
  491. /// @defgroup CSPHomingSts CSP回零状态定义
  492. /// @brief 定义了板卡CSP回零模式下的工作状态
  493. #region
  494. public const Int16 HOME_CSP_STS_RUNING = (0x01); ///< CSP回零中
  495. public const Int16 HOME_CSP_STS_STOPPING = (0x02); ///< CSP回零停止中
  496. public const Int16 HOME_CSP_STS_STOPPED = (0x03); ///< CSP回零已停止
  497. public const Int16 HOME_CSP_STS_FINISH = (0x04); ///< CSP回零已完成
  498. public const Int16 HOME_CSP_STS_ERROR = (0x05); ///< CSP回零错误
  499. #endregion
  500. #endregion
  501. /// @defgroup CardSysDef 板卡系统相关宏定义
  502. #region
  503. /// @defgroup CardResType 资源类型宏定义
  504. /// @brief 以下宏定义针对IMC_GetResCount函数
  505. #region
  506. public const uint MC_ECAT_DO = (0); ///< ecat的通用do
  507. public const uint MC_LOCAL_DO = (1); ///< localBus的通用do
  508. public const uint MC_ECAT_DI = (11); ///< ecat的通用DI
  509. public const uint MC_ECAT_AD = (12); ///< ecat的通用AD
  510. public const uint MC_ECAT_DA = (13); ///< ecat的通用DA
  511. public const uint MC_ECAT_AXIS = (15); ///< ecat的通用AXIS
  512. public const uint MC_ECAT_REG_IN = (16); ///< ecat的通用RegIn
  513. public const uint MC_ECAT_REG_OUT = (17); ///< ecat的通用RegOut
  514. public const uint MC_ECAT_ENC = (18); ///< ecat的通用RegOut
  515. public const uint MC_AXIS = (30); ///< 板卡最大轴数
  516. public const uint MC_PROFILE = (31); ///< 板卡规划轴数
  517. public const uint MC_CRD_MAX_CNT = (60); ///< 坐标系最大个数
  518. public const uint MC_CRD_BUF_LEN = (61); ///< 坐标系缓冲区长度
  519. #endregion
  520. /// @defgroup CardVersionType 板卡系统版本类型定义
  521. /// @brief 以下宏定义针对IMC_GetImcCardVersion函数
  522. #region
  523. public const uint SOFT_VERSION = (0); // 总软件版本
  524. public const uint DSP_VERSION = (1); // HAL2软件版本
  525. public const uint ARM_VERSION = (2); // ARM软件版本
  526. public const uint API_VERSION = (3); // API软件版本
  527. public const uint FPGA_VERSION = (4); // FPGA固件版本
  528. public const uint DSP2_VERSION = (5); // HAL3固件版本
  529. public const uint LOCAL_VERSION = (6); // 端子板固件版本
  530. public const uint OS_ARM_VERSION = (11); // ARM系统版本
  531. public const uint LIB_DSP_VERSION = (12); // LibInfo软件版本
  532. public const uint LIB_ECAT_BOARD_APP_VERSION = (20); // 协议栈软件版本1
  533. public const uint LIB_ECAT_APP_VERSION = (21); // 协议栈软件版本2
  534. public const uint LIB_ECAT_VERSION = (22); // 协议栈软件版本3
  535. public const uint LIB_ECAT_PARSER_ENI_VERSION = (23); // 协议栈软件版本4
  536. #endregion
  537. #endregion
  538. /// @defgroup AxDiStopType 轴DI停止类型定义
  539. /// @brief 以下宏定义针对IMC_SetAxStopTrigPara、IMC_GetAxStopTrigPara函数
  540. #region
  541. public const uint CNST_DI_STOP_TYPE_ECATDI = (0); ///< EcatDI停止类型
  542. public const uint CNST_DI_STOP_TYPE_PROBLE1_RF = (1); ///< 探针1上升沿或下降沿停止
  543. public const uint CNST_DI_STOP_TYPE_PROBLE1_R = (2); ///< 探针1上升沿停止
  544. public const uint CNST_DI_STOP_TYPE_PROBLE1_F = (3); ///< 探针1下降沿停止
  545. #endregion
  546. /// @defgroup AxStsBit 轴状态位定义
  547. /// @brief 以下宏定义针对IMC_GetAxSts函数
  548. #region
  549. public const uint AX_ALARM_BIT = (0x00000001); ///< 轴驱动报警
  550. public const uint AX_SVON_BIT = (0x00000002); ///< 伺服使能
  551. public const uint AX_BUSY_BIT = (0x00000004); ///< 轴忙状态
  552. public const uint AX_ARRIVE_BIT = (0x00000008); ///< 轴到位状态
  553. public const uint AX_POSLMT_BIT = (0x00000010); ///< 正硬限位报警
  554. public const uint AX_NEGLMT_BIT = (0x00000020); ///< 负硬限位报警
  555. public const uint AX_SOFT_POSLMT_BIT = (0x00000040); ///< 正软限位报警
  556. public const uint AX_SOFT_NEGLMT_BIT = (0x00000080); ///< 负软限位报警
  557. public const uint AX_ERRPOS_BIT = (0x00000100); ///< 轴位置误差越限标志
  558. public const uint AX_EMG_STOP_BIT = (0x00000200); ///< 运动急停标志
  559. public const uint AX_ECAT_BIT = (0x00000400); ///< 总线轴标志
  560. public const uint AX_SW_ABNOR_BIT = (0x00000800); ///< 轴异常报警=(龙门);
  561. public const uint AX_WARING_BIT = (0x00001000); ///< 轴警告
  562. public const uint AX_HM_BIT = (0x00002000); ///< 原点信号状态
  563. public const uint AX_UNLINK_BIT = (0x00004000); ///< 轴掉线状态
  564. public const uint AX_ECAT_TGTREACH_BIT = (0x00008000); ///< 状态字里的到位状态
  565. #endregion
  566. /******************采集数据类型 定义***************************/
  567. // 单轴数据类型
  568. public const Int16 SAMPLE_ADDRESS_TYPE_AX_PRF_POS = (0x01); ///< 轴规划位置
  569. public const Int16 SAMPLE_ADDRESS_TYPE_AX_ENC_POS = (0x02); ///< 轴编码器位置
  570. public const Int16 SAMPLE_ADDRESS_TYPE_AX_PRF_VEL = (0x03); ///< 轴规划速度
  571. public const Int16 SAMPLE_ADDRESS_TYPE_AX_ENC_VEL = (0x04); ///< 轴编码器速度
  572. public const Int16 SAMPLE_ADDRESS_TYPE_AX_PRF_ACC = (0x05); ///< 轴规划加速度
  573. public const Int16 SAMPLE_ADDRESS_TYPE_AX_ENC_ACC = (0x06); ///< 轴编码器加速度
  574. public const Int16 SAMPLE_ADDRESS_TYPE_PRF_POS = (0x07); ///< 规划位置
  575. public const Int16 SAMPLE_ADDRESS_TYPE_PRF_CMPPOS = (0x08); ///< 比较位置
  576. public const Int16 SAMPLE_ADDRESS_TYPE_AX_TORQ = (0x0a); ///< 轴扭矩
  577. public const Int16 SAMPLE_ADDRESS_TYPE_AX_STS = (0x0b); ///< 轴状态
  578. // 资源信号数据类型
  579. public const Int16 SAMPLE_ADDRESS_TYPE_ECAT_DI = (0x30); ///< ECAT通用DI
  580. public const Int16 SAMPLE_ADDRESS_TYPE_ECAT_DO = (0x31); ///< ECAT通用DO
  581. public const Int16 SAMPLE_ADDRESS_TYPE_LOCAL_DI = (0x32); ///< 端子板DI
  582. public const Int16 SAMPLE_ADDRESS_TYPE_LOCAL_DO = (0x33); ///< 端子板DO
  583. public const Int16 SAMPLE_ADDRESS_TYPE_ECAT_AD = (0x34); ///< ECAT AD
  584. public const Int16 SAMPLE_ADDRESS_TYPE_ECAT_DA = (0x35); ///< ECAT DA
  585. // 总线对象字典采集
  586. public const Int16 SAMPLE_ADDRESS_TYPE_RXPDO_2 = (0x40); ///< pdo通用, 2字节, 写
  587. public const Int16 SAMPLE_ADDRESS_TYPE_RXPDO_4 = (0x41); ///< pdo通用, 4字节, 写
  588. public const Int16 SAMPLE_ADDRESS_TYPE_6040 = (0x42); ///< 控制字
  589. public const Int16 SAMPLE_ADDRESS_TYPE_607a = (0x43); ///< 目标位置
  590. public const Int16 SAMPLE_ADDRESS_TYPE_60ff = (0x44); ///< 目标速度
  591. public const Int16 SAMPLE_ADDRESS_TYPE_6071 = (0x45); ///< 目标力矩
  592. public const Int16 SAMPLE_ADDRESS_TYPE_6060 = (0x46); ///< 模式控制
  593. public const Int16 SAMPLE_ADDRESS_TYPE_60fe = (0x47); ///< 数字量输出
  594. public const Int16 SAMPLE_ADDRESS_TYPE_60b8 = (0x48); ///< 探针控制字
  595. public const Int16 SAMPLE_ADDRESS_TYPE_TXPDO_2 = (0x50); ///< pdo通用, 2字节, 读
  596. public const Int16 SAMPLE_ADDRESS_TYPE_TXPDO_4 = (0x51); ///< pdo通用, 4字节, 读
  597. public const Int16 SAMPLE_ADDRESS_TYPE_6041 = (0x52); ///< 状态字
  598. public const Int16 SAMPLE_ADDRESS_TYPE_6064 = (0x53); ///< 实际位置
  599. public const Int16 SAMPLE_ADDRESS_TYPE_606c = (0x54); ///< 实际速度
  600. public const Int16 SAMPLE_ADDRESS_TYPE_6077 = (0x55); ///< 实际力矩
  601. public const Int16 SAMPLE_ADDRESS_TYPE_60f4 = (0x56); ///< 跟随误差
  602. public const Int16 SAMPLE_ADDRESS_TYPE_603f = (0x57); ///< 错误码
  603. public const Int16 SAMPLE_ADDRESS_TYPE_60fd = (0x58); ///< 数字量输入
  604. public const Int16 SAMPLE_ADDRESS_TYPE_60b9 = (0x59); ///< 探针状态字
  605. public const Int16 SAMPLE_ADDRESS_TYPE_60ba = (0x60); ///< 探针位置1
  606. public const Int16 SAMPLE_ADDRESS_TYPE_60bb = (0x61); ///< 探针位置2
  607. // 插补数据类型
  608. public const Int16 SAMPLE_ADDRESS_TYPE_CRD_POSX = (0x100); ///< 插补坐标系, X轴位置
  609. public const Int16 SAMPLE_ADDRESS_TYPE_CRD_POSY = (0x101); ///< 插补坐标系, Y轴位置
  610. public const Int16 SAMPLE_ADDRESS_TYPE_CRD_POSZ = (0x102); ///< 插补坐标系, Z轴位置
  611. public const Int16 SAMPLE_ADDRESS_TYPE_CRD_VEL = (0x110); ///< 插补坐标系, 合成速度
  612. // 采集触发类型
  613. public const Int16 SAMPLE_TRIG_IMMEDIATE = (0); ///< 立即采集
  614. public const Int16 SAMPLE_TRIG_DELAY = (1); ///< 延时采集
  615. public const Int16 SAMPLE_TRIG_LOCAL_DI = (2); ///< 本地DI触发
  616. public const Int16 SAMPLE_TRIG_ECAT_DI = (3); ///< ECAT 的DI 触发
  617. //事件类型定义
  618. public const Int16 EVENT_TYPE_PRFPOS = (1);
  619. public const Int16 EVENT_TYPE_PRFVEL = (2);
  620. public const Int16 EVENT_TYPE_ENCPOS = (3);
  621. public const Int16 EVENT_TYPE_ENCVEL = (4);
  622. public const Int16 EVENT_TYPE_CRDPOS_X = (5);
  623. public const Int16 EVENT_TYPE_CRDPOS_Y = (6);
  624. public const Int16 EVENT_TYPE_CRDPOS_Z = (7);
  625. public const Int16 EVENT_TYPE_CRDVEL = (8);
  626. public const Int16 EVENT_TYPE_AXSTS_ALARM = (9);
  627. public const Int16 EVENT_TYPE_AXSTS_SVON = (10);
  628. public const Int16 EVENT_TYPE_AXSTS_BUSY = (11);
  629. public const Int16 EVENT_TYPE_AXSTS_ARRIVE = (12);
  630. public const Int16 EVENT_TYPE_AXSTS_POSLMT = (13);
  631. public const Int16 EVENT_TYPE_AXSTS_NEGLMT = (14);
  632. public const Int16 EVENT_TYPE_AXSTS_SOFT_POSLMT = (15);
  633. public const Int16 EVENT_TYPE_AXSTS_SOFT_NEGLMT = (16);
  634. public const Int16 EVENT_TYPE_AXSTS_ERRPOS = (17);
  635. public const Int16 EVENT_TYPE_AXSTS_EMGSTOP = (18);
  636. public const Int16 EVENT_TYPE_AXSTS_ECAT = (19);
  637. public const Int16 EVENT_TYPE_AXSTS_SW_ABNOR = (20);
  638. public const Int16 EVENT_TYPE_AXSTS_WARING = (21);
  639. public const Int16 EVENT_TYPE_AXSTS_HM = (22);
  640. public const Int16 EVENT_TYPE_AXSTS_UNLINK = (23);
  641. public const Int16 EVENT_TYPE_AXSTS_TGTREACH = (24);
  642. public const Int16 EVENT_TYPE_CRDSTS = (25);
  643. public const Int16 EVENT_TYPE_CRDID = (26);
  644. public const Int16 EVENT_TYPE_DI = (27);
  645. public const Int16 EVENT_TYPE_AD = (28);
  646. public const Int16 EVENT_TYPE_GLOBALVAL = (29);
  647. //事件条件定义
  648. public const Int16 EVENT_CONDITION_EQ = (1); ///< 变量值等于设定值
  649. public const Int16 EVENT_CONDITION_NE = (2); ///< 变量值不等于设定值
  650. public const Int16 EVENT_CONDITION_GT = (3); ///< 变量值大于设定值
  651. public const Int16 EVENT_CONDITION_LT = (4); ///< 变量值小于设定值
  652. public const Int16 EVENT_CONDITION_CHANGE_TO = (5); ///< 变量值改变为设定值
  653. public const Int16 EVENT_CONDITION_CHANGE = (6); ///< 变量值改变
  654. public const Int16 EVENT_CONDITION_UP = (7); ///< 变量值增大
  655. public const Int16 EVENT_CONDITION_DOWN = (8); ///< 变量值减小
  656. public const Int16 EVENT_CONDITION_REMAIN_AT = (9); ///< 变量值保持为设定值
  657. public const Int16 EVENT_CONDITION_REMAIN = (10); ///< 变量值保持不变
  658. public const Int16 EVENT_CONDITION_CROSS_POSITIVE = (11); ///< 变量值正向穿越设定值
  659. public const Int16 EVENT_CONDITION_CROSS_NEGATIVE = (12); ///< 变量值负向穿越设定值
  660. //事件功能中任务类型定义
  661. public const Int16 TASK_TYPE_CRDSTART = (1);
  662. public const Int16 TASK_TYPE_STARTPTPMOVE = (2);
  663. public const Int16 TASK_TYPE_STARTJOGMOVE = (3);
  664. public const Int16 TASK_TYPE_STARTGEARMOVE = (4);
  665. public const Int16 TASK_TYPE_STARTPTMOVE = (5);
  666. public const Int16 TASK_TYPE_STARTPVTMOVE = (6);
  667. public const Int16 TASK_TYPE_UPDATEPTPMOVEPARA = (7);
  668. public const Int16 TASK_TYPE_UPDATEJOGMOVEPARA = (8);
  669. public const Int16 TASK_TYPE_SETECATDOBIT = (9);
  670. public const Int16 TASK_TYPE_SETECATGRPDO = (10);
  671. public const Int16 TASK_TYPE_SETECATDOBITINVERSE = (11);
  672. public const Int16 TASK_TYPE_SETECATDAVAL = (12);
  673. public const Int16 TASK_TYPE_UPDATEPTPTGTPOS = (13);
  674. public const Int16 TASK_TYPE_PLUSEDO = (14);
  675. public const Int16 TASK_TYPE_STOPMOVE = (15);
  676. ///@defgroup CardBasic CardBasic
  677. ///@brief 板卡基本操作
  678. #region CardBasic
  679. ///@defgroup CardOpen CardOpen
  680. ///@brief 板卡开启与关闭
  681. #region CardOpen
  682. /// @brief 获取板卡数量
  683. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetCardsNum", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  684. public static extern UInt32 IMC_GetCardsNum(ref Int16 pCardsNum, Int16[] pCardIndexArray);
  685. /// @brief 按卡号开启控制卡
  686. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_OpenCard", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  687. public static extern UInt32 IMC_OpenCard(Int16 cardIndex);
  688. /// @brief 按卡号关闭控制卡
  689. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CloseCard", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  690. public static extern UInt32 IMC_CloseCard(Int16 cardIndex);
  691. #endregion
  692. ///@defgroup CardConfigFile CardConfigFile
  693. ///@brief 板卡配置文件操作
  694. #region CardConfigFile
  695. /// @brief 上传控制卡的设备配置文件(包括主站使能, 规划周期, EtherCAT对象以及偏置等), 上传文件的路径在设定目录下
  696. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_UpLoadDeviceConfig", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  697. public static extern UInt32 IMC_UpLoadDeviceConfig(Int16 cardIndex, string pathName);
  698. /// @brief 下载控制器的设备配置文件(包括主站使能, 规划周期, EtherCAT对象以及偏置等), 下载文件的路径在设定目录下
  699. /// @attention 当次下载下去之后, 非立即生效, 需要调用扫描板卡指令才能生效
  700. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_DownLoadDeviceConfig", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  701. public static extern UInt32 IMC_DownLoadDeviceConfig(Int16 cardIndex, string pathName);
  702. /// @brief 下载控制器的系统配置文件(包括轴映射、轴运动参数、IO取反滤波等硬件信号配置参数)
  703. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_DownLoadSystemConfig", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  704. public static extern UInt32 IMC_DownLoadSystemConfig(Int16 cardIndex, string pathName);
  705. #endregion
  706. #endregion
  707. ///@defgroup CardSysConfig CardSysConfig
  708. ///@brief 板卡系统配置相关函数
  709. #region CardSysConfig
  710. ///@defgroup EmgConfig EmgConfig
  711. ///@brief 急停参数配置函数
  712. #region EmgConfig
  713. /// @brief 设置停止信号的滤波系数
  714. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetEmgFilter", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  715. public static extern UInt32 IMC_SetEmgFilter(Int16 cardIndex, Int16 filter);
  716. /// @brief 获取停止信号的滤波系数
  717. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEmgFilter", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  718. public static extern UInt32 IMC_GetEmgFilter(Int16 cardIndex, ref Int16 pFilter);
  719. /// @brief 设置急停信号触发的电平取反
  720. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetEmgTrigLevelInv", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  721. public static extern UInt32 IMC_SetEmgTrigLevelInv(Int16 cardIndex, Int16 inverse);
  722. /// @brief 获取急停信号触发的电平取反
  723. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEmgTrigLevelInv", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  724. public static extern UInt32 IMC_GetEmgTrigLevelInv(Int16 cardIndex, ref Int16 pInverse);
  725. /// @brief 获取急停状态
  726. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEmgSts", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  727. public static extern UInt32 IMC_GetEmgSts(Int16 cardIndex, ref Int16 pSts);
  728. /// @brief 设置急停时是否复位所有 DO 输出的开关使能
  729. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetEmgDoResetFlag", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  730. public static extern UInt32 IMC_SetEmgDoResetFlag(Int16 cardIndex, Int16 enable);
  731. /// @brief 读取急停时是否复位所有 DO 输出的开关使能
  732. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEmgDoResetFlag", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  733. public static extern UInt32 IMC_GetEmgDoResetFlag(Int16 cardIndex, ref Int16 pEnable);
  734. /// @brief 设置是否忽略板卡的ECAT连接状态
  735. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetEcatLinkStsIgnore", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  736. public static extern UInt32 IMC_SetEcatLinkStsIgnore(Int16 cardIndex, Int16 flag);
  737. #endregion
  738. ///@defgroup Watchdog Watchdog
  739. ///@brief 看门狗参数配置函数
  740. #region Watchdog
  741. /// @brief 设置看门狗, 在报警时, 进行急停动作。主要用于检查应用层软件是否卡死。
  742. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_OpenWatchDog", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  743. public static extern UInt32 IMC_OpenWatchDog(Int16 cardIndex, Int32 feedTime);
  744. /// @brief 喂看门狗操作
  745. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_FeedWatchDog", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  746. public static extern UInt32 IMC_FeedWatchDog(Int16 cardIndex);
  747. /// @brief 关闭看门狗检查
  748. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CloseWatchDog", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  749. public static extern UInt32 IMC_CloseWatchDog(Int16 cardIndex);
  750. #endregion
  751. ///@defgroup CardTimeInfo CardTimeInfo
  752. ///@brief 板卡内部时钟信息
  753. #region CardTimeInfo
  754. /// @brief 获取板卡的CPU负载
  755. /// @warning 建议负载率不要超过60%
  756. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetCalcLoadRatio", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  757. public static extern UInt32 IMC_GetCalcLoadRatio(Int16 cardIndex, ref double pLoadRatio);
  758. /// @brief 根据Type类型, 获取板卡对应的固件版本
  759. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetVersion", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  760. public static extern UInt32 IMC_GetVersion(Int16 cardIndex, Int16 type, Int16[] pVersion);
  761. #endregion
  762. ///@defgroup CardMasterInfo CardMasterInfo
  763. ///@brief 板卡主站配置信息
  764. #region CardMasterInfo
  765. /// @brief 获取主站启用配置, 从xml配置文件获取
  766. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetMasterCfgXml", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  767. public static extern UInt32 IMC_GetMasterCfgXml(Int16 cardIndex, ref Int16 pHwCfg);
  768. /// @brief 获取板卡的网口硬件连接状态
  769. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetHwPortLinkSts", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  770. public static extern UInt32 IMC_GetHwPortLinkSts(Int16 cardIndex, ref Int16 pLinkSts);
  771. /// @brief 获取板卡的网口硬件连接状态,Ex指令
  772. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetHwPortLinkStsEx", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  773. public static extern UInt32 IMC_GetHwPortLinkStsEx(Int16 cardIndex, ref Int16 pLinkSts);
  774. #endregion
  775. ///@defgroup CardReset CardReset
  776. ///@brief 板卡复位功能
  777. #region CardReset
  778. /// @brief 复位控制卡系统参数
  779. /// @details 控制卡规划层软件资源复位
  780. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_ResetSysPara", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  781. public static extern UInt32 IMC_ResetSysPara(Int16 cardIndex);
  782. #endregion
  783. ///@defgroup UserCode UserCode
  784. ///@brief 用户配置
  785. #region UserCode
  786. /// @brief 设置用户密码
  787. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_WriteUserCode", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  788. public static extern UInt32 IMC_WriteUserCode(Int16 cardIndex, Byte[] pCode, Int16 len);
  789. /// @brief 检验设置的用户密码
  790. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CheckUserCode", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  791. public static extern UInt32 IMC_CheckUserCode(Int16 cardIndex, Byte[] pCode, Int16 len);
  792. /// @brief 写入用户数据
  793. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_WriteUserData", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  794. public static extern UInt32 IMC_WriteUserData(Int16 cardIndex, Int16 offset, Byte[] pData, Int16 len);
  795. /// @brief 读取用户数据
  796. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_ReadUserData", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  797. public static extern UInt32 IMC_ReadUserData(Int16 cardIndex, Int16 offset, Byte[] pData, Int16 len);
  798. #endregion
  799. #endregion
  800. ///@defgroup EtherCAT EtherCAT
  801. ///@brief 板卡ECAT功能
  802. #region EtherCAT
  803. ///@defgroup EcatInit EcatInit
  804. ///@brief 板卡ECAT初始化功能
  805. #region EcatInit
  806. /// @brief 初始化板卡通讯, 主站进入OP状态
  807. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_InitEcatComm", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  808. public static extern UInt32 IMC_InitEcatComm(Int16 cardIndex);
  809. /// @brief 开启板卡通讯, 获取EtherCAT总线资源, 建立主站与各从站之间的通讯
  810. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_StartEcatComm", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  811. public static extern UInt32 IMC_StartEcatComm(Int16 cardIndex);
  812. /// @brief 关闭板卡通讯, 主站退出OP状态
  813. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_DelEcatComm", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  814. public static extern UInt32 IMC_DelEcatComm(Int16 cardIndex);
  815. /// @brief 初始化总线, 直到主站进入OP状态, 随后扫描EtherCAT总线资源, 并建立主站与各从站之间的通讯 (该函数会阻塞在EtherCAT的总线扫描同步阶段)
  816. /// @warning 该指令阻塞执行
  817. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_ScanCardEcat", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  818. public static extern UInt32 IMC_ScanCardEcat(Int16 cardIndex, Int16 waitTime = 40);
  819. #endregion
  820. ///@defgroup EcatInfo EcatInfo
  821. ///@brief 板卡ECAT主站信息获取函数
  822. #region EcatInfo
  823. /// @brief 获取EtherCAT主站的状态
  824. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatMasterSts", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  825. public static extern UInt32 IMC_GetEcatMasterSts(Int16 cardIndex, ref UInt32 pStatus);
  826. /// @brief 获取EtherCAT协议栈通讯错误码
  827. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatErrCode", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  828. public static extern UInt32 IMC_GetEcatErrCode(Int16 cardIndex, ref UInt32 pErrCode);
  829. /// @brief 获取EtherCAT主站的状态,Ex指令
  830. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatMasterStsEx", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  831. public static extern UInt32 IMC_GetEcatMasterStsEx(Int16 cardIndex, ref UInt32 pStatus);
  832. /// @brief 获取EtherCAT协议栈通讯错误码,Ex指令
  833. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatErrCodeEx", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  834. public static extern UInt32 IMC_GetEcatErrCodeEx(Int16 cardIndex, ref UInt32 pErrCode);
  835. /// @brief 获取EtherCAT从站当前通讯阶段INIT、PreOP、SafeOp、OP
  836. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatSlaveSts", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  837. public static extern UInt32 IMC_GetEcatSlaveSts(Int16 cardIndex, Int16 slave, ref Int16 pCurStatus, ref Int16 pReqStatus, ref Int16 pErrCode);
  838. /// @brief 获取EtherCAT主站信息(包含通讯周期, 从站个数, 资源数量等)
  839. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatMasterInfo", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  840. public static extern UInt32 IMC_GetEcatMasterInfo(Int16 cardIndex, ref TMasterInfo ptMasterInfo);
  841. /// @brief 获取EtherCAT从站信息(包含设备类型, 对应轴号, 从站别名等)
  842. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatSlaveInfo", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  843. public static extern UInt32 IMC_GetEcatSlaveInfo(Int16 cardIndex, Int16 slave, ref TSlaveInfo ptSlaveInfo);
  844. /// @brief 获取从站连接状态
  845. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatSlaveOpSts", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  846. public static extern UInt32 IMC_GetEcatSlaveOpSts(Int16 cardIndex, ref UInt16 pSts, UInt32[] pMask);
  847. #endregion
  848. ///@defgroup EcatPDO EcatPDO
  849. ///@brief 板卡ECAT主站PDO功能
  850. #region EcatPDO
  851. /// @brief 根据站号读取EtherCAT从站的PDO数据
  852. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatSlavePdoData", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  853. public static extern UInt32 IMC_GetEcatSlavePdoData(Int16 cardIndex, Int16 slave, UInt16 index, UInt16 subIndex, Byte[] pData);
  854. /// @brief 根据站号写入EtherCAT从站的PDO数据, 仅支持非轴从站, 非DIO, AIO, RegInOut类型Pdo
  855. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetEcatSlavePdoData", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  856. public static extern UInt32 IMC_SetEcatSlavePdoData(Int16 cardIndex, Int16 slave, UInt16 index, UInt16 subIndex, Byte[] pData);
  857. /// @brief 根据轴号获取EtherCAT从站的PDO数据
  858. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatAxPdoData", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  859. public static extern UInt32 IMC_GetEcatAxPdoData(Int16 cardIndex, Int16 axNo, UInt16 index, Byte[] pData);
  860. /// @brief 根据轴号写入EtherCAT从站的PDO数据
  861. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetEcatAxPdoData", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  862. public static extern UInt32 IMC_SetEcatAxPdoData(Int16 cardIndex, Int16 axNo, UInt16 index, Byte[] pData);
  863. /// @brief 根据索引和子索引读取从站的PdoEntry结构体信息
  864. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatSlavePdoEntry", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  865. public static extern UInt32 IMC_GetEcatSlavePdoEntry(Int16 cardIndex, Int16 slave, UInt16 index, UInt16 subIndex, ref TPdoEntry ptPdoEntry);
  866. #endregion
  867. ///@defgroup EcatSDO EcatSDO
  868. ///@brief 板卡ECAT主站SDO功能
  869. #region EcatSDO
  870. /// @brief 根据站号获取EtherCAT从站的SDO数据
  871. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatSlaveSdo", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  872. public static extern UInt32 IMC_GetEcatSlaveSdo(Int16 cardIndex, Int16 slave, UInt16 index, UInt16 subIndex, Byte[] pData, UInt32 dataSize, ref UInt32 pResultSize, ref UInt32 pAbortCode);
  873. /// @brief 根据站号写入EtherCAT从站的SDO数据
  874. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetEcatSlaveSdo", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  875. public static extern UInt32 IMC_SetEcatSlaveSdo(Int16 cardIndex, Int16 slave, UInt16 index, UInt16 subIndex, Byte[] pData, UInt32 dataSize, ref UInt32 pAbortCode);
  876. /// @brief 根据轴号获取EtherCAT从站的SDO数据
  877. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatAxSdo", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  878. public static extern UInt32 IMC_GetEcatAxSdo(Int16 cardIndex, Int16 axNo, UInt16 index, UInt16 subIndex, Byte[] pData, UInt32 dataSize, ref UInt32 pResultSize, ref UInt32 pAbortCode);
  879. /// @brief 根据轴号写入EtherCAT从站的SDO数据
  880. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetEcatAxSdo", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  881. public static extern UInt32 IMC_SetEcatAxSdo(Int16 cardIndex, Int16 axNo, UInt16 index, UInt16 subIndex, Byte[] pData, UInt32 dataSize, ref UInt32 pAbortCode);
  882. #endregion
  883. ///@defgroup EcatAxisMap EcatAxisMap
  884. ///@brief 板卡ECAT主站轴映射功能
  885. #region EcatAxisMap
  886. /// @brief 根据轴号获取轴所在从站的站号以及Slot号
  887. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatAxStation", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  888. public static extern UInt32 IMC_GetEcatAxStation(Int16 cardIndex, Int16 axNo, ref Int16 pSlave, ref Int16 pSlotIndex);
  889. /// @brief 根据从站号以及Slot号获取对应的轴通道号
  890. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatSlaveAxChn", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  891. public static extern UInt32 IMC_GetEcatSlaveAxChn(Int16 cardIndex, Int16 slave, Int16 slotIndex, ref Int16 pAxChn);
  892. #endregion
  893. ///@defgroup EcatAlias EcatAlias
  894. ///@brief 板卡ECAT从站别名功能
  895. #region EcatAlias
  896. /// @brief 根据从站别名获取从站的SDO数据
  897. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatAliasSdo", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  898. public static extern UInt32 IMC_GetEcatAliasSdo(Int16 cardIndex, UInt32 aliasNo, UInt16 index, UInt16 subIndex, Byte[] pData, UInt32 dataSize, ref UInt32 pResultSize, ref UInt32 pAbortCode);
  899. /// @brief 根据从站别名设定从站的SDO数据
  900. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetEcatAliasSdo", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  901. public static extern UInt32 IMC_SetEcatAliasSdo(Int16 cardIndex, UInt32 aliasNo, UInt16 index, UInt16 subIndex, Byte[] pData, UInt32 dataSize, ref UInt32 pAbortCode);
  902. /// @brief 设置EtherCAT的DO输出状态保持, 断线后复位总线保持上一次状态
  903. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetEcatDoStsHold", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  904. public static extern UInt32 IMC_SetEcatDoStsHold(Int16 cardIndex, Int16 isHold);
  905. #endregion
  906. /// @brief 获取EtherCAT的DI输入状态, 按16bits为一组进行获取
  907. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatDi", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  908. public static extern UInt32 IMC_GetEcatDi(Int16 cardIndex, Int16 packIndex, UInt16[] pValue, Int16 packCnt);
  909. /// @brief 设置EtherCAT的DO输出状态, 按16bits为一组进行设置
  910. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetEcatDo", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  911. public static extern UInt32 IMC_SetEcatDo(Int16 cardIndex, Int16 packIndex, UInt16[] pValue, Int16 packCnt);
  912. /// @brief 获取EtherCAT的DO输出状态, 按16bits为一组进行获取
  913. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatDo", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  914. public static extern UInt32 IMC_GetEcatDo(Int16 cardIndex, Int16 packIndex, UInt16[] pValue, Int16 packCnt);
  915. /// @brief 获取EtherCAT的DI输入状态, 按位进行获取
  916. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatDiBit", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  917. public static extern UInt32 IMC_GetEcatDiBit(Int16 cardIndex, Int16 diIndex, ref Int16 pValue);
  918. /// @brief 获取EtherCAT的DO输出状态, 按位进行获取
  919. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatDoBit", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  920. public static extern UInt32 IMC_GetEcatDoBit(Int16 cardIndex, Int16 doIndex, ref Int16 pValue);
  921. /// @brief 设置EtherCAT的DO输出状态, 按位进行设置
  922. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetEcatDoBit", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  923. public static extern UInt32 IMC_SetEcatDoBit(Int16 cardIndex, Int16 doIndex, Int16 value);
  924. /// @brief 设置EtherCAT的DO输出状态以及生效延时, 按位进行设置
  925. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetEcatDoBitInverse", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  926. public static extern UInt32 IMC_SetEcatDoBitInverse(Int16 cardIndex, Int16 doIndex, Int16 value, Int16 inverseTime);
  927. #endregion
  928. ///@defgroup EcatAD EcatAD
  929. ///@brief 板卡ECAT主站AD/DA/Reg32寄存器功能
  930. #region EcatAD
  931. /// @brief 根据通道号获取EtherCAT对应通道的AD值
  932. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatAdVal", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  933. public static extern UInt32 IMC_GetEcatAdVal(Int16 cardIndex, Int16 adIndex, ref Int16 pValue);
  934. /// @brief 根据通道号设置EtherCAT对应通道的DA值
  935. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetEcatDaVal", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  936. public static extern UInt32 IMC_SetEcatDaVal(Int16 cardIndex, Int16 daIndex, Int16 Value);
  937. /// @brief 根据通道号获取EtherCAT对应通道的DA值
  938. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatDaVal", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  939. public static extern UInt32 IMC_GetEcatDaVal(Int16 cardIndex, Int16 daIndex, ref Int16 pValue);
  940. /// @brief 根据通道号获取EtherCAT对应通道的RegIn值
  941. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatRegInVal", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  942. public static extern UInt32 IMC_GetEcatRegInVal(Int16 cardIndex, Int16 regIndex, ref float pValue);
  943. /// @brief 根据通道号设置EtherCAT对应通道的RegOut值
  944. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetEcatRegOutVal", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  945. public static extern UInt32 IMC_SetEcatRegOutVal(Int16 cardIndex, Int16 regIndex, float Value);
  946. /// @brief 根据通道号获取EtherCAT对应通道的RegOut值
  947. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatRegOutVal", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  948. public static extern UInt32 IMC_GetEcatRegOutVal(Int16 cardIndex, Int16 regIndex, ref float pValue);
  949. /// @brief 根据通道号获取EtherCAT对应通道的AD值
  950. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatAd", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  951. public static extern UInt32 IMC_GetEcatAd(Int16 cardIndex, Int16 adIndex, Int16[] pValueArray, Int16 count);
  952. /// @brief 根据通道号设置EtherCAT对应通道的DA值
  953. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetEcatDa", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  954. public static extern UInt32 IMC_SetEcatDa(Int16 cardIndex, Int16 daIndex, Int16[] pValueArray, Int16 count);
  955. /// @brief 根据通道号获取EtherCAT对应通道的DA值
  956. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatDa", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  957. public static extern UInt32 IMC_GetEcatDa(Int16 cardIndex, Int16 daIndex, Int16[] pValueArray, Int16 count);
  958. /// @brief 根据通道号获取EtherCAT对应通道的RegIn值
  959. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatRegIn", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  960. public static extern UInt32 IMC_GetEcatRegIn(Int16 cardIndex, Int16 regIndex, float[] pValueArray, Int16 count);
  961. /// @brief 根据通道号设置EtherCAT对应通道的RegOut值
  962. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetEcatRegOut", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  963. public static extern UInt32 IMC_SetEcatRegOut(Int16 cardIndex, Int16 regIndex, float[] pValueArray, Int16 count);
  964. /// @brief 根据通道号获取EtherCAT对应通道的RegOut值
  965. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatRegOut", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  966. public static extern UInt32 IMC_GetEcatRegOut(Int16 cardIndex, Int16 regIndex, float[] pValueArray, Int16 count);
  967. #endregion
  968. ///@defgroup EcatEnc EcatEnc
  969. ///@brief 板卡ECAT主站Enc资源操作
  970. #region EcatEnc
  971. /// @brief 设置Ecat编码器计数方向
  972. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetEcatEncDir", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  973. public static extern UInt32 IMC_SetEcatEncDir(Int16 cardIndex, Int16 encIndex, Int16[] pDirArray, Int16 count = 1);
  974. /// @brief 读取Ecat编码器计数方向
  975. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatEncDir", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  976. public static extern UInt32 IMC_GetEcatEncDir(Int16 cardIndex, Int16 encIndex, Int16[] pDirArray, Int16 count = 1);
  977. /// @brief 设置Ecat编码器值
  978. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetEcatEncPos", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  979. public static extern UInt32 IMC_SetEcatEncPos(Int16 cardIndex, Int16 encIndex, Int32[] pEncPosArray, Int16 count = 1);
  980. /// @brief 读取Ecat编码器值
  981. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatEncPos", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  982. public static extern UInt32 IMC_GetEcatEncPos(Int16 cardIndex, Int16 encIndex, Int32[] pEncPosArray, Int16 count = 1);
  983. /// @brief 读取Ecat编码器原始值(PDO原始编码数据)
  984. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatEncPosRaw", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  985. public static extern UInt32 IMC_GetEcatEncPosRaw(Int16 cardIndex, Int16 encIndex, Int32[] pEncPosArray, Int16 count = 1);
  986. /// @brief 读取Ecat编码器速度
  987. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatEncVel", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  988. public static extern UInt32 IMC_GetEcatEncVel(Int16 cardIndex, Int16 encIndex, Int32[] pEncVelArray, Int16 count = 1);
  989. #endregion
  990. ///@defgroup EcatAxis EcatAxis
  991. ///@brief 板卡ECAT相关函数
  992. #region EcatAxis
  993. ///@defgroup EcatAxisPDO EcatAxisPDO
  994. ///@brief 板卡ECAT轴PDO功能
  995. #region EcatAxisPDO
  996. /// @brief 设置EtherCAT类型轴控制模式0x6060
  997. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetEcatAxMode", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  998. public static extern UInt32 IMC_SetEcatAxMode(Int16 cardIndex, Int16 axNo, Int16 ctrlMode);
  999. /// @brief 读取EtherCAT类型轴控制模式
  1000. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatAxMode", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1001. public static extern UInt32 IMC_GetEcatAxMode(Int16 cardIndex, Int16 axNo, ref Int16 pCtrlMode);
  1002. /// @brief 获取EtherCAT类型轴的对应的数字量输入,pdo必须配置0x60fd
  1003. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatAxDi", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1004. public static extern UInt32 IMC_GetEcatAxDi(Int16 cardIndex, Int16 axNo, ref UInt32 pDiVal);
  1005. /// @brief 设置EtherCAT类型轴的对应的数字量输出,pdo必须配置0x60fe:01
  1006. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetEcatAxDo", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1007. public static extern UInt32 IMC_SetEcatAxDo(Int16 cardIndex, Int16 axNo, UInt32 doVal);
  1008. /// @brief 获取EtherCAT类型轴的对应的数字量输输出,pdo必须配置0x60fe:01
  1009. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatAxDo", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1010. public static extern UInt32 IMC_GetEcatAxDo(Int16 cardIndex, Int16 axNo, ref UInt32 pDoVal);
  1011. /// @brief 获取EtherCAT类型轴的对应的错误码,pdo必须配置0x603f
  1012. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatAxErrCode", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1013. public static extern UInt32 IMC_GetEcatAxErrCode(Int16 cardIndex, Int16 axNo, ref UInt16 pErrCode);
  1014. /// @brief 设置EtherCAT类型轴的最大速度限制,pdo必须配置0x607f
  1015. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetEcatAxMaxVelLmt", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1016. public static extern UInt32 IMC_SetEcatAxMaxVelLmt(Int16 cardIndex, Int16 axNo, UInt32 maxVel);
  1017. /// @brief 获取EtherCAT类型轴的最大速度限制,pdo必须配置0x607f
  1018. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatAxMaxVelLmt", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1019. public static extern UInt32 IMC_GetEcatAxMaxVelLmt(Int16 cardIndex, Int16 axNo, ref UInt32 pMaxVel);
  1020. /// @brief 设置 EtherCAT 类型轴的对应的正向力矩限制,pdo必须配置0x60e0
  1021. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetEcatAxPosTorqLmt", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1022. public static extern UInt32 IMC_SetEcatAxPosTorqLmt(Int16 cardIndex, Int16 axNo, UInt16 posTorqLmt);
  1023. /// @brief 获取 EtherCAT 类型轴的对应的正向力矩限制,pdo必须配置0x60e0
  1024. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatAxPosTorqLmt", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1025. public static extern UInt32 IMC_GetEcatAxPosTorqLmt(Int16 cardIndex, Int16 axNo, ref UInt16 pPosTorqLmt);
  1026. /// @brief 设置 EtherCAT 类型轴的对应的负向力矩限制,pdo必须配置0x60e1
  1027. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetEcatAxNegTorqLmt", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1028. public static extern UInt32 IMC_SetEcatAxNegTorqLmt(Int16 cardIndex, Int16 axNo, UInt16 negTorqLmt);
  1029. /// @brief 获取 EtherCAT 类型轴的对应的负向力矩限制,pdo必须配置0x60e1
  1030. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatAxNegTorqLmt", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1031. public static extern UInt32 IMC_GetEcatAxNegTorqLmt(Int16 cardIndex, Int16 axNo, ref UInt16 pNegTorqLmt);
  1032. /// @brief 设置 EtherCAT 类型轴的最大力矩限制,pdo必须配置0x6072
  1033. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetEcatAxMaxTorqLmt", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1034. public static extern UInt32 IMC_SetEcatAxMaxTorqLmt(Int16 cardIndex, Int16 axNo, UInt16 maxTorqLmt);
  1035. /// @brief 获取 EtherCAT 类型轴的最大力矩限制,pdo必须配置0x6072
  1036. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatAxMaxTorqLmt", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1037. public static extern UInt32 IMC_GetEcatAxMaxTorqLmt(Int16 cardIndex, Int16 axNo, ref UInt16 pMaxTorqLmt);
  1038. #endregion
  1039. ///@defgroup EcatAxisThreshold EcatAxisThreshold
  1040. ///@brief 板卡ECAT轴急停保持参数配置函数
  1041. #region EcatAxisThreshold
  1042. /// @brief 设置EtherCAT轴使能控制延时时间, 主要用于特殊场合, 使能控制字输出, 驱动器寻相后, 才能给出使能状态字
  1043. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetEcatAxOnThreshold", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1044. public static extern UInt32 IMC_SetEcatAxOnThreshold(Int16 cardIndex, Int16 axNo, UInt16 waitPeriod);
  1045. /// @brief 获取EtherCAT轴使能控制延时时间
  1046. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatAxOnThreshold", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1047. public static extern UInt32 IMC_GetEcatAxOnThreshold(Int16 cardIndex, Int16 axNo, ref UInt16 pWaitPeriod);
  1048. #endregion
  1049. ///@defgroup EcatAxisCSV EcatAxisCSV
  1050. ///@brief 板卡ECAT轴CSV模式功能
  1051. #region EcatAxisCSV
  1052. /// @brief 启动 CSV 速度规划
  1053. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_StartEcatAxCsvPrf", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1054. public static extern UInt32 IMC_StartEcatAxCsvPrf(Int16 cardIndex, Int16 axNo, Int32 tgtVel, Int32 acc, Int16 prfType);
  1055. /// @brief 更新 CSV 速度规划的目标速度
  1056. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_UpdateEcatAxCsvPrf", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1057. public static extern UInt32 IMC_UpdateEcatAxCsvPrf(Int16 cardIndex, Int16 axNo, Int32 tgtVel);
  1058. /// @brief 获取 CSV 速度规划的状态
  1059. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatAxCsvPrfSts", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1060. public static extern UInt32 IMC_GetEcatAxCsvPrfSts(Int16 cardIndex, Int16 axNo, ref Int16 pStatus);
  1061. #endregion
  1062. ///@defgroup EcatAxisCST EcatAxisCST
  1063. ///@brief 板卡ECAT轴CST模式功能
  1064. #region EcatAxisCST
  1065. /// @brief 启动 CST 线性转矩规划
  1066. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_StartEcatAxTorqPrf", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1067. public static extern UInt32 IMC_StartEcatAxTorqPrf(Int16 cardIndex, Int16 axNo, Int16 tgtTorq, Int16 time);
  1068. /// @brief 获取 EtherCAT 类型轴的实际转矩, 根据count值可一次获取多个轴的扭矩
  1069. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatAxActTorq", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1070. public static extern UInt32 IMC_GetEcatAxActTorq(Int16 cardIndex, Int16 axNo, Int16[] pActTorqArray, Int16 count = 1);
  1071. /// @brief 设置 EtherCAT 类型轴的对应的转矩斜坡值
  1072. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetEcatAxTorqSlope", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1073. public static extern UInt32 IMC_SetEcatAxTorqSlope(Int16 cardIndex, Int16 axNo, UInt32 torqSlope);
  1074. /// @brief 获取 EtherCAT 类型轴的对应的转矩斜坡值
  1075. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatAxTorqSlope", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1076. public static extern UInt32 IMC_GetEcatAxTorqSlope(Int16 cardIndex, Int16 axNo, ref UInt32 pTorqSlope);
  1077. /// @brief 设置 EtherCAT 类型轴的对应的目标转矩
  1078. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetEcatAxTgtTorq", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1079. public static extern UInt32 IMC_SetEcatAxTgtTorq(Int16 cardIndex, Int16 axNo, Int16 tgtTorq);
  1080. /// @brief 获取 EtherCAT 类型轴的对应的目标转矩
  1081. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatAxTgtTorq", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1082. public static extern UInt32 IMC_GetEcatAxTgtTorq(Int16 cardIndex, Int16 axNo, ref Int16 pTgtTorq);
  1083. #endregion
  1084. ///@defgroup EcatAxisCapt EcatAxisCapt
  1085. ///@brief 板卡ECAT轴捕获功能功能
  1086. #region EcatAxisCapt
  1087. /// @brief 设置 EtherCAT 类型轴的位置捕获类型
  1088. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetEcatAxCapt", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1089. public static extern UInt32 IMC_SetEcatAxCapt(Int16 cardIndex, Int16 axNo, Int16 trigType, Int16 edge);
  1090. /// @brief 获取 EtherCAT 类型轴的位置捕获类型
  1091. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatAxCapt", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1092. public static extern UInt32 IMC_GetEcatAxCapt(Int16 cardIndex, Int16 axNo, ref Int16 pTrigType, ref Int16 pEdge);
  1093. /// @brief 获取 EtherCAT 类型轴的位置捕获状态
  1094. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatAxCaptStatus", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1095. public static extern UInt32 IMC_GetEcatAxCaptStatus(Int16 cardIndex, Int16 axNo, ref Int16 pSts, ref Int32 pPosVal, ref Int32 pNegVal);
  1096. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetEcatAxProbeFun", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1097. public static extern UInt32 IMC_SetEcatAxProbeFun(Int16 cardIndex, Int16 axNo, Int16 probeFun);
  1098. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatAxProbeFun", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1099. public static extern UInt32 IMC_GetEcatAxProbeFun(Int16 cardIndex, Int16 axNo, ref Int16 pProbeFun);
  1100. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatAxProbeSts", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1101. public static extern UInt32 IMC_GetEcatAxProbeSts(Int16 cardIndex, Int16 axNo, ref Int16 pProbeSts, ref Int32 pProbe1Pos, ref Int32 pProbe1Neg, ref Int32 pProbe2Pos, ref Int32 pProbe2Neg);
  1102. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetEcatAxProbeContinousCount", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1103. public static extern UInt32 IMC_SetEcatAxProbeContinousCount(Int16 cardIndex, Int16 axNo, Int16[] pCountArray);
  1104. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatAxProbeContinousCount", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1105. public static extern UInt32 IMC_GetEcatAxProbeContinousCount(Int16 cardIndex, Int16 axNo, Int16[] pCountArray, Int16[] pTrigArray, Int16[] pRestArray);
  1106. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatAxProbeContinousData", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1107. public static extern UInt32 IMC_GetEcatAxProbeContinousData(Int16 cardIndex, Int16 axNo, Int16 probeType, Int32[] pPosArray, Int16 count);
  1108. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetEcatAxProbeContinousTable", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1109. public static extern UInt32 IMC_SetEcatAxProbeContinousTable(Int16 cardIndex, Int16 axNo, Int16 tableIndex);
  1110. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatAxProbeContinousTable", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1111. public static extern UInt32 IMC_GetEcatAxProbeContinousTable(Int16 cardIndex, Int16 axNo, ref Int16 pTableIndex);
  1112. /// @brief 清除 EtherCAT 类型轴的连续位置捕获状态
  1113. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_ClrEcatAxCaptStatus", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1114. public static extern UInt32 IMC_ClrEcatAxCaptStatus(Int16 cardIndex, Int16 axNo);
  1115. #endregion
  1116. #endregion
  1117. ///@defgroup HEcatFunc HEcatFunc
  1118. ///@brief H主站函数
  1119. #region HEcatFunc
  1120. ///@defgroup H-MasterCfg H-MasterCfg
  1121. ///@brief H主站系统配置函数
  1122. #region H
  1123. /// @brief 获取板卡的CPU负载
  1124. /// @warning 建议负载率不要超过60%
  1125. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_H_GetCalcLoadRatio", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1126. public static extern UInt32 IMC_H_GetCalcLoadRatio(Int16 cardIndex, ref double pLoadRatio);
  1127. /// @brief 复位控制卡系统参数
  1128. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_H_ResetSysPara", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1129. public static extern UInt32 IMC_H_ResetSysPara(Int16 cardIndex);
  1130. #endregion
  1131. ///@defgroup H-EtherCAT H-EtherCAT
  1132. ///@brief 板卡H主站功能
  1133. #region H
  1134. /// @brief 初始化板卡通讯, 主站进入OP状态
  1135. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_H_InitEcatComm", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1136. public static extern UInt32 IMC_H_InitEcatComm(Int16 cardIndex);
  1137. /// @brief 开启板卡通讯, 初始化EtherCAT总线资源, 建立主站与各从站之间的通讯
  1138. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_H_StartEcatComm", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1139. public static extern UInt32 IMC_H_StartEcatComm(Int16 cardIndex);
  1140. /// @brief 关闭板卡通讯, 主站退出OP状态
  1141. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_H_DelEcatComm", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1142. public static extern UInt32 IMC_H_DelEcatComm(Int16 cardIndex);
  1143. /// @brief 初始化总线, 直到主站进入OP状态, 随后扫描EtherCAT总线资源, 并建立主站与各从站之间的通讯 (该函数会阻塞在EtherCAT的总线扫描同步阶段)
  1144. /// @warning 该指令阻塞执行
  1145. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_H_ScanCardEcat", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1146. public static extern UInt32 IMC_H_ScanCardEcat(Int16 cardIndex, Int16 waitTime = 40);
  1147. /// @brief 获取EtherCAT主站的状态
  1148. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_H_GetEcatMasterSts", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1149. public static extern UInt32 IMC_H_GetEcatMasterSts(Int16 cardIndex, ref UInt32 pStatus);
  1150. /// @brief 获取EtherCAT协议栈通讯错误码
  1151. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_H_GetEcatErrCode", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1152. public static extern UInt32 IMC_H_GetEcatErrCode(Int16 cardIndex, ref UInt32 pErrCode);
  1153. /// @brief 获取EtherCAT主站的状态,Ex指令
  1154. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_H_GetEcatMasterStsEx", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1155. public static extern UInt32 IMC_H_GetEcatMasterStsEx(Int16 cardIndex, ref UInt32 pStatus);
  1156. /// @brief 获取EtherCAT协议栈通讯错误码,Ex指令
  1157. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_H_GetEcatErrCodeEx", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1158. public static extern UInt32 IMC_H_GetEcatErrCodeEx(Int16 cardIndex, ref UInt32 pErrCode);
  1159. /// @brief 获取EtherCAT从站当前通讯阶段, INIT, PerOP, SafeOP, OP
  1160. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_H_GetEcatSlaveSts", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1161. public static extern UInt32 IMC_H_GetEcatSlaveSts(Int16 cardIndex, Int16 slave, ref Int16 pCurStatus, ref Int16 pReqStatus, ref Int16 pErrCode);
  1162. /// @brief 获取EtherCAT主站信息(包含通讯周期, 从站个数, 资源数量等)
  1163. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_H_GetEcatMasterInfo", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1164. public static extern UInt32 IMC_H_GetEcatMasterInfo(Int16 cardIndex, ref TMasterInfo ptMasterInfo);
  1165. /// @brief 获取EtherCAT从站信息(包含设备类型, 对应轴号, 从站别名等)
  1166. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_H_GetEcatSlaveInfo", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1167. public static extern UInt32 IMC_H_GetEcatSlaveInfo(Int16 cardIndex, Int16 slave, ref TSlaveInfo ptSlaveInfo);
  1168. /// @brief 根据站号读取EtherCAT从站的PDO数据
  1169. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_H_GetEcatSlavePdoData", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1170. public static extern UInt32 IMC_H_GetEcatSlavePdoData(Int16 cardIndex, Int16 slave, UInt16 index, UInt16 subIndex, Byte[] pData);
  1171. /// @brief 根据站号写入EtherCAT从站的PDO数据
  1172. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_H_SetEcatSlavePdoData", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1173. public static extern UInt32 IMC_H_SetEcatSlavePdoData(Int16 cardIndex, Int16 slave, UInt16 index, UInt16 subIndex, Byte[] pData);
  1174. /// @brief 根据站号获取EtherCAT从站的SDO数据
  1175. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_H_GetEcatSlaveSdo", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1176. public static extern UInt32 IMC_H_GetEcatSlaveSdo(Int16 cardIndex, Int16 slave, UInt16 index, UInt16 subIndex, Byte[] pData, UInt32 dataSize, ref UInt32 pResultSize, ref UInt32 pAbortCode);
  1177. /// @brief 根据站号写入EtherCAT从站的SDO数据
  1178. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_H_SetEcatSlaveSdo", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1179. public static extern UInt32 IMC_H_SetEcatSlaveSdo(Int16 cardIndex, Int16 slave, UInt16 index, UInt16 subIndex, Byte[] pData, UInt32 dataSize, ref UInt32 pAbortCode);
  1180. /// @brief 获取EtherCAT的DI输入状态, 按16bits为一组进行获取
  1181. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_H_GetEcatDi", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1182. public static extern UInt32 IMC_H_GetEcatDi(Int16 cardIndex, Int16 packIndex, UInt16[] pValue, Int16 packCnt);
  1183. /// @brief 设置EtherCAT的DO输出状态, 按16bits为一组进行设置
  1184. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_H_SetEcatDo", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1185. public static extern UInt32 IMC_H_SetEcatDo(Int16 cardIndex, Int16 packIndex, UInt16[] pValue, Int16 packCnt);
  1186. /// @brief 获取EtherCAT的DO输出状态, 按16bits为一组进行获取
  1187. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_H_GetEcatDo", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1188. public static extern UInt32 IMC_H_GetEcatDo(Int16 cardIndex, Int16 packIndex, UInt16[] pValue, Int16 packCnt);
  1189. /// @brief 获取EtherCAT的DI输入状态, 按位进行获取
  1190. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_H_GetEcatDiBit", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1191. public static extern UInt32 IMC_H_GetEcatDiBit(Int16 cardIndex, Int16 diIndex, ref Int16 pValue);
  1192. /// @brief 获取EtherCAT的DO输出状态, 按位进行获取
  1193. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_H_GetEcatDoBit", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1194. public static extern UInt32 IMC_H_GetEcatDoBit(Int16 cardIndex, Int16 doIndex, ref Int16 pValue);
  1195. /// @brief 设置EtherCAT的DO输出状态, 按位进行设置
  1196. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_H_SetEcatDoBit", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1197. public static extern UInt32 IMC_H_SetEcatDoBit(Int16 cardIndex, Int16 doIndex, Int16 value);
  1198. /// @brief 根据通道号获取EtherCAT对应通道的AD值
  1199. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_H_GetEcatAdVal", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1200. public static extern UInt32 IMC_H_GetEcatAdVal(Int16 cardIndex, Int16 adIndex, ref Int16 pValue);
  1201. /// @brief 根据通道号设置EtherCAT对应通道的DA值
  1202. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_H_SetEcatDaVal", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1203. public static extern UInt32 IMC_H_SetEcatDaVal(Int16 cardIndex, Int16 daIndex, Int16 Value);
  1204. /// @brief 根据通道号获取EtherCAT对应通道的DA值
  1205. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_H_GetEcatDaVal", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1206. public static extern UInt32 IMC_H_GetEcatDaVal(Int16 cardIndex, Int16 daIndex, ref Int16 pValue);
  1207. /// @brief 根据通道号获取EtherCAT对应通道的RegIn值
  1208. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_H_GetEcatRegInVal", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1209. public static extern UInt32 IMC_H_GetEcatRegInVal(Int16 cardIndex, Int16 regIndex, ref float pValue);
  1210. /// @brief 根据通道号设置EtherCAT对应通道的RegOut值
  1211. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_H_SetEcatRegOutVal", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1212. public static extern UInt32 IMC_H_SetEcatRegOutVal(Int16 cardIndex, Int16 regIndex, float Value);
  1213. /// @brief 根据通道号获取EtherCAT对应通道的RegOut值
  1214. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_H_GetEcatRegOutVal", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1215. public static extern UInt32 IMC_H_GetEcatRegOutVal(Int16 cardIndex, Int16 regIndex, ref float pValue);
  1216. /// @brief 根据通道号获取EtherCAT对应通道的AD值
  1217. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_H_GetEcatAd", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1218. public static extern UInt32 IMC_H_GetEcatAd(Int16 cardIndex, Int16 adIndex, Int16[] pValueArray, Int16 count);
  1219. /// @brief 根据通道号设置EtherCAT对应通道的DA值
  1220. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_H_SetEcatDa", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1221. public static extern UInt32 IMC_H_SetEcatDa(Int16 cardIndex, Int16 daIndex, Int16[] pValueArray, Int16 count);
  1222. /// @brief 根据通道号获取EtherCAT对应通道的DA值
  1223. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_H_GetEcatDa", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1224. public static extern UInt32 IMC_H_GetEcatDa(Int16 cardIndex, Int16 daIndex, Int16[] pValueArray, Int16 count);
  1225. /// @brief 根据通道号获取EtherCAT对应通道的RegIn值
  1226. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_H_GetEcatRegIn", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1227. public static extern UInt32 IMC_H_GetEcatRegIn(Int16 cardIndex, Int16 regIndex, float[] pValueArray, Int16 count);
  1228. /// @brief 根据通道号设置EtherCAT对应通道的RegOut值
  1229. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_H_SetEcatRegOut", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1230. public static extern UInt32 IMC_H_SetEcatRegOut(Int16 cardIndex, Int16 regIndex, float[] pValueArray, Int16 count);
  1231. /// @brief 根据通道号获取EtherCAT对应通道的RegOut值
  1232. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_H_GetEcatRegOut", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1233. public static extern UInt32 IMC_H_GetEcatRegOut(Int16 cardIndex, Int16 regIndex, float[] pValueArray, Int16 count);
  1234. #endregion
  1235. #endregion
  1236. ///@defgroup LocalBus LocalBus
  1237. ///@brief 板卡端子板功能
  1238. #region LocalBus
  1239. ///@defgroup LocalInfo LocalInfo
  1240. ///@brief 板卡端子板信息获取
  1241. #region LocalInfo
  1242. /// @brief 获取端子板的工作状态
  1243. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetLocalBoardWorkSts", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1244. public static extern UInt32 IMC_GetLocalBoardWorkSts(Int16 cardIndex, ref Int16 pValue);
  1245. #endregion
  1246. ///@defgroup LocalParam LocalParam
  1247. ///@brief 板卡端子板参数设置
  1248. #region LocalParam
  1249. /// @brief 设置端子板 DI 滤波时间
  1250. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetLocalDiFilterTime", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1251. public static extern UInt32 IMC_SetLocalDiFilterTime(Int16 cardIndex, UInt16 filterTime);
  1252. /// @brief 读取端子板 DI 滤波时间
  1253. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetLocalDiFilterTime", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1254. public static extern UInt32 IMC_GetLocalDiFilterTime(Int16 cardIndex, ref UInt16 pFilterTime);
  1255. /// @brief 设置端子板编码器滤波参数
  1256. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetLocalEncFilterPara", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1257. public static extern UInt32 IMC_SetLocalEncFilterPara(Int16 cardIndex, Int16 filterDepth, Int16 filterCoef);
  1258. /// @brief 读取端子板编码器滤波参数
  1259. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetLocalEncFilterPara", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1260. public static extern UInt32 IMC_GetLocalEncFilterPara(Int16 cardIndex, ref Int16 pFilterDepth, ref Int16 pFilterCoef);
  1261. /// @brief 设置端子板编码器计数方向
  1262. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetLocalEncDir", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1263. public static extern UInt32 IMC_SetLocalEncDir(Int16 cardIndex, Int16 encIndex, Int16[] pDirArray, Int16 count = 1);
  1264. /// @brief 读取端子板编码器计数方向
  1265. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetLocalEncDir", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1266. public static extern UInt32 IMC_GetLocalEncDir(Int16 cardIndex, Int16 encIndex, Int16[] pDirArray, Int16 count = 1);
  1267. #endregion
  1268. ///@defgroup LocalDIO LocalDIO
  1269. ///@brief 板卡端子板IO操作
  1270. #region LocalDIO
  1271. /// @brief 获取本地 DI 值
  1272. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetLocalDi", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1273. public static extern UInt32 IMC_GetLocalDi(Int16 cardIndex, ref Int16 pValue);
  1274. /// @brief 设置本地 DO 值
  1275. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetLocalDo", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1276. public static extern UInt32 IMC_SetLocalDo(Int16 cardIndex, Int16 value);
  1277. /// @brief 读取本地 DO 值
  1278. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetLocalDo", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1279. public static extern UInt32 IMC_GetLocalDo(Int16 cardIndex, ref Int16 pValue);
  1280. #endregion
  1281. /// @brief 按位获取本地第 diIndex 个 DI 值
  1282. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetLocalDiBit", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1283. public static extern UInt32 IMC_GetLocalDiBit(Int16 cardIndex, Int16 diIndex, ref Int16 pValue);
  1284. /// @brief 按位设置本地第 doIndex 个 DO 值
  1285. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetLocalDoBit", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1286. public static extern UInt32 IMC_SetLocalDoBit(Int16 cardIndex, Int16 doIndex, Int16 value);
  1287. /// @brief 按位设置本地第 doIndex 个 DO 值
  1288. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetLocalDoBit", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1289. public static extern UInt32 IMC_GetLocalDoBit(Int16 cardIndex, Int16 doIndex, ref Int16 pValue);
  1290. /// @brief 按位脉冲输出本地第 doIndex 个 DO
  1291. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetLocalDoBitPulse", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1292. public static extern UInt32 IMC_SetLocalDoBitPulse(Int16 cardIndex, Int16 doIndex, Int16 enable, UInt16 highLevelTime, UInt16 lowLevelTime, Int16 pulseNum, Int16 firstLevel);
  1293. ///@defgroup LocalEnc LocalEnc
  1294. ///@brief 板卡端子板编码器操作
  1295. #region LocalEnc
  1296. /// @brief 设置编码器值
  1297. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetLocalEncPos", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1298. public static extern UInt32 IMC_SetLocalEncPos(Int16 cardIndex, Int16 encIndex, Int32 encPos);
  1299. /// @brief 读取编码器值
  1300. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetLocalEncPos", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1301. public static extern UInt32 IMC_GetLocalEncPos(Int16 cardIndex, Int16 encIndex, Int32[] pEncPosArray, Int16 count = 1);
  1302. /// @brief 读取编码器速度
  1303. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetLocalEncVel", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1304. public static extern UInt32 IMC_GetLocalEncVel(Int16 cardIndex, Int16 encIndex, Int32[] pEncVelArray, Int16 count = 1);
  1305. #endregion
  1306. ///@defgroup LocalCapt LocalCapt
  1307. ///@brief 板卡端子板捕获功能
  1308. #region LocalCapt
  1309. /// @brief 设置端子板编码器位置捕获模式, 配置捕获参数
  1310. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetLocalCaptMode", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1311. public static extern UInt32 IMC_SetLocalCaptMode(Int16 cardIndex, Int16 encIndex, Int16 trigType, Int16 edge);
  1312. /// @brief 获取端子板编码器位置捕获模式配置参数
  1313. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetLocalCaptMode", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1314. public static extern UInt32 IMC_GetLocalCaptMode(Int16 cardIndex, Int16 encIndex, ref Int16 pTrigType, ref Int16 pEdge);
  1315. /// @brief 获取端子板编码器位置捕获状态
  1316. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetLocalCaptStatus", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1317. public static extern UInt32 IMC_GetLocalCaptStatus(Int16 cardIndex, Int16 encIndex, ref Int16 pSts, ref Int32 pPosVal, ref Int32 pNegVal);
  1318. /// @brief 设置端子板编码器连续位置捕获模式, 配置连续捕获参数
  1319. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetLocalCaptRepeatMode", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1320. public static extern UInt32 IMC_SetLocalCaptRepeatMode(Int16 cardIndex, Int16 encIndex, Int16 trigType, Int16 edge, Int16 captCount);
  1321. /// @brief 设置端子板编码器连续位置捕获模式配置参数
  1322. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetLocalCaptRepeatMode", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1323. public static extern UInt32 IMC_GetLocalCaptRepeatMode(Int16 cardIndex, Int16 encIndex, ref Int16 pTrigType, ref Int16 pEdge, ref Int16 pCaptCount);
  1324. /// @brief 获取端子板编码器连续位置捕获状态
  1325. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetLocalCaptRepeatStatus", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1326. public static extern UInt32 IMC_GetLocalCaptRepeatStatus(Int16 cardIndex, Int16 encIndex, ref Int16 pCaptSts, ref Int16 pCaptCount);
  1327. /// @brief 获取端子板编码器连续位置捕获位置
  1328. /// @attention 双沿沿捕获时, 开辟存储数组长度应为 IMC_SetLocalCaptRepeatMode 设置 的 captCount 的 2 倍
  1329. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetLocalCaptRepeatPos", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1330. public static extern UInt32 IMC_GetLocalCaptRepeatPos(Int16 cardIndex, Int16 encIndex, Int16 startNo, Int16 count, Int32[] pCaptPosArray);
  1331. #endregion
  1332. ///@defgroup LocalPWM LocalPWM
  1333. ///@brief 板卡端子板PWM功能
  1334. #region LocalPWM
  1335. /// @brief 设置端子板PWM的输出参数
  1336. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetLocalPwmPara", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1337. public static extern UInt32 IMC_SetLocalPwmPara(Int16 cardIndex, Int16 chn, Int32 frequency, double dutyRatio);
  1338. /// @brief 获取端子板PWM的输出参数
  1339. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetLocalPwmPara", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1340. public static extern UInt32 IMC_GetLocalPwmPara(Int16 cardIndex, Int16 chn, ref Int32 pFrequency, ref double pDutyRatio);
  1341. /// @brief 设置端子板PWM的输出频率
  1342. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetLocalPwmFrq", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1343. public static extern UInt32 IMC_SetLocalPwmFrq(Int16 cardIndex, Int16 chn, Int32 frequency);
  1344. /// @brief 设置端子板PWM的输出占空比
  1345. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetLocalPwmDuty", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1346. public static extern UInt32 IMC_SetLocalPwmDuty(Int16 cardIndex, Int16 chn, double dutyRatio);
  1347. /// @brief 设置端子板PWM输出的开关及延时时间
  1348. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetLocalPwmOnOffDelay", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1349. public static extern UInt32 IMC_SetLocalPwmOnOffDelay(Int16 cardIndex, Int16 chn, Int16 onOff, UInt16 delay);
  1350. #endregion
  1351. ///@defgroup LocalCompare LocalCompare
  1352. ///@brief 板卡端子板位置比较功能
  1353. #region LocalCompare
  1354. /// @brief 设置端子板位置比较输出源的配置
  1355. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetLocalCmpSrcCfg", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1356. public static extern UInt32 IMC_SetLocalCmpSrcCfg(Int16 cardIndex, Int16 chn, Int16 compSrc);
  1357. /// @brief 设置端子板比较物理信号输出的配置
  1358. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetLocalCmpOutputCfg", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1359. public static extern UInt32 IMC_SetLocalCmpOutputCfg(Int16 cardIndex, Int16 chn, Int16 ctrlMode, Int16 stLevel, Int16 outputType, UInt16 pulseWidth);
  1360. /// @brief 设置端子板比较数据的类型
  1361. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetLocalCmpDataType", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1362. public static extern UInt32 IMC_SetLocalCmpDataType(Int16 cardIndex, Int16 chn, Int16 type);
  1363. /// @brief 获取端子板比较数据的类型
  1364. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetLocalCmpDataType", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1365. public static extern UInt32 IMC_GetLocalCmpDataType(Int16 cardIndex, Int16 chn, ref Int16 pType);
  1366. /// @brief 设置端子板位置比较的位置类型
  1367. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetLocalCmpPosType", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1368. public static extern UInt32 IMC_SetLocalCmpPosType(Int16 cardIndex, Int16 chn, Int16 type);
  1369. /// @brief 获取端子板位置比较的位置类型
  1370. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetLocalCmpPosType", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1371. public static extern UInt32 IMC_GetLocalCmpPosType(Int16 cardIndex, Int16 chn, ref Int16 pType);
  1372. /// @brief 设置本地输出 EX-O bit0 ~ 3 位位置比较输出类型
  1373. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetLocalGpoType", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1374. public static extern UInt32 IMC_SetLocalGpoType(Int16 cardIndex, Int16 doIndex, Int16 type);
  1375. /// @brief 获取本地输出 EX-O bit0 ~ 3 位位置比较输出类型配置
  1376. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetLocalGpoType", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1377. public static extern UInt32 IMC_GetLocalGpoType(Int16 cardIndex, Int16 doIndex, ref Int16 pType);
  1378. /// @brief 获取端子板位置比较的状态
  1379. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetLocalCmpSts", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1380. public static extern UInt32 IMC_GetLocalCmpSts(Int16 cardIndex, Int16 chn, ref Int16 pCmpSts, ref Int32 pCmpCount);
  1381. /// @brief 设置端子板手动输出脉冲或电平
  1382. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetLocalCmpManualOut", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1383. public static extern UInt32 IMC_SetLocalCmpManualOut(Int16 cardIndex, Int16 chn, Int16 outval);
  1384. /// @brief 设置端子板多脉冲手动输出
  1385. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetLocalCmpManualMultiOut", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1386. public static extern UInt32 IMC_SetLocalCmpManualMultiOut(Int16 cardIndex, Int16 chn, UInt16 pulseNum, UInt16 pulseCycle);
  1387. /// @brief 设置端子板等间距线性比较输出
  1388. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetLocalCmpLinearOut", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1389. public static extern UInt32 IMC_SetLocalCmpLinearOut(Int16 cardIndex, Int16 chn, Int32 intrvalLen, Int32 cmpCount);
  1390. /// @brief 停止端子板比较输出
  1391. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_StopLocalCmpOut", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1392. public static extern UInt32 IMC_StopLocalCmpOut(Int16 cardIndex, Int16 chn);
  1393. /// @brief 启动端子板比较输出
  1394. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_StartLocalCmpOut", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1395. public static extern UInt32 IMC_StartLocalCmpOut(Int16 cardIndex, Int16 chn);
  1396. /// @brief 设置端子板一维位置比较输出数据
  1397. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetLocalCmpData", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1398. public static extern UInt32 IMC_SetLocalCmpData(Int16 cardIndex, Int16 chn, Int16 compCount, Int32[] pPosBufArray);
  1399. #endregion
  1400. ///@defgroup LocalMultCompare LocalMultCompare
  1401. ///@brief 板卡端子板多维位置比较功能
  1402. #region LocalMultCompare
  1403. /// @brief 设置端子板位置比较输出源的配置
  1404. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetLocalMultiCmpSrcCfg", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1405. public static extern UInt32 IMC_SetLocalMultiCmpSrcCfg(Int16 cardIndex, Int16 chn, Int16 dimension, Int16[] pCompSrcArray);
  1406. /// @brief 设置端子板比较物理信号输出的配置
  1407. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetLocalMultiCmpOutputCfg", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1408. public static extern UInt32 IMC_SetLocalMultiCmpOutputCfg(Int16 cardIndex, Int16 chn, Int16 stLevel, Int16 outputType, UInt16 pulseWidth);
  1409. /// @brief 获取端子板位置比较的状态
  1410. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetLocalMultiCmpSts", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1411. public static extern UInt32 IMC_GetLocalMultiCmpSts(Int16 cardIndex, Int16 chn, ref Int16 pCmpSts, ref Int32 pCmpCount);
  1412. /// @brief 设置端子板比较数据的类型
  1413. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetLocalMultiCmpDataType", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1414. public static extern UInt32 IMC_SetLocalMultiCmpDataType(Int16 cardIndex, Int16 chn, Int16 type);
  1415. /// @brief 获取端子板比较数据的类型
  1416. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetLocalMultiCmpDataType", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1417. public static extern UInt32 IMC_GetLocalMultiCmpDataType(Int16 cardIndex, Int16 chn, ref Int16 pType);
  1418. /// @brief 设置端子板多维位置比较参数
  1419. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetLocalMultiCmpPara", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1420. public static extern UInt32 IMC_SetLocalMultiCmpPara(Int16 cardIndex, Int16 chn, UInt16 syncDeltaPos, Int16 outPinType);
  1421. /// @brief 获取端子板多维位置比较参数
  1422. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetLocalMultiCmpPara", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1423. public static extern UInt32 IMC_GetLocalMultiCmpPara(Int16 cardIndex, Int16 chn, ref UInt16 pSyncDeltaPos, ref Int16 pOutPinType);
  1424. /// @brief 设置多维比较位置点
  1425. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetLocalMultiCmpData", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1426. public static extern UInt32 IMC_SetLocalMultiCmpData(Int16 cardIndex, Int16 chn, TMultiCmpData[] pComparaDataArray, Int16 count);
  1427. /// @brief 启动端子板比较输出
  1428. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_StartLocalMultiCmpOut", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1429. public static extern UInt32 IMC_StartLocalMultiCmpOut(Int16 cardIndex, Int16 chn);
  1430. /// @brief 停止端子板比较输出
  1431. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_StopLocalMultiCmpOut", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1432. public static extern UInt32 IMC_StopLocalMultiCmpOut(Int16 cardIndex, Int16 chn);
  1433. #endregion
  1434. ///@defgroup LocalPSO LocalPSO
  1435. ///@brief 板卡端子板PSO功能
  1436. #region LocalPSO
  1437. /// @brief 设置端子板PSO功能参数
  1438. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetLocalPSOPara", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1439. public static extern UInt32 IMC_SetLocalPSOPara(Int16 cardIndex, Int16 chn, Int16 dimension, Int16 pinType, Int16[] pPsoPosIndexArray, UInt16 outPlsWidth, Int32 syncDeltaPos);
  1440. /// @brief 获取端子板PSO功能参数配置
  1441. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetLocalPSOPara", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1442. public static extern UInt32 IMC_GetLocalPSOPara(Int16 cardIndex, Int16 chn, ref Int16 pDimension, ref Int16 pPinType, Int16[] pPsoPosIndexArray, ref UInt16 pOutPlsWidth, ref Int32 pSyncDeltaPos);
  1443. /// @brief 设置PSO基频
  1444. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetLocalPSOBaseFrq", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1445. public static extern UInt32 IMC_SetLocalPSOBaseFrq(Int16 cardIndex, Int16 chn, Int16 baseFrq);
  1446. /// @brief 获取PSO基频
  1447. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetLocalPSOBaseFrq", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1448. public static extern UInt32 IMC_GetLocalPSOBaseFrq(Int16 cardIndex, Int16 chn, ref Int16 pBaseFrq);
  1449. /// @brief 启动PSO输出
  1450. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_StartLocalPSO", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1451. public static extern UInt32 IMC_StartLocalPSO(Int16 cardIndex, Int16 chn);
  1452. /// @brief 停止PSO输出
  1453. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_StopLocalPSO", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1454. public static extern UInt32 IMC_StopLocalPSO(Int16 cardIndex, Int16 chn);
  1455. /// @brief 获取PSO输出状态
  1456. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetLocalPSOSts", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1457. public static extern UInt32 IMC_GetLocalPSOSts(Int16 cardIndex, Int16 chn, ref Int16 pSts, ref UInt16 pPsoCount);
  1458. #endregion
  1459. #endregion
  1460. ///@defgroup Axis Axis
  1461. ///@brief 板卡轴操作相关函数
  1462. #region Axis
  1463. ///@defgroup AxisConfig AxisConfig
  1464. ///@brief 板卡轴配置函数
  1465. #region AxisConfig
  1466. /// @brief 设置轴激活状态
  1467. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetAxActive", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1468. public static extern UInt32 IMC_SetAxActive(Int16 cardIndex, Int16 axNo, Int16 active);
  1469. /// @brief 读取轴激活状态
  1470. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetAxActive", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1471. public static extern UInt32 IMC_GetAxActive(Int16 cardIndex, Int16 axNo, ref Int16 pActive);
  1472. /// @brief 设置控制器单轴安全运行参数
  1473. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetAxMaxMtPara", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1474. public static extern UInt32 IMC_SetAxMaxMtPara(Int16 cardIndex, Int16 axNo, ref TMtPara pMtPara);
  1475. /// @brief 读取控制器单轴安全运行参数
  1476. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetAxMaxMtPara", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1477. public static extern UInt32 IMC_GetAxMaxMtPara(Int16 cardIndex, Int16 axNo, ref TMtPara pMtPara);
  1478. /// @brief 设置轴当量参数
  1479. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetAxEquiv", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1480. public static extern UInt32 IMC_SetAxEquiv(Int16 cardIndex, Int16 axNo, double[] pAxEquArray, Int16 count = 1);
  1481. /// @brief 获取轴当量参数
  1482. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetAxEquiv", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1483. public static extern UInt32 IMC_GetAxEquiv(Int16 cardIndex, Int16 axNo, double[] pAxEquArray, Int16 count = 1);
  1484. /// @brief 设置轴输出绑定
  1485. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetAxBondCfg", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1486. public static extern UInt32 IMC_SetAxBondCfg(Int16 cardIndex, Int16 axNo, Int16 axType, Int16 outputChn);
  1487. /// @brief 获取轴输出绑定
  1488. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetAxBondCfg", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1489. public static extern UInt32 IMC_GetAxBondCfg(Int16 cardIndex, Int16 axNo, ref Int16 pAxType, ref Int16 pOutputChn);
  1490. /// @brief 复位轴绑定状态, 让所有轴恢复到虚轴状态
  1491. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_ResetAxBondCfg", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1492. public static extern UInt32 IMC_ResetAxBondCfg(Int16 cardIndex);
  1493. /// @brief 设置轴属性参数, 包含软限位、到位误差、最大跟随误差
  1494. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetAxAttriPara", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1495. public static extern UInt32 IMC_SetAxAttriPara(Int16 cardIndex, Int16 axNo, ref TAxAttriPara pAxAttriPara);
  1496. /// @brief 获取轴属性参数, 包含软限位、到位误差、最大跟随误差
  1497. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetAxAttriPara", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1498. public static extern UInt32 IMC_GetAxAttriPara(Int16 cardIndex, Int16 axNo, ref TAxAttriPara pAxAttriPara);
  1499. /// @brief 设置轴软限位
  1500. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetAxSoftLimit", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1501. public static extern UInt32 IMC_SetAxSoftLimit(Int16 cardIndex, Int16 axNo, Int32 positive, Int32 negative);
  1502. /// @brief 获取轴软限位
  1503. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetAxSoftLimit", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1504. public static extern UInt32 IMC_GetAxSoftLimit(Int16 cardIndex, Int16 axNo, ref Int32 pPositive, ref Int32 pNegative);
  1505. /// @brief 设置轴到位检查参数
  1506. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetAxArrivalBand", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1507. public static extern UInt32 IMC_SetAxArrivalBand(Int16 cardIndex, Int16 axNo, Int16 arrivalBand, UInt16 arrivalTime);
  1508. /// @brief 获取轴到位检查参数
  1509. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetAxArrivalBand", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1510. public static extern UInt32 IMC_GetAxArrivalBand(Int16 cardIndex, Int16 axNo, ref Int16 pArrivalBand, ref UInt16 pArrivalTime);
  1511. /// @brief 设置轴最大跟随误差
  1512. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetAxErrorPos", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1513. public static extern UInt32 IMC_SetAxErrorPos(Int16 cardIndex, Int16 axNo, Int32 errorPos);
  1514. /// @brief 获取轴最大跟随误差
  1515. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetAxErrorPos", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1516. public static extern UInt32 IMC_GetAxErrorPos(Int16 cardIndex, Int16 axNo, ref Int32 pErrorPos);
  1517. /// @brief 设置轴反向间隙补偿
  1518. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetAxBacklash", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1519. public static extern UInt32 IMC_SetAxBacklash(Int16 cardIndex, Int16 axNo, Int32 wholeCmpVal, Int32 cmpVel, Int16 cmpDir);
  1520. /// @brief 获取轴反向间隙补偿
  1521. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetAxBacklash", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1522. public static extern UInt32 IMC_GetAxBacklash(Int16 cardIndex, Int16 axNo, ref Int32 pWholeCmpVal, ref Int32 pCmpVel, ref Int16 pCmpDir);
  1523. /// @brief 设置轴安全检查使能综合配置
  1524. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetAxSafeCheck", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1525. public static extern UInt32 IMC_SetAxSafeCheck(Int16 cardIndex, Int16 axNo, ref TAxCheckEn pAxCheckEn);
  1526. /// @brief 获取轴安全检查使能综合配置
  1527. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetAxSafeCheck", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1528. public static extern UInt32 IMC_GetAxSafeCheck(Int16 cardIndex, Int16 axNo, ref TAxCheckEn pAxCheckEn);
  1529. /// @brief 设置轴报警检查使能配置
  1530. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetAxAlarmCheck", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1531. public static extern UInt32 IMC_SetAxAlarmCheck(Int16 cardIndex, Int16 axNo, Int16 enable, Int16 count = 1);
  1532. /// @brief 设置轴软限位检查使能配置
  1533. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetAxSoftLmtsCheck", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1534. public static extern UInt32 IMC_SetAxSoftLmtsCheck(Int16 cardIndex, Int16 axNo, Int16 enable, Int16 count = 1);
  1535. /// @brief 设置轴硬限位检查使能配置
  1536. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetHwLmtsCheck", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1537. public static extern UInt32 IMC_SetHwLmtsCheck(Int16 cardIndex, Int16 axNo, Int16 enable, Int16 count = 1);
  1538. /// @brief 设置轴跟随误差位检查使能配置
  1539. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetAxErrPosCheck", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1540. public static extern UInt32 IMC_SetAxErrPosCheck(Int16 cardIndex, Int16 axNo, Int16 enable, Int16 count = 1);
  1541. /// @brief 设定轴停止的平滑停止减速度和急停减速度
  1542. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetAxStopDec", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1543. public static extern UInt32 IMC_SetAxStopDec(Int16 cardIndex, Int16 axNo, double decSmoothStop, double decAbruptStop);
  1544. /// @brief 获取轴停止的平滑停止减速度和急停减速度
  1545. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetAxStopDec", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1546. public static extern UInt32 IMC_GetAxStopDec(Int16 cardIndex, Int16 axNo, ref double pDecSmoothStop, ref double pDecAbruptStop);
  1547. /// @brief 设定轴急停减速限制时间
  1548. /// @details 急停时根据当前速度和设定的急停减速度计算停止时间, 若超过设定的限制时间, 则按照当前限制时间重新计算减速度, 否则按照设定的减速度执行
  1549. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetAxEmgMaxDecLmt", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1550. public static extern UInt32 IMC_SetAxEmgMaxDecLmt(Int16 cardIndex, Int16 axNo, UInt16 decLmtTime);
  1551. /// @brief 获取轴急停减速限制时间
  1552. /// @details 急停时根据当前速度和设定的急停减速度计算停止时间, 若超过设定的限制时间, 则按照当前限制时间重新计算加速度, 否则按照设定的加速度执行
  1553. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetAxEmgMaxDecLmt", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1554. public static extern UInt32 IMC_GetAxEmgMaxDecLmt(Int16 cardIndex, Int16 axNo, ref UInt16 pDecLmtTime);
  1555. /// @brief 设置轴的结束速度
  1556. /// @details 点位运动时,运动规划结束速度可以不为0,注意合理设置结束速度值,运动规划完成后,结束速度直接突跳速度为0,可能引起机台抖动
  1557. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetAxEndVel", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1558. public static extern UInt32 IMC_SetAxEndVel(Int16 cardIndex, Int16 axNo, double endVel);
  1559. /// @brief 获取轴的结束速度设定
  1560. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetAxEndVel", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1561. public static extern UInt32 IMC_GetAxEndVel(Int16 cardIndex, Int16 axNo, ref double pEndVel);
  1562. /// @brief 设置圆形软限位参数
  1563. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_ArcZoneLmtSetParam", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1564. public static extern UInt32 IMC_ArcZoneLmtSetParam(Int16 cardIndex, Int16[] pAxNoArray, Int32[] pCenterArray, Int32 radius, Int16 sourceType);
  1565. /// @brief 获取圆形软限位参数
  1566. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_ArcZoneLmtGetParam", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1567. public static extern UInt32 IMC_ArcZoneLmtGetParam(Int16 cardIndex, Int16[] pAxNoArray, Int32[] pCenterArray, ref Int32 pRadius, ref Int16 pSourceType);
  1568. /// @brief 使能圆形软限位
  1569. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_ArcZoneLmtEnable", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1570. public static extern UInt32 IMC_ArcZoneLmtEnable(Int16 cardIndex, Int16 enable);
  1571. /// @brief 设置分段软限位参数
  1572. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SegLmtSetParam", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1573. public static extern UInt32 IMC_SegLmtSetParam(Int16 cardIndex, Int16[] pAxNoArray, Int16 sourceType, Int32[] pPointXArray, Int32[] pPointYArray, Int16 pointCount, Int16 yLmtDir);
  1574. /// @brief 获取分段软限位参数
  1575. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SegLmtGetParam", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1576. public static extern UInt32 IMC_SegLmtGetParam(Int16 cardIndex, Int16[] pAxNoArray, ref Int16 pSourceType, Int32[] pPointXArray, Int32[] pPointYArray, ref Int16 pPointCount, ref Int16 pYLmtDir);
  1577. /// @brief 使能分段软限位
  1578. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SegLmtEnable", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1579. public static extern UInt32 IMC_SegLmtEnable(Int16 cardIndex, Int16 enable);
  1580. #endregion
  1581. ///@defgroup AxisStatus AxisStatus
  1582. ///@brief 轴状态监控
  1583. #region AxisStatus
  1584. /// @brief 获取轴规划模式, 该值中包含单轴模式和多轴模式的信息
  1585. /// @todo 是否取消单轴多轴状态分区, 底层需要做修改
  1586. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetAxPrfMode", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1587. public static extern UInt32 IMC_GetAxPrfMode(Int16 cardIndex, Int16 axNo, Int16[] pPrfModeArray, Int16 count = 1);
  1588. /// @brief 获取轴状态
  1589. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetAxSts", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1590. public static extern UInt32 IMC_GetAxSts(Int16 cardIndex, Int16 axNo, Int32[] pAxStsArray, Int16 count = 1);
  1591. /// @brief 清除轴的错误状态, 当发生报警时, 需要调用该指令进行清除, 但如果实际物理报警还在, 则无法清除
  1592. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_ClrAxSts", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1593. public static extern UInt32 IMC_ClrAxSts(Int16 cardIndex, Int16 axNo, Int16 count = 1);
  1594. /// @brief 获取轴规划位置
  1595. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetAxPrfPos", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1596. public static extern UInt32 IMC_GetAxPrfPos(Int16 cardIndex, Int16 axNo, double[] pPrfPosArray, Int16 count = 1);
  1597. /// @brief 获取轴规划速度
  1598. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetAxPrfVel", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1599. public static extern UInt32 IMC_GetAxPrfVel(Int16 cardIndex, Int16 axNo, double[] pPrfVelArray, Int16 count = 1);
  1600. /// @brief 获取轴规划加速度
  1601. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetAxPrfAcc", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1602. public static extern UInt32 IMC_GetAxPrfAcc(Int16 cardIndex, Int16 axNo, double[] pPrfAccArray, Int16 count = 1);
  1603. /// @brief 获取轴编码器反馈位置
  1604. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetAxEncPos", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1605. public static extern UInt32 IMC_GetAxEncPos(Int16 cardIndex, Int16 axNo, double[] pEncPosArray, Int16 count = 1);
  1606. /// @brief 获取轴编码器反馈速度
  1607. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetAxEncVel", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1608. public static extern UInt32 IMC_GetAxEncVel(Int16 cardIndex, Int16 axNo, double[] pEncVelArray, Int16 count = 1);
  1609. /// @brief 获取轴编码器反馈加速度
  1610. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetAxEncAcc", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1611. public static extern UInt32 IMC_GetAxEncAcc(Int16 cardIndex, Int16 axNo, double[] pEncAccArray, Int16 count = 1);
  1612. /// @brief 获取指定轴是否均已到位的状态
  1613. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetMultiAxArrivalSts", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1614. public static extern UInt32 IMC_GetMultiAxArrivalSts(Int16 cardIndex, UInt32 axMask, ref Int16 pSts, Int16 groupNo);
  1615. /// @brief 获取轴反向间隙差值
  1616. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetAxBacklashCmpVal", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1617. public static extern UInt32 IMC_GetAxBacklashCmpVal(Int16 cardIndex, Int16 axNo, ref Int32 pCmpVal);
  1618. /// @brief 获取轴规划位置(32位整形指令)
  1619. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetAxPrfPos32", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1620. public static extern UInt32 IMC_GetAxPrfPos32(Int16 cardIndex, Int16 axNo, Int32[] pPrfPosArray, Int16 count = 1);
  1621. /// @brief 获取轴编码器反馈位置(32位整形指令)
  1622. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetAxEncPos32", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1623. public static extern UInt32 IMC_GetAxEncPos32(Int16 cardIndex, Int16 axNo, Int32[] pEncPosArray, Int16 count = 1);
  1624. /// @brief 获取轴规划位置(脉冲位置指令)
  1625. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetPrfPos", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1626. public static extern UInt32 IMC_GetPrfPos(Int16 cardIndex, Int16 axNo, double[] pPrfPosArray, Int16 count = 1);
  1627. /// @brief 获取轴编码器原点位置
  1628. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetAxOrgEncPos", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1629. public static extern UInt32 IMC_GetAxOrgEncPos(Int16 cardIndex, Int16 axNo, Int32[] pOrgEncPosArray, Int16 count = 1);
  1630. /// @brief 获取轴停止原因
  1631. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetAxStopReason", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1632. public static extern UInt32 IMC_GetAxStopReason(Int16 cardIndex, Int16 axNo, Int16[] pAxStopReason, Int16 count = 1);
  1633. /// @brief 获取轴状态(Ex指令)
  1634. /// @todo 补充ex类型指令描述
  1635. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetAxStsEx", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1636. public static extern UInt32 IMC_GetAxStsEx(Int16 cardIndex, Int16 axNo, Int32[] pAxStsArray, Int16 count = 1);
  1637. /// @brief 获取轴规划位置(Ex指令)
  1638. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetAxPrfPosEx", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1639. public static extern UInt32 IMC_GetAxPrfPosEx(Int16 cardIndex, Int16 axNo, double[] pPrfPosArray, Int16 count = 1);
  1640. /// @brief 获取轴编码器反馈位置(Ex指令)
  1641. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetAxEncPosEx", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1642. public static extern UInt32 IMC_GetAxEncPosEx(Int16 cardIndex, Int16 axNo, double[] pEncPosArray, Int16 count = 1);
  1643. /// @brief 获取 EtherCAT 类型轴的实际转矩, 根据count值可一次获取多个轴的扭矩(Ex类型指令)
  1644. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetAxActTorqEx", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1645. public static extern UInt32 IMC_GetAxActTorqEx(Int16 cardIndex, Int16 axNo, Int16[] pActTorqArray, Int16 count = 1);
  1646. #endregion
  1647. ///@defgroup AxisControl AxisControl
  1648. ///@brief 轴功能控制
  1649. #region AxisControl
  1650. /// @brief 使能伺服
  1651. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_ServoOn", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1652. public static extern UInt32 IMC_ServoOn(Int16 cardIndex, Int16 axNo, Int16 count = 1);
  1653. /// @brief 关闭伺服
  1654. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_ServoOff", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1655. public static extern UInt32 IMC_ServoOff(Int16 cardIndex, Int16 axNo, Int16 count = 1);
  1656. /// @brief 停止单轴轴运动
  1657. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_StopMove", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1658. public static extern UInt32 IMC_StopMove(Int16 cardIndex, Int16 axNo, Int16 stopType);
  1659. /// @brief 按位停止单轴轴运动
  1660. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_StopMoveBits", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1661. public static extern UInt32 IMC_StopMoveBits(Int16 cardIndex, UInt32 axMask, UInt32 stopTypeBits);
  1662. /// @brief 设置轴的触发停止参数
  1663. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetAxStopTrigPara", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1664. public static extern UInt32 IMC_SetAxStopTrigPara(Int16 cardIndex, Int16 axNo, Int16 uselessFlag, Int16 bitNo, Int16 stopType, Int16 diType);
  1665. /// @brief 获取轴的触发停止参数
  1666. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetAxStopTrigPara", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1667. public static extern UInt32 IMC_GetAxStopTrigPara(Int16 cardIndex, Int16 axNo, ref Int16 pUselessFlag, ref Int16 pBitNo, ref Int16 pStopType, ref Int16 pDiType);
  1668. /// @brief 设置当前轴位置为用户指定位置
  1669. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetAxCurPos", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1670. public static extern UInt32 IMC_SetAxCurPos(Int16 cardIndex, Int16 axNo, double setPos);
  1671. /// @brief 同步轴位置, 将轴的规划位置与编码器位置同步
  1672. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SyncAxPos", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1673. public static extern UInt32 IMC_SyncAxPos(Int16 cardIndex, Int16 axNo);
  1674. #endregion
  1675. #endregion
  1676. ///@defgroup MotionControl MotionControl
  1677. ///@brief 板卡运动模式
  1678. #region MotionControl
  1679. ///@defgroup MotionPara MotionPara
  1680. ///@brief 全局运动参数相关接口
  1681. #region MotionPara
  1682. /// @brief 设置单轴运动参数
  1683. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetAxMvPara", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1684. public static extern UInt32 IMC_SetAxMvPara(Int16 cardIndex, Int16 axNo, double vel, double acc, double dec);
  1685. /// @brief 获取单轴运动参数
  1686. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetAxMvPara", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1687. public static extern UInt32 IMC_GetAxMvPara(Int16 cardIndex, Int16 axNo, ref double pVel, ref double pAcc, ref double pDec);
  1688. /// @brief 设定单轴速度规划类型
  1689. /// @details ratio 越大, 则 S 越接近 T 型速度规划, 冲击也越大; 反之, ratio 越小, 则规划越平顺, 冲击越小
  1690. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetAxVelType", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1691. public static extern UInt32 IMC_SetAxVelType(Int16 cardIndex, Int16 axNo, Int16 velType, double ratio);
  1692. /// @brief 获取单轴速度规划类型
  1693. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetAxVelType", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1694. public static extern UInt32 IMC_GetAxVelType(Int16 cardIndex, Int16 axNo, ref Int16 pVelType, ref double pRatio);
  1695. #endregion
  1696. ///@defgroup BasicMotion BasicMotion
  1697. ///@brief 基础运动功能
  1698. #region BasicMotion
  1699. ///@defgroup EcatAxisHoming EcatAxisHoming
  1700. ///@brief 板卡ECAT轴402回零功能功能
  1701. #region EcatAxisHoming
  1702. /// @brief 设置EtherCAT类型轴402回零参数
  1703. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetEcatHomingPara", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1704. public static extern UInt32 IMC_SetEcatHomingPara(Int16 cardIndex, Int16 axNo, Int16 method, UInt32 highVel, UInt32 lowVel, UInt32 acc, Int32 offset);
  1705. /// @brief 将EtherCAT类型轴设置为回零模式
  1706. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetEcatHomingMode", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1707. public static extern UInt32 IMC_SetEcatHomingMode(Int16 cardIndex, Int16 axNo);
  1708. /// @brief 控制EtherCAT类型轴开始402回零
  1709. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_StartEcatHoming", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1710. public static extern UInt32 IMC_StartEcatHoming(Int16 cardIndex, Int16 axNo);
  1711. /// @brief 控制EtherCAT类型轴停止402回零
  1712. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_StopEcatHoming", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1713. public static extern UInt32 IMC_StopEcatHoming(Int16 cardIndex, Int16 axNo);
  1714. /// @brief 控制EtherCAT类型轴退出回零模式
  1715. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_ExitEcatHomingMode", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1716. public static extern UInt32 IMC_ExitEcatHomingMode(Int16 cardIndex, Int16 axNo);
  1717. /// @brief 获取EtherCAT类型轴的402回零状态
  1718. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetHomingStatus", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1719. public static extern UInt32 IMC_GetHomingStatus(Int16 cardIndex, Int16 axNo, ref Int16 pStatus);
  1720. /// @brief EtherCAT类型轴402回零合成函数, 包含设定回零参数, 切回零模式以及启动回零运动
  1721. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_StartHoming", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1722. public static extern UInt32 IMC_StartHoming(Int16 cardIndex, Int16 axNo, ref THomingPara pHomingPara);
  1723. /// @brief 完成402回零动作合成函数, 包含停止回零, 退出ecat回零模式, 暂默认切到CSP模式
  1724. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_FinishHoming", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1725. public static extern UInt32 IMC_FinishHoming(Int16 cardIndex, Int16 axNo);
  1726. #endregion
  1727. ///@defgroup EcatCSPHoming EcatCSPHoming
  1728. ///@brief 板卡ECAT轴CSP模式规划回零功能功能
  1729. #region EcatCSPHoming
  1730. /// @brief 设置 CSP 模式下回原点中 DI 触发对应 0x60FD(digitalInput)中的 bit 位置
  1731. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetEcatAxProbeMaskBit", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1732. public static extern UInt32 IMC_SetEcatAxProbeMaskBit(Int16 cardIndex, Int16 axNo, Int16 prbDiBitNo);
  1733. /// @brief 获取 CSP 模式下回原点中 DI 触发对应 0x60FD(digitalInput)中的 bit 位置
  1734. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatAxProbeMaskBit", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1735. public static extern UInt32 IMC_GetEcatAxProbeMaskBit(Int16 cardIndex, Int16 axNo, ref Int16 pPrbDiBitNo);
  1736. /// @brief 开始EtherCAT类型轴CSP模式规划回零
  1737. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_StartEcatAxCSPHoming", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1738. public static extern UInt32 IMC_StartEcatAxCSPHoming(Int16 cardIndex, Int16 axNo, Int16 method, Int16 dir, Int16 level, double hVel, double lVel, double acc, double offset);
  1739. /// @brief 停止EtherCAT类型轴CSP模式规划回零
  1740. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_StopEcatAxCSPHoming", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1741. public static extern UInt32 IMC_StopEcatAxCSPHoming(Int16 cardIndex, Int16 axNo, Int16 stopMode);
  1742. /// @brief 获取EtherCAT类型轴CSP模式规划回零状态
  1743. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEcatAxCSPHomingSts", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1744. public static extern UInt32 IMC_GetEcatAxCSPHomingSts(Int16 cardIndex, Int16 axNo, ref Int16 pHomingMethod, ref Int16 pHomingState);
  1745. /// @brief 完成EtherCAT类型轴CSP模式规划回零
  1746. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_FinishEcatAxCSPHoming", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1747. public static extern UInt32 IMC_FinishEcatAxCSPHoming(Int16 cardIndex, Int16 axNo);
  1748. #endregion
  1749. ///@defgroup PTP PTP
  1750. ///@brief PTP运动模式相关接口
  1751. #region PTP
  1752. /// @brief 启动单轴PTP运动
  1753. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_StartPtpMove", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1754. public static extern UInt32 IMC_StartPtpMove(Int16 cardIndex, Int16 axNo, double tgtPos, Int16 posType = 0);
  1755. /// @brief 启动多轴PTP的运动
  1756. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_StartMultiPtpMove", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1757. public static extern UInt32 IMC_StartMultiPtpMove(Int16 cardIndex, Int16 axNum, Int16[] pAxNoArray, double[] pTgtPosArray, Int16[] pPosTypeArray);
  1758. /// @brief 在线更新PTP目标位置
  1759. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_UpdatePtpTgtPos", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1760. public static extern UInt32 IMC_UpdatePtpTgtPos(Int16 cardIndex, Int16 axNo, double tgtPos);
  1761. /// @brief 获取PTP目标位置
  1762. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetPtpTgtPos", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1763. public static extern UInt32 IMC_GetPtpTgtPos(Int16 cardIndex, Int16 axNo, ref double pTgtPos);
  1764. /// @brief 在线更新PTP运动参数
  1765. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_UpdatePtpMvPara", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1766. public static extern UInt32 IMC_UpdatePtpMvPara(Int16 cardIndex, Int16 axNo, double tgtVel, double acc, double dec);
  1767. /// @brief 在线更新PTP目标速度
  1768. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_UpdatePtpTgtVel", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1769. public static extern UInt32 IMC_UpdatePtpTgtVel(Int16 cardIndex, Int16 axNo, double tgtVel);
  1770. /// @brief 切换PTP规划模式
  1771. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_PtpPrf", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1772. public static extern UInt32 IMC_PtpPrf(Int16 cardIndex, Int16 axNo);
  1773. #endregion
  1774. ///@defgroup Jog Jog
  1775. ///@brief Jog运动模式相关接口
  1776. #region Jog
  1777. /// @brief 启动单轴JOG运动
  1778. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_StartJogMove", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1779. public static extern UInt32 IMC_StartJogMove(Int16 cardIndex, Int16 axNo, double tgVel);
  1780. /// @brief 启动多轴JOG运动
  1781. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_StartMultiJogMove", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1782. public static extern UInt32 IMC_StartMultiJogMove(Int16 cardIndex, Int16 axNum, Int16[] pAxNoArray, double[] pTgtVelArray);
  1783. /// @brief 在线更新JOG目标速度
  1784. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_UpdateJogTgtVel", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1785. public static extern UInt32 IMC_UpdateJogTgtVel(Int16 cardIndex, Int16 axNo, double tgVel);
  1786. /// @brief 在线更新JOG运动参数
  1787. /// 注意:JOG规划减速度仅作用于JOG在线变速
  1788. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_UpdateJogMvPara", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1789. public static extern UInt32 IMC_UpdateJogMvPara(Int16 cardIndex, Int16 axNo, double tgVel, double acc, double dec);
  1790. /// @brief 切换JOG规划模式
  1791. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_JogPrf", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1792. public static extern UInt32 IMC_JogPrf(Int16 cardIndex, Int16 axNo);
  1793. #endregion
  1794. ///@defgroup PTPS PTPS
  1795. ///@brief PTPS运动模式相关接口
  1796. #region PTPS
  1797. /// @brief 切换PTPS规划模式
  1798. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_PrfPtps", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1799. public static extern UInt32 IMC_PrfPtps(Int16 cardIndex, Int16 axNo);
  1800. /// @brief 设置PTPS运动启动速度
  1801. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetPtpsBeginVel", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1802. public static extern UInt32 IMC_SetPtpsBeginVel(Int16 cardIndex, Int16 axNo, double beginVel);
  1803. /// @brief 设置PTPS运动结束速度
  1804. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetPtpsEndVel", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1805. public static extern UInt32 IMC_SetPtpsEndVel(Int16 cardIndex, Int16 axNo, double endVel);
  1806. /// @brief 设置PTPS运动参数
  1807. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetPtpsMovePara", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1808. public static extern UInt32 IMC_SetPtpsMovePara(Int16 cardIndex, Int16 axNo, double tgVel, double acc, double dec);
  1809. /// @brief 设置PTPS运动参数
  1810. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetPtpsMoveParaEx", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1811. public static extern UInt32 IMC_SetPtpsMoveParaEx(Int16 cardIndex, Int16 axNo, double tgtVel, double tgtAcc, double tgtDec, double prfAcc, double prfDec);
  1812. /// @brief 启动单轴PTPS快速规划
  1813. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_StartPtpsMove", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1814. public static extern UInt32 IMC_StartPtpsMove(Int16 cardIndex, Int16 axNo, double tgtPos, short posType);
  1815. /// @brief 启动单轴PTPS软启动规划
  1816. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_StartPtpsMoveA", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1817. public static extern UInt32 IMC_StartPtpsMoveA(Int16 cardIndex, Int16 axNo, double tgtPos, double startSlowPos, double startSlowVel, short posType);
  1818. /// @brief 启动单轴PTPS软着陆规划
  1819. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_StartPtpsMoveD", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1820. public static extern UInt32 IMC_StartPtpsMoveD(Int16 cardIndex, Int16 axNo, double tgtPos, double stopSlowPos, double stopSlowVel, short posType);
  1821. /// @brief 启动单轴PTPS多段运动规划,可实现软启动及软着陆
  1822. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_StartPtpsMoveM", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1823. public static extern UInt32 IMC_StartPtpsMoveM(Int16 cardIndex, Int16 axNo, double tgtPos, double startSlowPos, double startSlowVel, double stopSlowPos, double stopSlowVel, short posType);
  1824. /// @brief 在线更新PTPS目标位置,无法实现软着陆
  1825. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_UpdatePtpsMovePos", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1826. public static extern UInt32 IMC_UpdatePtpsMovePos(Int16 cardIndex, Int16 axNo, double tgtPos);
  1827. /// @brief 在线更新PTPS目标速度,无法实现软着陆
  1828. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_UpdatePtpsMoveVel", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1829. public static extern UInt32 IMC_UpdatePtpsMoveVel(Int16 cardIndex, Int16 axNo, double tgtVel);
  1830. /// @brief 在线更新PTPS运动参数,无法实现软着陆
  1831. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_UpdatePtpsMovePara", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1832. public static extern UInt32 IMC_UpdatePtpsMovePara(Int16 cardIndex, Int16 axNo, double tgVel, double acc, double dec);
  1833. /// @brief 在线更新PTPS软着陆规划,实现软着陆
  1834. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_UpdatePtpsMoveD", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1835. public static extern UInt32 IMC_UpdatePtpsMoveD(Int16 cardIndex, Int16 axNo, double tgtPos, double stopSlowPos, double stopSlowVel);
  1836. /// @brief 获取PTPS运动启动速度
  1837. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetPtpsBeginVel", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1838. public static extern UInt32 IMC_GetPtpsBeginVel(Int16 cardIndex, Int16 axNo, ref double pBeginVel);
  1839. /// @brief 获取PTPS运动结束速度
  1840. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetPtpsEndVel", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1841. public static extern UInt32 IMC_GetPtpsEndVel(Int16 cardIndex, Int16 axNo, ref double pEendVel);
  1842. /// @brief 获取PTPS运动参数
  1843. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetPtpsMovePara", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1844. public static extern UInt32 IMC_GetPtpsMovePara(Int16 cardIndex, Int16 axNo, ref double pTgtVel, ref double pAcc, ref double pDec);
  1845. /// @brief 获取PTPS运动参数
  1846. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetPtpsMoveParaEx", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1847. public static extern UInt32 IMC_GetPtpsMoveParaEx(Int16 cardIndex, Int16 axNo, double pTgtVel, double pTgtAcc, double pTgtDec, double tPrfAcc, double tPrfDec);
  1848. #endregion
  1849. ///@defgroup Gear Gear
  1850. ///@brief Gear运动模式相关接口
  1851. #region Gear
  1852. /// @brief 切换为电子齿轮模式
  1853. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GearPrf", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1854. public static extern UInt32 IMC_GearPrf(Int16 cardIndex, Int16 axNo);
  1855. /// @brief 设置电子齿轮参数
  1856. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GearSetParam", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1857. public static extern UInt32 IMC_GearSetParam(Int16 cardIndex, Int16 axNo, ref TGearParam pGearParam);
  1858. /// @brief 获取电子齿轮参数
  1859. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GearGetParam", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1860. public static extern UInt32 IMC_GearGetParam(Int16 cardIndex, Int16 axNo, ref TGearParam pGearParam);
  1861. /// @brief 启动电子齿轮运动
  1862. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GearStart", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1863. public static extern UInt32 IMC_GearStart(Int16 cardIndex, Int16 axNo);
  1864. /// @brief 停止电子齿轮运动
  1865. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GearStop", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1866. public static extern UInt32 IMC_GearStop(Int16 cardIndex, Int16 axNo, Int16 stopType);
  1867. /// @brief 获取电子齿轮状态
  1868. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GearGetStatus", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1869. public static extern UInt32 IMC_GearGetStatus(Int16 cardIndex, Int16 axNo, ref Int16 pStatus, ref Int16 pErr);
  1870. /// @brief 更新电子齿轮比
  1871. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GearUpdateScale", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1872. public static extern UInt32 IMC_GearUpdateScale(Int16 cardIndex, Int16 axNo, Int32 masterScale, Int32 slaveScale, Int32 masterDis);
  1873. #endregion
  1874. ///@defgroup Pvt Pvt
  1875. ///@brief Pvt运动模式相关接口
  1876. #region Pvt
  1877. /// @brief 切换为PVT模式
  1878. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_PvtPrf", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1879. public static extern UInt32 IMC_PvtPrf(Int16 cardIndex, Int16 axNo);
  1880. /// @brief 选择PVT数据表
  1881. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_PvtTableSelect", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1882. public static extern UInt32 IMC_PvtTableSelect(Int16 cardIndex, Int16 axNo, Int16 tableId);
  1883. /// @brief 启动PVT运动
  1884. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_PvtStart", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1885. public static extern UInt32 IMC_PvtStart(Int16 cardIndex, Int16 axNum, Int16[] pAxArray);
  1886. /// @brief 获取PVT状态
  1887. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_PvtGetStatus", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1888. public static extern UInt32 IMC_PvtGetStatus(Int16 cardIndex, Int16 axNo, Int16[] pTableId, double[] pTime, Int16 count = 1);
  1889. /// @brief 设置PVT循环
  1890. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_PvtSetLoop", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1891. public static extern UInt32 IMC_PvtSetLoop(Int16 cardIndex, Int16 axNo, Int32 loop);
  1892. /// @brief 获取PVT循环
  1893. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_PvtGetLoop", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1894. public static extern UInt32 IMC_PvtGetLoop(Int16 cardIndex, Int16 axNo, ref Int32 pCurLoop, ref Int32 pLoop);
  1895. /// @brief 向PVT的指定数据表传送PT数据
  1896. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_PvtTablePt", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1897. public static extern UInt32 IMC_PvtTablePt(Int16 cardIndex, Int16 tableId, Int32 count, double[] P, double[] T);
  1898. /// @brief 向PVT的指定数据表传送数据, 采用PVT描述方式
  1899. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_PvtTablePvt", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1900. public static extern UInt32 IMC_PvtTablePvt(Int16 cardIndex, Int16 tableId, Int32 count, double[] P, double[] V, double[] T);
  1901. /// @brief 向PVT的指定数据表传送数据, 采用Percent描述方式(1段Percent描述方式消耗1~3个缓存空间)
  1902. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_PvtTablePercent", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1903. public static extern UInt32 IMC_PvtTablePercent(Int16 cardIndex, Int16 tableId, Int32 count, double[] P, double[] T, double[] percent, double startVel = 0);
  1904. /// @brief 向PVT的指定数据表传送数据, 采用Complete描述方式
  1905. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_PvtTableComplete", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1906. public static extern UInt32 IMC_PvtTableComplete(Int16 cardIndex, Int16 tableId, Int32 count, double[] P, double[] T, double startVel = 0, double endVel = 0);
  1907. #endregion
  1908. ///@defgroup Cam Cam
  1909. ///@brief Cam运动模式相关接口
  1910. #region Cam
  1911. /// @brief 设置凸轮规划模式
  1912. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CamPrf", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1913. public static extern UInt32 IMC_CamPrf(Int16 cardIndex, Int16 axNo);
  1914. /// @brief 凸轮参数设置
  1915. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CamSetParam", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1916. public static extern UInt32 IMC_CamSetParam(Int16 cardIndex, Int16 axNo, Int16 masterType, Int16 masterNo, Int16 dirMode = 0);
  1917. /// @brief 凸轮参数获取
  1918. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CamGetParam", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1919. public static extern UInt32 IMC_CamGetParam(Int16 cardIndex, Int16 axNo, ref Int16 pMasterType, ref Int16 pMasterNo, ref Int16 pDirMode);
  1920. /// @brief 凸轮表选择
  1921. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CamTableSelect", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1922. public static extern UInt32 IMC_CamTableSelect(Int16 cardIndex, Int16 axNo, Int16 tableId);
  1923. /// @brief 启动凸轮运动
  1924. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CamStart", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1925. public static extern UInt32 IMC_CamStart(Int16 cardIndex, Int16 axNo);
  1926. /// @brief 停止凸轮运动
  1927. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CamStop", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1928. public static extern UInt32 IMC_CamStop(Int16 cardIndex, Int16 axNo, Int16 stopType);
  1929. /// @brief 获取凸轮状态
  1930. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CamGetStatus", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1931. public static extern UInt32 IMC_CamGetStatus(Int16 cardIndex, Int16 axNo, ref Int16 pStatus, ref Int16 pTableId, ref Int32 pCurUserID);
  1932. /// @brief 获取凸轮在表中的主轴位置和从轴位置
  1933. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CamGetCurPos", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1934. public static extern UInt32 IMC_CamGetCurPos(Int16 cardIndex, Int16 axNo, ref double pMasterPos, ref double pSlavePos);
  1935. /// @brief 设置凸轮循环次数
  1936. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CamSetLoop", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1937. public static extern UInt32 IMC_CamSetLoop(Int16 cardIndex, Int16 axNo, UInt32 loop);
  1938. /// @brief 获取凸轮循环次数
  1939. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CamGetLoop", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1940. public static extern UInt32 IMC_CamGetLoop(Int16 cardIndex, Int16 axNo, ref UInt32 pCurLoop, ref UInt32 pLoop);
  1941. /// @brief 设置凸轮启动方式
  1942. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CamSetEvent", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1943. public static extern UInt32 IMC_CamSetEvent(Int16 cardIndex, Int16 axNo, Int16 type, Int32 masterPos);
  1944. /// @brief 获取凸轮启动方式
  1945. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CamGetEvent", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1946. public static extern UInt32 IMC_CamGetEvent(Int16 cardIndex, Int16 axNo, ref Int16 pType, ref Int32 pMasterPos);
  1947. /// @brief 主轴相位偏移(由速度参数指定)
  1948. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CamPhasing", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1949. public static extern UInt32 IMC_CamPhasing(Int16 cardIndex, Int16 axNo, double phaseShift, double phaseVel, double phaseAcc, double phaseDec, Int16 phaseShiftType = 0);
  1950. /// @brief 主轴相位偏移(指定主轴位移完成偏移)
  1951. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CamPhasingDist", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1952. public static extern UInt32 IMC_CamPhasingDist(Int16 cardIndex, Int16 axNo, double phaseShift, double masterDist, double accDistRatio, double decDistRatio, Int16 phaseShiftType = 0);
  1953. /// @brief 停止主轴相位偏移
  1954. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CamStopPhasing", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1955. public static extern UInt32 IMC_CamStopPhasing(Int16 cardIndex, Int16 axNo);
  1956. /// @brief 获取主轴相位偏移状态
  1957. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CamGetPhasing", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1958. public static extern UInt32 IMC_CamGetPhasing(Int16 cardIndex, Int16 axNo, ref Int16 phasingSts, ref double pPhase, ref double pPhaseVel);
  1959. /// @brief 清除凸轮表数据
  1960. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CamTableClrData", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1961. public static extern UInt32 IMC_CamTableClrData(Int16 cardIndex, Int16 tableId);
  1962. /// @brief 获取凸轮表剩余空间
  1963. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CamTableGetSpace", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1964. public static extern UInt32 IMC_CamTableGetSpace(Int16 cardIndex, Int16 tableId, ref Int32 pSpace);
  1965. /// @brief 重新分配凸轮表数量和大小(总深度为8*2048)
  1966. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CamTableResize", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1967. public static extern UInt32 IMC_CamTableResize(Int16 cardIndex, Int16 tableNum);
  1968. /// @brief 获取凸轮表数量和大小信息
  1969. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CamTableGetInfo", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1970. public static extern UInt32 IMC_CamTableGetInfo(Int16 cardIndex, ref Int16 pTableNum, ref Int32 pTableSize);
  1971. /// @brief 凸轮表数据压入指令-通用压入指令
  1972. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CamTableData", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1973. public static extern UInt32 IMC_CamTableData(Int16 cardIndex, Int16 tableId, Int32 count, Int16[] pCurveType, double[] pKeyPointParam, Int32[] pUserID = null);
  1974. /// @brief 凸轮表获取关键点之间指定相位的位移
  1975. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CamTableGetDist", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1976. public static extern UInt32 IMC_CamTableGetDist(Int16 cardIndex, Int32 count, Int16[] pCurveType, double[] pKeyPointParam, double x, double[] pOutput);
  1977. #endregion
  1978. #endregion
  1979. ///@defgroup AdvMotion AdvMotion
  1980. ///@brief 高级运动功能
  1981. #region AdvMotion
  1982. ///@defgroup Crd Crd
  1983. ///@brief Crd坐标系插补运动模式相关接口
  1984. #region Crd
  1985. /// @brief 创建插补坐标系, 配置坐标系插补参数
  1986. /// @attention 注意!用户必须定义长度为 3 的数组进行传值
  1987. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdSetMtSys", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1988. public static extern UInt32 IMC_CrdSetMtSys(Int16 cardIndex, Int16 crdNo, Int16[] pMaskAxNoArray, Int16 lookAheadLen, double estopDec);
  1989. /// @brief 获取插补坐标系配置参数
  1990. /// @attention 注意!用户必须定义长度为 3 的数组进行传值
  1991. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdGetMtSysParam", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1992. public static extern UInt32 IMC_CrdGetMtSysParam(Int16 cardIndex, Int16 crdNo, Int16[] pMaskAxNoArray, ref Int16 pLookAheadLen, ref double pEstopDec);
  1993. /// @brief 删除插补坐标系
  1994. /// @attention 需对创建的坐标系进行删除, 否则接口报错
  1995. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdDeleteMtSys", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1996. public static extern UInt32 IMC_CrdDeleteMtSys(Int16 cardIndex, Int16 crdNo);
  1997. /// @brief 设置插补坐标系高级参数
  1998. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdSetAdvParam", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  1999. public static extern UInt32 IMC_CrdSetAdvParam(Int16 cardIndex, Int16 crdNo, ref TCrdAdvParam pCrdAdvParam);
  2000. /// @brief 获取插补坐标系高级参数
  2001. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdGetAdvParam", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2002. public static extern UInt32 IMC_CrdGetAdvParam(Int16 cardIndex, Int16 crdNo, ref TCrdAdvParam pCrdAdvParam);
  2003. /// @brief 插补运动指令用户模式下的运动段的始末速度设置
  2004. /// @details 该指令主要用于用户规划模式下, 指定每段运动, 段的起始和段末的速度。一般情况下, 运动段的起始速度等于上一段的段末速度
  2005. /// @todo 插补模式用户速度功能待完成, 速度参数范围待补充
  2006. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdSetUserVelPlan", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2007. public static extern UInt32 IMC_CrdSetUserVelPlan(Int16 cardIndex, Int16 crdNo, double uStartVel, double uEndVel);
  2008. /// @brief 插补运动指令在用户规划模式下设置的运动段的始末速度的获取
  2009. /// @todo 插补模式用户速度功能待完成, 速度参数范围待补充
  2010. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdGetUserVelPlan", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2011. public static extern UInt32 IMC_CrdGetUserVelPlan(Int16 cardIndex, Int16 crdNo, ref double pUStartVel, ref double pUEndVel);
  2012. /// @brief 设置插补平滑参数。通过设置平滑等级和平滑精度, 使插补运动轨迹更平滑
  2013. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdSetSmoothParam", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2014. public static extern UInt32 IMC_CrdSetSmoothParam(Int16 cardIndex, Int16 crdNo, Int32 smoothLevel, double smoothTol);
  2015. /// @brief 获取插补平滑参数。通过设置平滑等级和平滑精度, 使插补运动轨迹更平滑
  2016. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdGetSmoothParam", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2017. public static extern UInt32 IMC_CrdGetSmoothParam(Int16 cardIndex, Int16 crdNo, ref Int32 pSmoothLevel, ref double pSmoothTol);
  2018. /// @brief 设置插补轨迹速度
  2019. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdSetTrajVel", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2020. public static extern UInt32 IMC_CrdSetTrajVel(Int16 cardIndex, Int16 crdNo, double tgtVel);
  2021. /// @brief 获取插补轨迹速度
  2022. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdGetTrajVel", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2023. public static extern UInt32 IMC_CrdGetTrajVel(Int16 cardIndex, Int16 crdNo, ref double pTgtVel);
  2024. /// @brief 设置插补轨迹加速度和减速度
  2025. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdSetTrajAccAndDec", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2026. public static extern UInt32 IMC_CrdSetTrajAccAndDec(Int16 cardIndex, Int16 crdNo, double tgtAcc, double tgtDec);
  2027. /// @brief 获取插补轨迹加速度和减速度
  2028. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdGetTrajAccAndDec", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2029. public static extern UInt32 IMC_CrdGetTrajAccAndDec(Int16 cardIndex, Int16 crdNo, ref double pTgtAcc, ref double pTgtDec);
  2030. /// @brief 设置插补强制规划末速度降为 0 标识
  2031. /// @details 如果将强制规划末速度降为 0, 则下面所有线段末速度为 0
  2032. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdSetZeroFlag", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2033. public static extern UInt32 IMC_CrdSetZeroFlag(Int16 cardIndex, Int16 crdNo, Int16 ZeroFlag);
  2034. /// @brief 获取插补强制规划末速度降为 0 标识
  2035. /// @details 如果将强制规划末速度降为 0, 则下面所有线段末速度为 0
  2036. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdGetZeroFlag", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2037. public static extern UInt32 IMC_CrdGetZeroFlag(Int16 cardIndex, Int16 crdNo, ref Int16 pZeroFlag);
  2038. /// @brief 设置插补运动指令的位置编程模式
  2039. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdSetIncMode", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2040. public static extern UInt32 IMC_CrdSetIncMode(Int16 cardIndex, Int16 crdNo, Int16 mode);
  2041. /// @brief 获取插补运动指令的位置编程模式
  2042. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdGetIncMode", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2043. public static extern UInt32 IMC_CrdGetIncMode(Int16 cardIndex, Int16 crdNo, ref Int16 pMode);
  2044. /// @brief 设置插补同步跟随轴的速度模式
  2045. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdSetFolVelMode", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2046. public static extern UInt32 IMC_CrdSetFolVelMode(Int16 cardIndex, Int16 crdNo, Int16 mode);
  2047. /// @brief 获取插补同步跟随轴的速度模式
  2048. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdGetFolVelMode", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2049. public static extern UInt32 IMC_CrdGetFolVelMode(Int16 cardIndex, Int16 crdNo, ref Int16 pMode);
  2050. /// @brief 设置插补运动指令的过渡精度
  2051. /// @details 该指令属于高级参数指令, 只有在启动过渡模式才生效
  2052. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdSetTrajTol", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2053. public static extern UInt32 IMC_CrdSetTrajTol(Int16 cardIndex, Int16 crdNo, double tol);
  2054. /// @brief 设置插补运动指令的拐弯系数。
  2055. /// @details 该指令属于高级参数指令, 只有在启动过渡模式才生效, 该参数越 小, 在过渡拐弯时速度降至越低, 参数越大, 则拐弯速度越高, 默认参数为 1
  2056. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdSetTrajTurnCoef", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2057. public static extern UInt32 IMC_CrdSetTrajTurnCoef(Int16 cardIndex, Int16 crdNo, double turnCoef);
  2058. /// @brief 三维直线插补运动
  2059. /// @attention[]]pEndPosArray 应传入长度为 3 的数组指针
  2060. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdLineXYZ", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2061. public static extern UInt32 IMC_CrdLineXYZ(Int16 cardIndex, Int16 crdNo, double[] pEndPosArray, Int32 userID = 0);
  2062. /// @brief XY平面内直线插补运动
  2063. /// @attention[]]pEndPosArray 应传入长度为 2 的数组指针
  2064. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdLineXY", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2065. public static extern UInt32 IMC_CrdLineXY(Int16 cardIndex, Int16 crdNo, double[] pEndPosArray, Int32 userID = 0);
  2066. /// @brief XZ平面内直线插补运动
  2067. /// @attention[]]pEndPosArray 应传入长度为 2 的数组指针
  2068. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdLineZX", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2069. public static extern UInt32 IMC_CrdLineZX(Int16 cardIndex, Int16 crdNo, double[] pEndPosArray, Int32 userID = 0);
  2070. /// @brief YZ平面内直线插补运动
  2071. /// @attention[]]pEndPosArray 应传入长度为 2 的数组指针
  2072. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdLineYZ", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2073. public static extern UInt32 IMC_CrdLineYZ(Int16 cardIndex, Int16 crdNo, double[] pEndPosArray, Int32 userID = 0);
  2074. /// @brief 给定三点的三维圆弧插补
  2075. /// @details 如果输入三点共线会导致圆弧几何错误, 此函数只能画小于一圈的圆不能画整圆和多圈圆
  2076. /// @attention pMidPos 、pEndPos 应传入长度为 3 的数组指针
  2077. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdArcThreePoint", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2078. public static extern UInt32 IMC_CrdArcThreePoint(Int16 cardIndex, Int16 crdNo, double[] pMidPosArray, double[] pEndPosArray, Int32 userID);
  2079. /// @brief 给定圆心, 末点法向量的三维圆弧插补
  2080. /// @details 当 height 不为 0 的时候可衍生为螺旋线插补。当起点和终点重合的时候几何参数错误。
  2081. /// @attention[]]pCenterArray[] pEndPosArray[] pNormalArray 应传入长度为 3 的数组指针
  2082. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_Crd3DArcCenterNormal", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2083. public static extern UInt32 IMC_Crd3DArcCenterNormal(Int16 cardIndex, Int16 crdNo, double[] pCenterArray, double[] pEndPosArray, double[] pNormalArray, double height = 0, Int32 turn = 0, Int32 userID = 0);
  2084. /// @brief 给定圆弧半径, 圆弧末点和圆弧法向量的三维圆弧插补
  2085. /// @details 当 height 不为 0 的时候可衍生为螺旋线插补。 此函数无法插补整圆
  2086. /// @attention[]]pEndPosArray[] pNormalArray 应传入长度为 3 的数组指针
  2087. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_Crd3DArcRadiusNormal", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2088. public static extern UInt32 IMC_Crd3DArcRadiusNormal(Int16 cardIndex, Int16 crdNo, double radius, double[] pEndPosArray, double[] pNormalArray, double height = 0, Int32 turn = 0, Int32 userID = 0);
  2089. /// @brief 给定圆弧圆心, 圆弧角度和圆弧法向量的三维圆弧插补
  2090. /// @details 当 height 不为 0 的时候可衍生为螺旋线插补。此函数可以画整圆
  2091. /// @attention[]]pCenterArray[] pNormalArray 应传入长度为 3 的数组指针
  2092. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_Crd3DArcAngleNormal", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2093. public static extern UInt32 IMC_Crd3DArcAngleNormal(Int16 cardIndex, Int16 crdNo, double[] pCenterArray, double angle, double[] pNormalArray, double height = 0, Int32 userID = 0);
  2094. /// @brief 给定圆弧圆心和圆弧末点, XY平面内的圆弧插补
  2095. /// @attention[]]pCenterArray[] pEndPosArray 应传入长度为 2 的数组指针
  2096. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdArcCenterXYPlane", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2097. public static extern UInt32 IMC_CrdArcCenterXYPlane(Int16 cardIndex, Int16 crdNo, double[] pCenterArray, double[] pEndPosArray, Int16 dir, double height = 0, Int32 turn = 0, Int32 userID = 0);
  2098. /// @brief 给定圆弧圆心和圆弧末点, YZ平面内的圆弧插补
  2099. /// @attention[]]pCenterArray[] pEndPosArray 应传入长度为 2 的数组指针
  2100. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdArcCenterYZPlane", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2101. public static extern UInt32 IMC_CrdArcCenterYZPlane(Int16 cardIndex, Int16 crdNo, double[] pCenterArray, double[] pEndPosArray, Int16 dir, double height = 0, Int32 turn = 0, Int32 userID = 0);
  2102. /// @brief 给定圆弧圆心和圆弧末点, ZX平面内的圆弧插补
  2103. /// @attention[]]pCenterArray[] pEndPosArray 应传入长度为 2 的数组指针
  2104. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdArcCenterZXPlane", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2105. public static extern UInt32 IMC_CrdArcCenterZXPlane(Int16 cardIndex, Int16 crdNo, double[] pCenterArray, double[] pEndPosArray, Int16 dir, double height = 0, Int32 turn = 0, Int32 userID = 0);
  2106. /// @brief 给定圆弧半径和圆弧末点, XY平面内的圆弧插补
  2107. /// @attention[]]pEndPosArray 应传入长度为 2 的数组指针
  2108. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdArcRadiusXYPlane", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2109. public static extern UInt32 IMC_CrdArcRadiusXYPlane(Int16 cardIndex, Int16 crdNo, double radius, double[] pEndPosArray, Int16 dir, double height = 0, Int32 turn = 0, Int32 userID = 0);
  2110. /// @brief 给定圆弧半径和圆弧末点, YZ平面内的圆弧插补
  2111. /// @attention[]]pEndPosArray 应传入长度为 2 的数组指针
  2112. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdArcRadiusYZPlane", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2113. public static extern UInt32 IMC_CrdArcRadiusYZPlane(Int16 cardIndex, Int16 crdNo, double radius, double[] pEndPosArray, Int16 dir, double height = 0, Int32 turn = 0, Int32 userID = 0);
  2114. /// @brief 给定圆弧半径和圆弧末点, ZX平面内的圆弧插补
  2115. /// @attention[]]pEndPosArray 应传入长度为 2 的数组指针
  2116. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdArcRadiusZXPlane", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2117. public static extern UInt32 IMC_CrdArcRadiusZXPlane(Int16 cardIndex, Int16 crdNo, double radius, double[] pEndPosArray, Int16 dir, double height = 0, Int32 turn = 0, Int32 userID = 0);
  2118. /// @brief 给定圆弧圆心和和圆弧角度, XY平面内的圆弧插补
  2119. /// @attention[]]pCenterArray 应传入长度为 2 的数组指针
  2120. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdArcAngleXYPlane", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2121. public static extern UInt32 IMC_CrdArcAngleXYPlane(Int16 cardIndex, Int16 crdNo, double[] pCenterArray, double angle, double height = 0, Int32 userID = 0);
  2122. /// @brief 给定圆弧圆心和和圆弧角度, YZ平面内的圆弧插补
  2123. /// @attention[]]pCenterArray 应传入长度为 2 的数组指针
  2124. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdArcAngleYZPlane", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2125. public static extern UInt32 IMC_CrdArcAngleYZPlane(Int16 cardIndex, Int16 crdNo, double[] pCenterArray, double angle, double height = 0, Int32 userID = 0);
  2126. /// @brief 给定圆弧圆心和和圆弧角度, ZX平面内的圆弧插补
  2127. /// @attention[]]pCenterArray 应传入长度为 2 的数组指针
  2128. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdArcAngleZXPlane", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2129. public static extern UInt32 IMC_CrdArcAngleZXPlane(Int16 cardIndex, Int16 crdNo, double[] pCenterArray, double angle, double height = 0, Int32 userID = 0);
  2130. /// @brief 给定圆心, 末点法向量的三维涡旋线插补
  2131. /// @details 当 height 不为 0 的时候可衍生为螺旋线插补。当起点和终点重合的时候几何参数错误。
  2132. /// @attention[]]pCenterArray[] pEndPosArray[] pNormalArray 应传入长度为 3 的数组指针
  2133. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_Crd3DVortexCenterNormal", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2134. public static extern UInt32 IMC_Crd3DVortexCenterNormal(Int16 cardIndex, Int16 crdNo, double[] pCenterArray, double[] pEndPosArray, double[] pNormalArray, double height = 0, Int32 turn = 0, Int32 userID = 0);
  2135. /// @brief 给定涡旋线圆心和涡旋线末点, XY平面内的涡旋线插补
  2136. /// @attention[]]pCenterArray[] pEndPosArray 应传入长度为 2 的数组指针
  2137. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdVortexCenterXYPlane", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2138. public static extern UInt32 IMC_CrdVortexCenterXYPlane(Int16 cardIndex, Int16 crdNo, double[] pCenterArray, double[] pEndPosArray, Int16 dir, double height = 0, Int32 turn = 0, Int32 userID = 0);
  2139. /// @brief 给定涡旋线圆心和涡旋线末点, YZ平面内的涡旋线插补
  2140. /// @attention[]]pCenterArray[] pEndPosArray 应传入长度为 2 的数组指针
  2141. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdVortexCenterYZPlane", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2142. public static extern UInt32 IMC_CrdVortexCenterYZPlane(Int16 cardIndex, Int16 crdNo, double[] pCenterArray, double[] pEndPosArray, Int16 dir, double height = 0, Int32 turn = 0, Int32 userID = 0);
  2143. /// @brief 给定涡旋线圆心和涡旋线末点, ZX平面内的涡旋线插补
  2144. /// @attention[]]pCenterArray[] pEndPosArray 应传入长度为 2 的数组指针
  2145. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdVortexCenterZXPlane", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2146. public static extern UInt32 IMC_CrdVortexCenterZXPlane(Int16 cardIndex, Int16 crdNo, double[] pCenterArray, double[] pEndPosArray, Int16 dir, double height = 0, Int32 turn = 0, Int32 userID = 0);
  2147. /// @brief 插补缓冲区等待延时
  2148. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdWaitTime", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2149. public static extern UInt32 IMC_CrdWaitTime(Int16 cardIndex, Int16 crdNo, Int32 waitTime, Int32 userID = 0);
  2150. /// @brief 插补缓冲区等待 DI
  2151. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdWaitDI", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2152. public static extern UInt32 IMC_CrdWaitDI(Int16 cardIndex, Int16 crdNo, Int16 diNO, Int16 diType, Int16 diLevel, Int32 userID = 0);
  2153. /// @brief 插补缓冲区等待 DI
  2154. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdWaitTimeDI", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2155. public static extern UInt32 IMC_CrdWaitTimeDI(Int16 cardIndex, Int16 crdNo, Int16 diNO, Int16 diType, Int16 diLevel, Int32 waitTime, Int32 userID = 0);
  2156. /// @brief 插补缓冲区输出 DO
  2157. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdSetDO", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2158. public static extern UInt32 IMC_CrdSetDO(Int16 cardIndex, Int16 crdNo, Int16 doNO, Int16 doType, Int16 doLevel, Int32 userID = 0);
  2159. /// @brief 插补缓冲区指令, 执行到该段时, 以该段为起始, 在 waitPos 距离处输出指定的 DO 信号
  2160. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdSetDistanceDO", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2161. public static extern UInt32 IMC_CrdSetDistanceDO(Int16 cardIndex, Int16 crdNo, double waitPos, Int16 doNO, Int16 doType, Int16 doLevel, Int32 userID = 0);
  2162. /// @brief 插补缓冲区指令, 执行到该段时, 以该段为起始, 延时设定时间, 输出指定的 DO 信号
  2163. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdSetTimeDO", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2164. public static extern UInt32 IMC_CrdSetTimeDO(Int16 cardIndex, Int16 crdNo, Int32 waitTime, Int16 doNO, Int16 doType, Int16 doLevel, Int32 userID = 0);
  2165. /// @brief 插补缓冲区启动插补轴以外的轴 PTP 运动
  2166. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdPTPMove", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2167. public static extern UInt32 IMC_CrdPTPMove(Int16 cardIndex, Int16 crdNo, Int16 axNo, double tgtPos, double tgtVel, double acc, Int16 mvType, Int16 waitFlag, Int32 userID = 0);
  2168. /// @brief 插补缓冲区中启动插补轴之外的轴同步运动(相对位移)
  2169. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdSyncMove", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2170. public static extern UInt32 IMC_CrdSyncMove(Int16 cardIndex, Int16 crdNo, Int16 axNo, double syncPos, Int32 userID = 0);
  2171. /// @brief 插补缓冲区中启动插补轴之外的轴同步运动(绝对位移)
  2172. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdSyncMoveAbs", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2173. public static extern UInt32 IMC_CrdSyncMoveAbs(Int16 cardIndex, Int16 crdNo, Int16 axNo, double syncTgtPos, Int32 userID = 0);
  2174. /// @brief 插补缓冲区等待上一条运动指令到位
  2175. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdWaitInPos", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2176. public static extern UInt32 IMC_CrdWaitInPos(Int16 cardIndex, Int16 crdNo, Int32 userID = 0);
  2177. /// @brief 缓冲区插补轴外的多轴(两轴)同步运动
  2178. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdMultiSyncMove", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2179. public static extern UInt32 IMC_CrdMultiSyncMove(Int16 cardIndex, Int16 crdNo, Int16 axNum, Int16[] pAxNo, double[] pTgtPos, double tgtVel, double tgtAcc, Int16 contiFlag, Int32 userID = 0);
  2180. /// @brief 插补缓存运动停止
  2181. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdBufStop", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2182. public static extern UInt32 IMC_CrdBufStop(Int16 cardIndex, Int16 crdNo, Int32 userID = 0);
  2183. /// @brief 插补缓存区设置全局变量
  2184. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdSetUserVal", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2185. public static extern UInt32 IMC_CrdSetUserVal(Int16 cardIndex, Int16 crdNo, Int16 index, Int32 value, Int32 userID = 0);
  2186. /// @brief 插补缓存区等待全局变量
  2187. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdWaitUserVal", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2188. public static extern UInt32 IMC_CrdWaitUserVal(Int16 cardIndex, Int16 crdNo, Int16 index, Int16 condition, Int32 compareValue, Int32 waitTime, Int32 userID = 0);
  2189. /// @brief 一次性往 DSP 队列发送 PC 部分的队列数据
  2190. /// @details 每次发送若干条, 如果完全发送完成, pIsFinished 标 识记为 1
  2191. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdEndData", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2192. public static extern UInt32 IMC_CrdEndData(Int16 cardIndex, Int16 crdNo, ref Int16 pIsFinished);
  2193. /// @brief 插补运动使能函数, 调用此函数后, 会开始插补运动。如果停止插补运动, 需要调用停止运动函数 进行去插补使能
  2194. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdStart", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2195. public static extern UInt32 IMC_CrdStart(Int16 cardIndex, Int16 crdNo);
  2196. /// @brief 多个插补坐标系同时运动使能函数, 调用此函数后, 会开始插补运动。如果停止插补运动, 需要调用停止运动函数 进行去插补使能
  2197. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdMultiStart", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2198. public static extern UInt32 IMC_CrdMultiStart(Int16 cardIndex, Int16[] pCrdNo, Int16 count);
  2199. /// @brief 调用此函数进行插补停止, 用户可以选择正常平滑停止和急停。
  2200. /// @details 正常平滑停止按照用户设定的轨迹加速度进行减速停止。急停是利用用户在建立坐标系设定的急停加速度进行停止, 停止后系统不会清空队列, 需要用户自己清空队列。
  2201. /// @attention 急停停止后, 插补会报出急停错误号, 需要手动清除此错误才能再次运行
  2202. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdStop", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2203. public static extern UInt32 IMC_CrdStop(Int16 cardIndex, Int16 crdNo, Int16 stopType);
  2204. /// @brief 清除缓存区压入曲线数据
  2205. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdClrData", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2206. public static extern UInt32 IMC_CrdClrData(Int16 cardIndex, Int16 crdNo);
  2207. /// @brief 清除插补错误号。可以清除 IMC_CrdGetStatus 获取到的故障号
  2208. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdClrError", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2209. public static extern UInt32 IMC_CrdClrError(Int16 cardIndex, Int16 crdNo);
  2210. /// @brief 插补倍率设定函数。插补实际进给速度 = 用户插补进给速度 × 倍率值。
  2211. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdSetRatio", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2212. public static extern UInt32 IMC_CrdSetRatio(Int16 cardIndex, Int16 crdNo, double ratio);
  2213. /// @brief 插补倍率获取函数
  2214. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdGetRatio", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2215. public static extern UInt32 IMC_CrdGetRatio(Int16 cardIndex, Int16 crdNo, ref double pRatio);
  2216. /// @brief 插补状态获取。bit0-bit7 是插补运行状态。bi8-bit15 是插补故障状态
  2217. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdGetStatus", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2218. public static extern UInt32 IMC_CrdGetStatus(Int16 cardIndex, Int16 crdNo, ref Int16 pStatus);
  2219. /// @brief 获取插补运动执行缓冲区最后一段的运动状态
  2220. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdGetArrivalSts", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2221. public static extern UInt32 IMC_CrdGetArrivalSts(Int16 cardIndex, Int16 crdNo, ref Int16 pSts);
  2222. /// @brief 获取插补目标位置。目标位置指的是最后压入曲线的末点位置
  2223. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdGetTargetPos", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2224. public static extern UInt32 IMC_CrdGetTargetPos(Int16 cardIndex, Int16 crdNo, double[] pPosArray);
  2225. /// @brief 获取插补暂停运动的位置。该位置一般用于当用户使用单轴移动过插补轴后, 需要返回继续加工时使用
  2226. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdGetPausePos", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2227. public static extern UInt32 IMC_CrdGetPausePos(Int16 cardIndex, Int16 crdNo, double[] pPosArray);
  2228. /// @brief 当前插补坐标系坐标读取函数
  2229. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdGetPos", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2230. public static extern UInt32 IMC_CrdGetPos(Int16 cardIndex, Int16 crdNo, double[] pCrdPosArray);
  2231. /// @brief 插补轨迹速度读取函数
  2232. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdGetVel", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2233. public static extern UInt32 IMC_CrdGetVel(Int16 cardIndex, Int16 crdNo, ref double pCrdVel);
  2234. /// @brief 插补当前运动曲线用户索引获取
  2235. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdGetUserID", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2236. public static extern UInt32 IMC_CrdGetUserID(Int16 cardIndex, Int16 crdNo, ref Int32 pUserID);
  2237. /// @brief 获取队列当前的剩余余量
  2238. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdGetSpace", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2239. public static extern UInt32 IMC_CrdGetSpace(Int16 cardIndex, Int16 crdNo, ref Int32 pSpace);
  2240. /// @brief 获取 CPU 缓存队列当前的剩余空间
  2241. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdGetBufSpace", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2242. public static extern UInt32 IMC_CrdGetBufSpace(Int16 cardIndex, Int16 crdNo, ref Int32 pSpace);
  2243. /// @brief 获取前瞻缓存队列当前的剩余空间
  2244. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdGetLookAheadSpace", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2245. public static extern UInt32 IMC_CrdGetLookAheadSpace(Int16 cardIndex, Int16 crdNo, ref Int32 pSpace);
  2246. /// @brief 插补缓冲区模式设置
  2247. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdSetBufferMode", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2248. public static extern UInt32 IMC_CrdSetBufferMode(Int16 cardIndex, Int16 crdNo, Int16 bufferMode);
  2249. /// @brief 获取插补缓冲区模式
  2250. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdGetBufferMode", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2251. public static extern UInt32 IMC_CrdGetBufferMode(Int16 cardIndex, Int16 crdNo, ref Int16 pBufferMode);
  2252. /// @brief 插补数据恢复
  2253. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CrdSetDataRestore", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2254. public static extern UInt32 IMC_CrdSetDataRestore(Int16 cardIndex, Int16 crdNo);
  2255. #endregion
  2256. ///@defgroup MultiCrd MultiCrd
  2257. ///@brief MultiCrd 多轴插补运动模式相关接口
  2258. #region MultiCrd
  2259. /// @brief 建立多轴插补系统
  2260. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_MultiSetupSys", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2261. public static extern UInt32 IMC_MultiSetupSys(Int16 cardIndex, Int16 groupNo, Int16[] pAxNo, Int16 maxAxNum);
  2262. /// @brief 销毁多轴插补系统
  2263. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_MultiDeleteSys", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2264. public static extern UInt32 IMC_MultiDeleteSys(Int16 cardIndex, Int16 groupNo);
  2265. /// @brief 启动多轴插补运动
  2266. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_MultiStart", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2267. public static extern UInt32 IMC_MultiStart(Int16 cardIndex, Int16 groupNo);
  2268. /// @brief 停止多轴插补运动
  2269. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_MultiStop", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2270. public static extern UInt32 IMC_MultiStop(Int16 cardIndex, Int16 groupNo, Int16 stopType);
  2271. /// @brief 获取多轴插补数据剩余空间
  2272. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_MultiGetSpace", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2273. public static extern UInt32 IMC_MultiGetSpace(Int16 cardIndex, Int16 groupNo, ref Int32 pSpace);
  2274. /// @brief 清除多轴插补系统错误状态
  2275. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_MultiClrData", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2276. public static extern UInt32 IMC_MultiClrData(Int16 cardIndex, Int16 groupNo);
  2277. /// @brief 清除多轴插补数据队列
  2278. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_MultiClrError", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2279. public static extern UInt32 IMC_MultiClrError(Int16 cardIndex, Int16 groupNo);
  2280. /// @brief 设置多轴插补位置类型
  2281. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_MultiSetPosType", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2282. public static extern UInt32 IMC_MultiSetPosType(Int16 cardIndex, Int16 groupNo, Int16 posType);
  2283. /// @brief 获取多轴插补位置类型
  2284. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_MultiGetPosType", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2285. public static extern UInt32 IMC_MultiGetPosType(Int16 cardIndex, Int16 groupNo, ref Int16 pPosType);
  2286. /// @brief 获取多轴插补当前段UserID
  2287. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_MultiGetUserID", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2288. public static extern UInt32 IMC_MultiGetUserID(Int16 cardIndex, Int16 groupNo, ref Int32 pUserID);
  2289. /// @brief 获取多轴插补系统运行状态
  2290. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_MultiGetSts", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2291. public static extern UInt32 IMC_MultiGetSts(Int16 cardIndex, Int16 groupNo, ref Int16 pSts, ref Int16 pErrocode);
  2292. /// @brief 获取多轴插补运动到位状态
  2293. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_MultiGetArrivalSts", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2294. public static extern UInt32 IMC_MultiGetArrivalSts(Int16 cardIndex, Int16 groupNo, ref Int16 pArrivalSts);
  2295. /// @brief 设置多轴插补系统运动速度倍率
  2296. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_MultiSetRatio", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2297. public static extern UInt32 IMC_MultiSetRatio(Int16 cardIndex, Int16 groupNo, double ratio);
  2298. /// @brief 获取多轴插补系统运动速度倍率
  2299. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_MultiGetRatio", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2300. public static extern UInt32 IMC_MultiGetRatio(Int16 cardIndex, Int16 groupNo, ref double pRatio);
  2301. /// @brief 获取多轴插补运动轨迹位置
  2302. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_MultiGetTrajPos", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2303. public static extern UInt32 IMC_MultiGetTrajPos(Int16 cardIndex, Int16 groupNo, double[] pPos);
  2304. /// @brief 获取多轴插补运动轨迹速度
  2305. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_MultiGetTrajVel", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2306. public static extern UInt32 IMC_MultiGetTrajVel(Int16 cardIndex, Int16 groupNo, ref double pVel);
  2307. /// @brief 多轴插补直线运动
  2308. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_MultiLineMove", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2309. public static extern UInt32 IMC_MultiLineMove(Int16 cardIndex, Int16 groupNo, double[] pEndPos, double trajVel, double trajAcc, double trajDec, Int16 blendType, double blendRatio, Int32 userID = 0);
  2310. /// @brief 多轴插补等待事件
  2311. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_MultiWaitTime", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2312. public static extern UInt32 IMC_MultiWaitTime(Int16 cardIndex, Int16 groupNo, Int32 waitTime, Int32 userID);
  2313. /// @brief 多轴插补等待DI输入事件
  2314. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_MultiWaitDI", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2315. public static extern UInt32 IMC_MultiWaitDI(Int16 cardIndex, Int16 groupNo, Int16 diIndex, Int16 diType, Int16 diLevel, Int32 waitTime, Int32 userID);
  2316. /// @brief 多轴插补设置DO输出事件
  2317. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_MultiSetDO", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2318. public static extern UInt32 IMC_MultiSetDO(Int16 cardIndex, Int16 groupNo, Int16 doIndex, Int16 doType, Int16 doLevel, Int32 userID);
  2319. /// @brief 多轴插补设置翻转DO输出事件
  2320. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_MultiSetReverseDO", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2321. public static extern UInt32 IMC_MultiSetReverseDO(Int16 cardIndex, Int16 groupNo, Int16 doIndex, Int16 doType, Int16 doLevel, Int32 waitTime, Int32 userID);
  2322. #endregion
  2323. ///@defgroup BandPt BandPt
  2324. ///@brief BandPt 缓冲区插补运动模式相关接口
  2325. #region BandPt
  2326. /// @brief 建立多轴捆绑 PT 运行系统
  2327. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetupPtPackSys", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2328. public static extern UInt32 IMC_SetupPtPackSys(Int16 cardIndex, Int16 sysNo, Int16[] pMaskAxNoArray, Int16 maxAxNum);
  2329. /// @brief 销毁捆绑 PT 运动系统
  2330. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_DeletePtPackSys", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2331. public static extern UInt32 IMC_DeletePtPackSys(Int16 cardIndex, Int16 sysNo);
  2332. /// @brief 设置捆绑 PT 运动位置的编程类型
  2333. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetPtPackIncMode", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2334. public static extern UInt32 IMC_SetPtPackIncMode(Int16 cardIndex, Int16 sysNo, Int16 incMode);
  2335. /// @brief 获取捆绑 PT 运动位置的编程类型
  2336. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetPtPackIncMode", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2337. public static extern UInt32 IMC_GetPtPackIncMode(Int16 cardIndex, Int16 sysNo, ref Int16 pIncMode);
  2338. /// @brief 使能捆绑 PT 运动数据断流保护。当使能后, 根据缓冲区是否有数据, 同时判断各轴的速度是否大 于设定的阈值。
  2339. /// @details 如果系统中有任意一个轴的速度大于了设定的阈值, 则进行断流保护, 按照设定的 平滑停加速度进行停止。
  2340. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_EnablePtPackNoDataProtect", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2341. public static extern UInt32 IMC_EnablePtPackNoDataProtect(Int16 cardIndex, Int16 sysNo, double[] pThresholdVelArray);
  2342. /// @brief 取消捆绑 PT 运动数据断流保护
  2343. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_DisablePtPackNoDataProtect", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2344. public static extern UInt32 IMC_DisablePtPackNoDataProtect(Int16 cardIndex, Int16 sysNo);
  2345. /// @brief 获取捆绑 PT 运动数据断流保护的设置状态
  2346. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetPtPackNoDataProtectStatus", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2347. public static extern UInt32 IMC_GetPtPackNoDataProtectStatus(Int16 cardIndex, Int16 sysNo, ref Int16 pEnSts, double[] pThresholdVelArray);
  2348. /// @brief 添加捆绑 PT 运动数据
  2349. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_AddMotionPointPtPack", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2350. public static extern UInt32 IMC_AddMotionPointPtPack(Int16 cardIndex, Int16 sysNo, double[] pPosArray, Int16[] pTypeArray, double T, Int16 dataNum);
  2351. /// @brief 添加捆绑 PT 中的 DO 输出事件
  2352. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_AddDoPointPtPack", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2353. public static extern UInt32 IMC_AddDoPointPtPack(Int16 cardIndex, Int16 sysNo, Int16 doNo, Int16 doType, Int16 doLevel);
  2354. /// @brief 启动捆绑 PT 运动
  2355. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_StartPtPack", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2356. public static extern UInt32 IMC_StartPtPack(Int16 cardIndex, Int16 sysNo);
  2357. /// @brief 停止捆绑 PT 运动
  2358. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_StopPtPack", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2359. public static extern UInt32 IMC_StopPtPack(Int16 cardIndex, Int16 sysNo, Int16 type);
  2360. /// @brief 清除捆绑 PT 运动数据
  2361. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_ClrPtPackData", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2362. public static extern UInt32 IMC_ClrPtPackData(Int16 cardIndex, Int16 sysNo);
  2363. /// @brief 清除捆绑 PT 运动错误
  2364. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_ClrPtPackError", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2365. public static extern UInt32 IMC_ClrPtPackError(Int16 cardIndex, Int16 sysNo);
  2366. /// @brief 获取捆绑 PT 运动数据的空间
  2367. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetPtPackRestSpace", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2368. public static extern UInt32 IMC_GetPtPackRestSpace(Int16 cardIndex, Int16 sysNo, ref Int16 pSpace);
  2369. /// @brief 获取捆绑 PT 运动的状态
  2370. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetPtPackStatus", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2371. public static extern UInt32 IMC_GetPtPackStatus(Int16 cardIndex, Int16 sysNo, ref Int16 pStatus);
  2372. /// @brief 获取捆绑 PT 运动错误
  2373. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetPtPackError", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2374. public static extern UInt32 IMC_GetPtPackError(Int16 cardIndex, Int16 sysNo, ref Int16 pErr);
  2375. /// @brief 获取捆绑 PT 运动到位状态
  2376. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetPtPackArrivalSts", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2377. public static extern UInt32 IMC_GetPtPackArrivalSts(Int16 cardIndex, Int16 sysNo, ref Int16 pSts);
  2378. #endregion
  2379. #endregion
  2380. #endregion
  2381. ///@defgroup Compensation Compensation
  2382. ///@brief 运动补偿功能
  2383. #region Compensation
  2384. ///@defgroup ScrewComp ScrewComp
  2385. ///@brief 螺距误差补偿
  2386. #region ScrewComp
  2387. /// @brief 设置螺距误差补偿表
  2388. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetAxScrewCompTable", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2389. public static extern UInt32 IMC_SetAxScrewCompTable(Int16 cardIndex, Int16 tableId, Int16 cnt, Int32[] pPosCompArray, Int32[] pNegCompArray);
  2390. /// @brief 获取螺距误差补偿表
  2391. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetAxScrewCompTable", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2392. public static extern UInt32 IMC_GetAxScrewCompTable(Int16 cardIndex, Int16 tableId, ref Int16 pCnt, Int32[] pPosCompArray, Int32[] pNegCompArray);
  2393. /// @brief 设置螺距误差补偿参数
  2394. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetAxScrewCompParam", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2395. public static extern UInt32 IMC_SetAxScrewCompParam(Int16 cardIndex, Int16 axNo, Int16 pointCnt, Int32 startPos, Int32 len);
  2396. /// @brief 获取螺距误差补偿参数
  2397. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetAxScrewCompParam", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2398. public static extern UInt32 IMC_GetAxScrewCompParam(Int16 cardIndex, Int16 axNo, ref Int16 pPointCnt, ref Int32 pStartPos, ref Int32 pLen);
  2399. /// @brief 使能螺距误差补偿
  2400. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_EnableAxScrewComp", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2401. public static extern UInt32 IMC_EnableAxScrewComp(Int16 cardIndex, Int16 axNo, Int16 enable);
  2402. /// @brief 获取螺距误差补偿状态
  2403. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetAxScrewCompSts", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2404. public static extern UInt32 IMC_GetAxScrewCompSts(Int16 cardIndex, Int16 axNo, ref Int16 pEnable, ref double pCompVal);
  2405. #endregion
  2406. ///@defgroup TableComp TableComp
  2407. ///@brief 表补偿功能
  2408. #region TableComp
  2409. /// @brief 设置表补偿的数据表
  2410. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_TableCompSetTable", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2411. public static extern UInt32 IMC_TableCompSetTable(Int16 cardIndex, Int16 tableId, Int32 cnt, Int32[] pDataArray);
  2412. /// @brief 获取表补偿的数据表
  2413. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_TableCompGetTable", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2414. public static extern UInt32 IMC_TableCompGetTable(Int16 cardIndex, Int16 tableId, ref Int32 pCnt, Int32[] pDataArray);
  2415. /// @brief 设置表补偿参数
  2416. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_TableCompSetParam", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2417. public static extern UInt32 IMC_TableCompSetParam(Int16 cardIndex, Int16 axNo, ref TTableCompParam pTTableCompParam);
  2418. /// @brief 获取表补偿参数
  2419. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_TableCompGetParam", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2420. public static extern UInt32 IMC_TableCompGetParam(Int16 cardIndex, Int16 axNo, ref TTableCompParam pTTableCompParam);
  2421. /// @brief 使能表补偿
  2422. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_TableCompEnable", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2423. public static extern UInt32 IMC_TableCompEnable(Int16 cardIndex, Int16 axNo, Int16 enable);
  2424. /// @brief 获取表补偿状态
  2425. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_TableCompGetSts", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2426. public static extern UInt32 IMC_TableCompGetSts(Int16 cardIndex, Int16 axNo, ref Int16 pEnable, ref double pCompVal);
  2427. /// @brief 重新分配表补偿的表数量和大小(总大小为40000)
  2428. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_TableCompTableResize", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2429. public static extern UInt32 IMC_TableCompTableResize(Int16 cardIndex, Int16 tableNum);
  2430. /// @brief 获取表补偿的表数量和大小信息
  2431. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_TableCompTableGetInfo", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2432. public static extern UInt32 IMC_TableCompTableGetInfo(Int16 cardIndex, ref Int16 pTableNum, ref Int32 pTableSize);
  2433. #endregion
  2434. ///@defgroup AxPrfComp AxPrfComp
  2435. ///@brief 轴规划补偿功能
  2436. #region AxPrfComp
  2437. /// @brief 设置轴规划补偿
  2438. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetAxCompPos", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2439. public static extern UInt32 IMC_SetAxCompPos(Int16 cardIndex, Int16 axNo, double compPos, double compTime, Int16 posType);
  2440. /// @brief 获取轴规划补偿状态
  2441. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetAxCompSts", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2442. public static extern UInt32 IMC_GetAxCompSts(Int16 cardIndex, Int16 axNo, ref Int16 pSts, ref double pCompPos);
  2443. #endregion
  2444. #endregion
  2445. ///@defgroup Virtual Resource
  2446. ///@brief 板卡虚拟功能
  2447. #region VirtualResource
  2448. ///@defgroup UserVal
  2449. ///@brief 全局变量功能
  2450. #region UserVal
  2451. /// @brief 设置全局变量
  2452. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetUserVal", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2453. public static extern UInt32 IMC_SetUserVal(Int16 cardIndex, Int16 index, Int32 value);
  2454. /// @brief 读取全局变量
  2455. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetUserVal", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2456. public static extern UInt32 IMC_GetUserVal(Int16 cardIndex, Int16 index, ref Int32 pValue);
  2457. #endregion
  2458. #endregion
  2459. ///@defgroup Sample Sample
  2460. ///@brief 板卡采样功能相关接口
  2461. #region Sample
  2462. /// @brief 配置数据采集的参数
  2463. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_ConfigSamplePara", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2464. public static extern UInt32 IMC_ConfigSamplePara(Int16 cardIndex, ref TSamplePara pSamplePara);
  2465. /// @brief 配置数据采集的采集对象
  2466. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_ConfigSampleData", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2467. public static extern UInt32 IMC_ConfigSampleData(Int16 cardIndex, Int16 count, Int16[] pDataTypeArray, Int32[] pDataIndexArray);
  2468. /// @brief 使能数据采集
  2469. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_ConfigSampleEnable", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2470. public static extern UInt32 IMC_ConfigSampleEnable(Int16 cardIndex, Int16 enable);
  2471. /// @brief 获取数据采集的状态
  2472. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetSampleStatus", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2473. public static extern UInt32 IMC_GetSampleStatus(Int16 cardIndex, ref Int16 pStatus, ref Int32 pLen, ref Int32 pLeakageCount);
  2474. /// @brief 获取数据采集的速度
  2475. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetSampleData", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2476. public static extern UInt32 IMC_GetSampleData(Int16 cardIndex, ref Int16 pPackNum, Int16[] pDataArray);
  2477. #endregion
  2478. ///@defgroup MultiAxCmp MultiAxCmp
  2479. ///@brief 板卡多轴位置比较功能相关接口
  2480. #region MultiAxCmp
  2481. /// @brief 配置多轴比较输入源
  2482. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_MultiAxCmpSrcCfg", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2483. public static extern UInt32 IMC_MultiAxCmpSrcCfg(Int16 cardIndex, Int16 groupNo, Int16 cmpDimNum, Int16 cmpSrcType, Int16[] pCmpSrcArray, Int32 errorLmt);
  2484. /// @brief 使能多轴比较
  2485. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_MultiAxCmpEnable", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2486. public static extern UInt32 IMC_MultiAxCmpEnable(Int16 cardIndex, Int16 groupNo, Int16 enable);
  2487. /// @brief 压入多轴比较数据
  2488. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_MultiAxCmpPushData", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2489. public static extern UInt32 IMC_MultiAxCmpPushData(Int16 cardIndex, Int16 groupNo, Int16 cmpDimNum, Int16 eventIndex, Int32[] pCmpPosArray, ref Int16 pSpace);
  2490. /// @brief 清除多轴比较缓冲区数据
  2491. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_MultiAxCmpClrData", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2492. public static extern UInt32 IMC_MultiAxCmpClrData(Int16 cardIndex, Int16 groupNo);
  2493. /// @brief 获取多轴比较剩余空间
  2494. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_MultiAxCmpGetSpace", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2495. public static extern UInt32 IMC_MultiAxCmpGetSpace(Int16 cardIndex, Int16 groupNo, ref Int16 pSpace);
  2496. /// @brief 获取多轴比较状态
  2497. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_MultiAxCmpGetSts", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2498. public static extern UInt32 IMC_MultiAxCmpGetSts(Int16 cardIndex, Int16 groupNo, ref Int16 pStatus, ref Int16 pCmpCnt, ref Int16 pCmpIndex);
  2499. #endregion
  2500. ///@defgroup PLC PLC
  2501. ///@brief 板卡PLC功能相关接口
  2502. #region PLC
  2503. /// @brief 编译参数结构体
  2504. [StructLayout(LayoutKind.Sequential)]
  2505. public struct TCompileInfo
  2506. {
  2507. public IntPtr pFileName;
  2508. public IntPtr pLineNo;
  2509. public IntPtr pMessage;
  2510. };
  2511. /// @brief 编译参数结构体
  2512. [StructLayout(LayoutKind.Sequential)]
  2513. public struct TVarInfo
  2514. {
  2515. public Int16 id;
  2516. public Int16 dataType;
  2517. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
  2518. public char[] name;
  2519. //public string name;
  2520. };
  2521. /// @brief 状态参数结构体
  2522. [StructLayout(LayoutKind.Sequential)]
  2523. public struct TThreadSts
  2524. {
  2525. public Int16 run;
  2526. public Int16 error;
  2527. public double result;
  2528. public Int16 line;
  2529. };
  2530. [StructLayout(LayoutKind.Sequential)]
  2531. public struct TBindDi
  2532. {
  2533. public Int16 diType;
  2534. public Int16 index; //绑定索引从1 开始
  2535. public Int16 reverse;
  2536. };
  2537. [StructLayout(LayoutKind.Sequential)]
  2538. public struct TBindDo
  2539. {
  2540. public Int16 doType;
  2541. public Int16 index; //绑定索引从1 开始
  2542. public Int16 reverse;
  2543. };
  2544. [StructLayout(LayoutKind.Sequential)]
  2545. public struct TBindTimer
  2546. {
  2547. public Int16 timerType; // 0 TT 1:TF 2:TTF
  2548. public Int32 delay; // 单位:ms
  2549. public Int16 inputVarId; //输入控制变量
  2550. };
  2551. [StructLayout(LayoutKind.Sequential)]
  2552. public struct TBindCounter
  2553. {
  2554. public Int16 counterType; //计数器类型:0-等于输出1 1-小于等于输出1 2-大于等于输出1
  2555. public Int16 edge; //计数沿: 0-上升沿 1-下降沿 2-双边沿
  2556. public Int32 init; //计数初值:复位变量为1时,内部计数恢复初值,(起点,终点)
  2557. public Int32 target; //计数器目标值
  2558. public Int32 begin; //计数器起点
  2559. public Int32 end; //计数器终点
  2560. public Int16 dir; //计数方向: 1-正向计数 -1-负向计数
  2561. public Int32 unit; //计数单位:计数器累加1次需要输入端出现边沿的次数
  2562. public Int16 inputVarId; //计数器输入变量
  2563. public Int16 resetVarId; //计数器复位变量
  2564. };
  2565. [StructLayout(LayoutKind.Sequential)]
  2566. public struct TBindFlank
  2567. {
  2568. public Int16 flankType; //边沿触发器类型:0-下降沿触发 1-上升沿触发 2-双边沿触发
  2569. public Int16 inputVarId; //边沿触发器输入变量,触发后保持到执行周期结束
  2570. };
  2571. [StructLayout(LayoutKind.Sequential)]
  2572. public struct TBindSrff
  2573. {
  2574. public Int16 setVarId; //置位变量 置位为1,输出1
  2575. public Int16 resetVarId; //复位变量 复位为1,置位为0,输出0
  2576. };
  2577. /// @brief 编译
  2578. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_Compile", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2579. public static extern UInt32 IMC_Compile(string pFileName, ref TCompileInfo pWrongInfo);
  2580. /// @brief 下载
  2581. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_Download", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2582. public static extern UInt32 IMC_Download(Int16 cardIndex, string pFileName);
  2583. /// @brief 获取函数id
  2584. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetFunId", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2585. public static extern UInt32 IMC_GetFunId(Int16 cardIndex, string pFunName, ref Int16 pFunId);
  2586. /// @brief 获取变量id
  2587. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetVarId", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2588. public static extern UInt32 IMC_GetVarId(Int16 cardIndex, string pFunName, string pVarName, ref TVarInfo pVarInfo);
  2589. /// @brief 绑定线程
  2590. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_Bind", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2591. public static extern UInt32 IMC_Bind(Int16 cardIndex, Int16 thread, Int16 funId, Int16 page);
  2592. /// @brief 运行线程
  2593. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_RunThread", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2594. public static extern UInt32 IMC_RunThread(Int16 cardIndex, Int16 thread);
  2595. /// @brief 按周期运行线程
  2596. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_RunThreadPeriod", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2597. public static extern UInt32 IMC_RunThreadPeriod(Int16 cardIndex, Int16 thread, Int16 period, Int16 priority);
  2598. /// @brief 按断点运行线程
  2599. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_RunThreadToBreakpoint", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2600. public static extern UInt32 IMC_RunThreadToBreakpoint(Int16 cardIndex, Int16 thread, Int16 line);
  2601. /// @brief 单步运行线程
  2602. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_StepThread", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2603. public static extern UInt32 IMC_StepThread(Int16 cardIndex, Int16 thread);
  2604. /// @brief 停止线程
  2605. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_StopThread", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2606. public static extern UInt32 IMC_StopThread(Int16 cardIndex, Int16 thread);
  2607. /// @brief 暂停线程
  2608. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_PauseThread", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2609. public static extern UInt32 IMC_PauseThread(Int16 cardIndex, Int16 thread);
  2610. /// @brief 获取线程状态
  2611. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetThreadSts", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2612. public static extern UInt32 IMC_GetThreadSts(Int16 cardIndex, Int16 thread, ref TThreadSts pThreadSts);
  2613. /// @brief 获取线程运行周期
  2614. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetThreadTime", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2615. public static extern UInt32 IMC_GetThreadTime(Int16 cardIndex, Int16 thread, ref Int16 pPeriod, ref UInt32 pExecuteTime, ref UInt32 pExecuteTimeMax);
  2616. /// @brief 获取线程运行时间
  2617. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetThreadRunTime", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2618. public static extern UInt32 IMC_GetThreadRunTime(Int16 cardIndex, Int16 thread, ref UInt32 pExecuteTime, ref UInt32 pExecuteTimeMax);
  2619. /// @brief 设置变量值
  2620. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetVarValue", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2621. public static extern UInt32 IMC_SetVarValue(Int16 cardIndex, Int16 page, ref TVarInfo pVarInfo, double[] pValue, Int16 count);
  2622. /// @brief 获取变量值
  2623. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetVarValue", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2624. public static extern UInt32 IMC_GetVarValue(Int16 cardIndex, Int16 page, ref TVarInfo pVarInfo, double[] pValue, Int16 count);
  2625. /// @brief 解除绑定
  2626. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_UnbindVar", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2627. public static extern UInt32 IMC_UnbindVar(Int16 cardIndex, Int16 thread);
  2628. /// @brief 绑定DI
  2629. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_BindDi", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2630. public static extern UInt32 IMC_BindDi(Int16 cardIndex, Int16 thread, ref TVarInfo pVarInfo, ref TBindDi pBindDi);
  2631. /// @brief 绑定DO
  2632. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_BindDo", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2633. public static extern UInt32 IMC_BindDo(Int16 cardIndex, Int16 thread, ref TVarInfo pVarInfo, ref TBindDo pBindDo);
  2634. /// @brief 绑定Timer
  2635. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_BindTimer", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2636. public static extern UInt32 IMC_BindTimer(Int16 cardIndex, Int16 thread, ref TVarInfo pVarInfo, ref TBindTimer pBindTimer);
  2637. /// @brief 绑定计数器
  2638. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_BindCounter", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2639. public static extern UInt32 IMC_BindCounter(Int16 cardIndex, Int16 thread, ref TVarInfo pVarInfo, ref TBindCounter pBindCounter);
  2640. /// @brief 绑定触发器Flank
  2641. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_BindFlank", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2642. public static extern UInt32 IMC_BindFlank(Int16 cardIndex, Int16 thread, ref TVarInfo pVarInfo, ref TBindFlank pBindFlank);
  2643. /// @brief 绑定置位器
  2644. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_BindSrff", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2645. public static extern UInt32 IMC_BindSrff(Int16 cardIndex, Int16 thread, ref TVarInfo pVarInfo, ref TBindSrff pBindSrff);
  2646. /// @brief 获取绑定DI输入状态
  2647. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetBindDi", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2648. public static extern UInt32 IMC_GetBindDi(Int16 cardIndex, ref TVarInfo pVarInfo, ref TBindDi pBindDi);
  2649. /// @brief 获取绑定DO输出状态
  2650. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetBindDo", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2651. public static extern UInt32 IMC_GetBindDo(Int16 cardIndex, ref TVarInfo pVarInfo, ref TBindDo pBindDo);
  2652. /// @brief 获取绑定Timer输出状态
  2653. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetBindTimer", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2654. public static extern UInt32 IMC_GetBindTimer(Int16 cardIndex, ref TVarInfo pVarInfo, ref TBindTimer pBindTimer, ref Int32 pCount);
  2655. /// @brief 获取绑定计数器输出状态
  2656. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetBindCounter", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2657. public static extern UInt32 IMC_GetBindCounter(Int16 cardIndex, ref TVarInfo pVarInfo, ref TBindCounter pBindCounter, ref Int32 pUnitCount, ref Int32 pCount);
  2658. /// @brief 获取绑定触发器Flank输出状态
  2659. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetBindFlank", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2660. public static extern UInt32 IMC_GetBindFlank(Int16 cardIndex, ref TVarInfo pVarInfo, ref TBindFlank pBindFlank);
  2661. /// @brief 获取绑定置位器Srff输出状态
  2662. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetBindSrff", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2663. public static extern UInt32 IMC_GetBindSrff(Int16 cardIndex, ref TVarInfo pVarInfo, ref TBindSrff pBindSrff);
  2664. /// @brief 获取绑定Di数量
  2665. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetBindDiCount", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2666. public static extern UInt32 IMC_GetBindDiCount(Int16 cardIndex, Int16 thread, ref Int16 pCount);
  2667. /// @brief 获取绑定Do数量
  2668. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetBindDoCount", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2669. public static extern UInt32 IMC_GetBindDoCount(Int16 cardIndex, Int16 thread, ref Int16 pCount);
  2670. /// @brief 获取绑定Timer数量
  2671. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetBindTimerCount", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2672. public static extern UInt32 IMC_GetBindTimerCount(Int16 cardIndex, Int16 thread, ref Int16 pCount);
  2673. /// @brief 获取绑定Counter数量
  2674. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetBindCounterCount", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2675. public static extern UInt32 IMC_GetBindCounterCount(Int16 cardIndex, Int16 thread, ref Int16 pCount);
  2676. /// @brief 获取绑定Flank数量
  2677. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetBindFlankCount", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2678. public static extern UInt32 IMC_GetBindFlankCount(Int16 cardIndex, Int16 thread, ref Int16 pCount);
  2679. /// @brief 获取绑定Srff数量
  2680. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetBindSrffCount", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2681. public static extern UInt32 IMC_GetBindSrffCount(Int16 cardIndex, Int16 thread, ref Int16 pCount);
  2682. /// @brief 获取绑定DI信息
  2683. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetBindDiInfo", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2684. public static extern UInt32 IMC_GetBindDiInfo(Int16 cardIndex, Int16 thread, Int16 index, ref Int16 pVar, ref TBindDi pBindDi);
  2685. /// @brief 获取绑定DO信息
  2686. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetBindDoInfo", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2687. public static extern UInt32 IMC_GetBindDoInfo(Int16 cardIndex, Int16 thread, Int16 index, ref Int16 pVar, ref TBindDo pBindDo);
  2688. /// @brief 获取绑定Timer信息
  2689. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetBindTimerInfo", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2690. public static extern UInt32 IMC_GetBindTimerInfo(Int16 cardIndex, Int16 thread, Int16 index, ref Int16 pVar, ref TBindTimer pBindTimer);
  2691. /// @brief 获取绑定计数器信息
  2692. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetBindCounterInfo", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2693. public static extern UInt32 IMC_GetBindCounterInfo(Int16 cardIndex, Int16 thread, Int16 index, ref Int16 pVar, ref TBindCounter pBindCounter);
  2694. /// @brief 获取绑定触发器Flank信息
  2695. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetBindFlankInfo", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2696. public static extern UInt32 IMC_GetBindFlankInfo(Int16 cardIndex, Int16 thread, Int16 index, ref Int16 pVar, ref TBindFlank pBindFlank);
  2697. /// @brief 获取绑定置位器Srff信息
  2698. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetBindSrffInfo", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2699. public static extern UInt32 IMC_GetBindSrffInfo(Int16 cardIndex, Int16 thread, Int16 index, ref Int16 pVar, ref TBindSrff pBindSrff);
  2700. #endregion
  2701. ///@defgroup PulseDO PulseDO
  2702. ///@brief 板卡脉冲DO输出功能相关接口
  2703. #region PulseDO
  2704. /// @brief 设置脉冲DO输出映射
  2705. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetPulseDoMap", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2706. public static extern UInt32 IMC_SetPulseDoMap(Int16 cardIndex, Int16 index, Int16 doIndex);
  2707. /// @brief 获取脉冲DO输出映射
  2708. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetPulseDoMap", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2709. public static extern UInt32 IMC_GetPulseDoMap(Int16 cardIndex, Int16 index, ref Int16 pDoIndex);
  2710. /// @brief 设置脉冲DO输出通道参数
  2711. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetPulseDoOutputParam", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2712. public static extern UInt32 IMC_SetPulseDoOutputParam(Int16 cardIndex, Int16 index, UInt16 highLevelTime, UInt16 lowLevTime, Int16 firstLevel, Int16 pulseNum);
  2713. /// @brief 使能脉冲DO输出
  2714. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_EnablePulseDo", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2715. public static extern UInt32 IMC_EnablePulseDo(Int16 cardIndex, Int16 index, UInt16 highLevelTime, UInt16 lowLevTime, Int16 firstLevel, Int16 pulseNum);
  2716. /// @brief 停止脉冲DO输出
  2717. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_DisablePulseDo", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2718. public static extern UInt32 IMC_DisablePulseDo(Int16 cardIndex, Int16 index);
  2719. /// @brief 获取脉冲DO输出状态
  2720. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetPulseDoStatus", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2721. public static extern UInt32 IMC_GetPulseDoStatus(Int16 cardIndex, Int16 index, ref Int16 pStatus);
  2722. #endregion
  2723. ///@defgroup Event Event
  2724. ///@brief 板卡事件功能相关接口
  2725. #region Event
  2726. /// @brief 设置事件
  2727. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetEvent", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2728. public static extern UInt32 IMC_SetEvent(Int16 cardIndex, Int16 eventIndex, ref TEvent pEvent);
  2729. /// @brief 设置任务
  2730. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetTask", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2731. public static extern UInt32 IMC_SetTask(Int16 cardIndex, Int16 taskIndex, Int16 taskType, IntPtr pTask);
  2732. /// @brief 设置事件与任务连接
  2733. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_SetEventTaskLink", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2734. public static extern UInt32 IMC_SetEventTaskLink(Int16 cardIndex, Int16 eventIndex, Int16[] taskIndexArray, Int16 count);
  2735. /// @brief 事件开启
  2736. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_EventOn", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2737. public static extern UInt32 IMC_EventOn(Int16 cardIndex, Int16 eventIndex, Int16 count = 1);
  2738. /// @brief 事件关闭
  2739. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_EventOff", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2740. public static extern UInt32 IMC_EventOff(Int16 cardIndex, Int16 eventIndex, Int16 count = 1);
  2741. /// @brief 事件强制触发
  2742. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_EventForceTrigger", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2743. public static extern UInt32 IMC_EventForceTrigger(Int16 cardIndex, Int16 eventIndex, Int16 count = 1);
  2744. /// @brief 清除事件
  2745. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_ClearEvent", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2746. public static extern UInt32 IMC_ClearEvent(Int16 cardIndex, Int16 eventIndex, Int16 count = 1);
  2747. /// @brief 清除任务
  2748. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_ClearTask", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2749. public static extern UInt32 IMC_ClearTask(Int16 cardIndex, Int16 taskIndex, Int16 count = 1);
  2750. /// @brief 清除事件与任务的连接
  2751. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_ClearEventTaskLink", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2752. public static extern UInt32 IMC_ClearEventTaskLink(Int16 cardIndex, Int16 eventIndex, Int16 count = 1);
  2753. /// @brief 获取设置的事件数量
  2754. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEventCount", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2755. public static extern UInt32 IMC_GetEventCount(Int16 cardIndex, ref Int16 pCount);
  2756. /// @brief 获取设置的事件
  2757. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEvent", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2758. public static extern UInt32 IMC_GetEvent(Int16 cardIndex, Int16 eventIndex, ref TEvent pEvent);
  2759. /// @brief 获取事件的触发次数
  2760. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEventTriggerCount", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2761. public static extern UInt32 IMC_GetEventTriggerCount(Int16 cardIndex, Int16 eventIndex, ref Int16 pTriggerCount);
  2762. /// @brief 获取设置的任务数量
  2763. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetTaskCount", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2764. public static extern UInt32 IMC_GetTaskCount(Int16 cardIndex, ref Int16 pCount);
  2765. /// @brief 获取任务
  2766. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetTask", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2767. public static extern UInt32 IMC_GetTask(Int16 cardIndex, Int16 taskIndex, ref Int16 pTaskType, IntPtr pTaskData);
  2768. /// @brief 获取设置的事件与任务连接数量
  2769. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetEventTaskLinkCount", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2770. public static extern UInt32 IMC_GetEventTaskLinkCount(Int16 cardIndex, Int16 eventIndex, ref Int16 pCount);
  2771. /// @brief 获取任务执行结果
  2772. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_GetTaskResult", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2773. public static extern UInt32 IMC_GetTaskResult(Int16 cardIndex, Int16 taskIndex, ref Int16 pResult);
  2774. #endregion
  2775. ///@defgroup CmdList CmdList
  2776. ///@brief 板卡指令缓存输出功能相关接口
  2777. #region CmdList
  2778. /// @brief 启动缓存区指令执行
  2779. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CmdListStart", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2780. public static extern UInt32 IMC_CmdListStart(Int16 cardIndex, Int16 index, Int16 type);
  2781. /// @brief 停止指令缓存区执行
  2782. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CmdListStop", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2783. public static extern UInt32 IMC_CmdListStop(Int16 cardIndex, Int16 index);
  2784. /// @brief 设置指令缓存区运行模式
  2785. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CmdListSetMode", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2786. public static extern UInt32 IMC_CmdListSetMode(Int16 cardIndex, Int16 index, Int16 mode);
  2787. /// @brief 获取指令缓存区运行模式
  2788. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CmdListGetMode", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2789. public static extern UInt32 IMC_CmdListGetMode(Int16 cardIndex, Int16 index, ref Int16 mode);
  2790. /// @brief 获取指令缓存区运行状态、错误码和当前执行段号
  2791. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CmdListGetStatus", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2792. public static extern UInt32 IMC_CmdListGetStatus(Int16 cardIndex, Int16 index, ref Int16 pStatus, ref Int16 pErrorCode, ref Int32 pCurrentId);
  2793. /// @brief 获取指令缓存区剩余空间
  2794. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CmdListGetSpace", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2795. public static extern UInt32 IMC_CmdListGetSpace(Int16 cardIndex, Int16 index, ref Int16 pSpace);
  2796. /// @brief 清除指令缓存区数据
  2797. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CmdListClearData", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2798. public static extern UInt32 IMC_CmdListClearData(Int16 cardIndex, Int16 index);
  2799. /// @brief 清除指令缓存区错误
  2800. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CmdListClearError", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2801. public static extern UInt32 IMC_CmdListClearError(Int16 cardIndex, Int16 index);
  2802. /// @brief 设置指令缓存区循环执行次数
  2803. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CmdListSetLoop", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2804. public static extern UInt32 IMC_CmdListSetLoop(Int16 cardIndex, Int16 index, Int32 setCount);
  2805. /// @brief 获取指令缓存区循环执行次数
  2806. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CmdListGetLoop", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2807. public static extern UInt32 IMC_CmdListGetLoop(Int16 cardIndex, Int16 index, ref Int32 setCount, ref Int32 doneCount);
  2808. /// @brief 缓存区运动指令,执行轴PTP运动
  2809. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CmdListAxMove", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2810. public static extern UInt32 IMC_CmdListAxMove(Int16 cardIndex, Int16 index, Int16 axNo, double tgtPos, Int32 userID);
  2811. /// @brief 缓存区运动指令,在线更新ptp运动目标位置
  2812. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CmdListUpdateAxMovePos", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2813. public static extern UInt32 IMC_CmdListUpdateAxMovePos(Int16 cardIndex, Int16 index, Int16 axNo, double tgtPos, Int32 userID);
  2814. /// @brief 缓存区运动指令,在线更新轴运动速度参数
  2815. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CmdListUpdateAxMovePara", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2816. public static extern UInt32 IMC_CmdListUpdateAxMovePara(Int16 cardIndex, Int16 index, Int16 axNo, double tgtVel, double tgtAcc, double tgtDec, Int32 userID);
  2817. /// @brief 缓存区运动指令,执行轴ptp运动,目标位置来源为全局变量值
  2818. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CmdListAxMoveUserVar", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2819. public static extern UInt32 IMC_CmdListAxMoveUserVar(Int16 cardIndex, Int16 index, Int16 axNo, Int16 eventIndex, Int32 userID);
  2820. /// @brief 缓存区等待指令,延时等待一段时间
  2821. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CmdListWaitTime", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2822. public static extern UInt32 IMC_CmdListWaitTime(Int16 cardIndex, Int16 index, Int16 waitTime, Int32 userID);
  2823. /// @brief 缓存区等待指令,等待DI触发
  2824. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CmdListWaitDi", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2825. public static extern UInt32 IMC_CmdListWaitDi(Int16 cardIndex, Int16 index, Int16 diNo, Int16 diLevel, Int16 diType, Int32 userID);
  2826. /// @brief 缓存区等待指令,等待轴运动到位
  2827. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CmdListWaitAxMoveDone", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2828. public static extern UInt32 IMC_CmdListWaitAxMoveDone(Int16 cardIndex, Int16 index, Int16 axNo, Int16 arrvType, Int32 userID);
  2829. /// @brief 缓存区等待指令,等待轴位置穿越位置
  2830. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CmdListWaitAxPosCross", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2831. public static extern UInt32 IMC_CmdListWaitAxPosCross(Int16 cardIndex, Int16 index, Int16 axNo, Int32 Pos, Int16 crossType, Int32 userID);
  2832. /// @brief 缓存区等待指令,等待全局变量值
  2833. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CmdListWaitUserVar", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2834. public static extern UInt32 IMC_CmdListWaitUserVar(Int16 cardIndex, Int16 index, Int16 varIndex, Int32 varValue, Int32 userID);
  2835. /// @brief 缓存区等待指令,等待事件执行完成
  2836. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CmdListWaitEventDone", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2837. public static extern UInt32 IMC_CmdListWaitEventDone(Int16 cardIndex, Int16 index, Int16 eventIndex, Int32 userID);
  2838. /// @brief 缓存区设置指令,设置DO输出
  2839. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CmdListSetDo", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2840. public static extern UInt32 IMC_CmdListSetDo(Int16 cardIndex, Int16 index, Int16 doNo, Int16 doLevel, Int16 doType, Int32 userID);
  2841. /// @brief 缓存区设置指令,设置脉冲DO输出
  2842. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CmdListSetPulseDo", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2843. public static extern UInt32 IMC_CmdListSetPulseDo(Int16 cardIndex, Int16 index, Int16 outIndex, Int32 userID);
  2844. /// @brief 缓存区设置指令,设置事件启动
  2845. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CmdListSetUserVal", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2846. public static extern UInt32 IMC_CmdListSetUserVal(Int16 cardIndex, Int16 index, Int16 varIndex, Int32 varValue, Int32 userID);
  2847. /// @brief 缓存区设置指令,设置全局变量值
  2848. [DllImport(Imc60ApiDllName, EntryPoint = "IMC_CmdListSetEventTrigger", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
  2849. public static extern UInt32 IMC_CmdListSetEventTrigger(Int16 cardIndex, Int16 index, Int16 eventIndex, Int32 userID);
  2850. #endregion
  2851. }
  2852. }