Okay, so i try to initialize one field of this structure of USMC_Device(user manual):
USMC_Devices
The USMC_Devices structure describes devices connected to computer.
Type Name Description
DWORD NOD Number of devices connected to computer
char ** Serial Array of pointers to 16–byte ASCII strings of length – NOD
char ** Version Array of pointers to 4–byte ASCII strings of length – NOD
Does this mean, it should be okay if i only initialize NOD like this:
(I think it must be zero because i only have one stepper, but i am not sure if 1 or 0 ist right here)
Devices_st.NOD=0;
Devices_st=libstruct('USMC_Devices_st');
calllib('USMCDLL', 'USMC_Init', Devices_st);
If i try this code Matlab crashes abd needs to close and i get this message:
Fault Count: 1
Abnormal termination:
Access violation
Register State (from fault):
RAX = 0000000000000000 RBX = 0000000000000000
RCX = 3ee8ca97553b0000 RDX = 0000000000000000
RSP = 000000000402aa90 RBP = 000007fefb831000
RSI = 000000000000127f RDI = 0000000027a7c3c0
R8 = 000000000402a9a8 R9 = 00000000001202c4
R10 = 0000000000000000 R11 = 0000000000000000
R12 = 0000000029431d90 R13 = 0000000027a7c3c0
R14 = 000000000402ad90 R15 = 0000000000000001
RIP = 0000000029431f31 EFL = 00010246
CS = 0033 FS = 0053 GS = 002b
Stack Trace (from fault):
[ 0] 0x0000000029431f31 C:\Windows\system32\USMCDLL.dll+00007985 USMC_Refresh+00000065
[ 1] 0x000007fefb831037 C:\Users\durmus\AppData\Local\Temp\tp5bb9ab27_c429_43de_a819_422f7c8ffd46\USMCDLL_thunk_pcwin64.dll+00004151 ulongvoidPtrThunk+00000055
[ 2] 0x00000000293e5df3 C:\Program Files\MATLAB\R2013b\bin\win64\libmwcli.dll+00024051 MLTerminate_libmwcli+00019059
[ 3] 0x00000000293e6065 C:\Program Files\MATLAB\R2013b\bin\win64\libmwcli.dll+00024677 MLTerminate_libmwcli+00019685
[ 4] 0x00000000293e735d C:\Program Files\MATLAB\R2013b\bin\win64\libmwcli.dll+00029533 MLTerminate_libmwcli+00024541
[ 5] 0x00000000293fcfec C:\Program Files\MATLAB\R2013b\bin\win64\libmwcli.dll+00118764 PointerMapSize+00072076
[ 6] 0x00000000293fd6a0 C:\Program Files\MATLAB\R2013b\bin\win64\libmwcli.dll+00120480 PointerMapSize+00073792
[ 7] 0x000000018000d7ff C:\Program Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00055295 Mfh_file::dispatch_fh+00001167
[ 8] 0x000000018000ddb7 C:\Program Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00056759 Mfunction_handle::dispatch+00000487
[ 9] 0x0000000004f16a81 C:\Program Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00486017 inFunctionHandleInterface::DestroyWorkspace+00308737
[ 10] 0x0000000004fa0657 C:\Program Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01050199 inEachVisibleName+00015383
[ 11] 0x0000000004f146c2 C:\Program Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00476866 inFunctionHandleInterface::DestroyWorkspace+00299586
[ 12] 0x0000000004efb85f C:\Program Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374879 inFunctionHandleInterface::DestroyWorkspace+00197599
[ 13] 0x0000000004efb7c8 C:\Program Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374728 inFunctionHandleInterface::DestroyWorkspace+00197448
[ 14] 0x0000000004f1ebbd C:\Program Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00519101 inFunctionHandleInterface::DestroyWorkspace+00341821
[ 15] 0x0000000004f1b5cc C:\Program Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00505292 inFunctionHandleInterface::DestroyWorkspace+00328012
[ 16] 0x0000000004efe529 C:\Program Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00386345 inFunctionHandleInterface::DestroyWorkspace+00209065
[ 17] 0x000000018000d612 C:\Program Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00054802 Mfh_file::dispatch_fh+00000674
[ 18] 0x000000018000defa C:\Program Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00057082 Mfunction_handle::dispatch+00000810
[ 19] 0x0000000004fb438e C:\Program Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01131406 inSetWorkSpaces+00001262
[ 20] 0x0000000004fc06f5 C:\Program Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01181429 SetInterpreter+00000325
[ 21] 0x0000000004fc2cb5 C:\Program Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01191093 inEvalCmd+00008789
[ 22] 0x0000000004fc2c82 C:\Program Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01191042 inEvalCmd+00008738
[ 23] 0x0000000004fc2c47 C:\Program Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01190983 inEvalCmd+00008679
[ 24] 0x00000000053aad0c C:\Program Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+05287180 inMexPutVariable+00008364
[ 25] 0x00000000053ab066 C:\Program Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+05288038 inMexPutVariable+00009222
[ 26] 0x00000000053ab49e C:\Program Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+05289118 inMexPutVariable+00010302
[ 27] 0x00000000053ab7dc C:\Program Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+05289948 inMexPutVariable+00011132
[ 28] 0x00000000052bff91 C:\Program Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+04325265 inEvalCmdWithLocalReturn+00000065
[ 29] 0x000000006c71be9d C:\Program Files\MATLAB\R2013b\bin\win64\libmwbridge.dll+00048797 mnDebugPrompt+00000109
[ 30] 0x000000006c71cf7f C:\Program Files\MATLAB\R2013b\bin\win64\libmwbridge.dll+00053119 mnParser+00000735
[ 31] 0x000000006e4ff4b4 C:\Program Files\MATLAB\R2013b\bin\win64\mcr.dll+00193716 mcrInstance::mnParser_on_interpreter_thread+00000036
[ 32] 0x000000006e4e44b0 C:\Program Files\MATLAB\R2013b\bin\win64\mcr.dll+00083120 mcr::runtime::setInterpreterThreadToCurrent+00029472
[ 33] 0x000000006e4e4510 C:\Program Files\MATLAB\R2013b\bin\win64\mcr.dll+00083216 mcr::runtime::setInterpreterThreadToCurrent+00029568
[ 34] 0x000000006b01fa96 C:\Program Files\MATLAB\R2013b\bin\win64\uiw.dll+00391830 UIW_IsUserMessage+00000086
[ 35] 0x000000006b020175 C:\Program Files\MATLAB\R2013b\bin\win64\uiw.dll+00393589 UIW_SetGLIMUserMsg+00000117
[ 36] 0x000000006b0201f9 C:\Program Files\MATLAB\R2013b\bin\win64\uiw.dll+00393721 UIW_SetGLIMUserMsg+00000249
[ 37] 0x00000000771987fe C:\Windows\system32\USER32.dll+00165886 GetMenuBarInfo+00000638
[ 38] 0x000000007717f5fb C:\Windows\system32\USER32.dll+00062971 SystemParametersInfoW+00000235
[ 39] 0x0000000077184895 C:\Windows\system32\USER32.dll+00084117 IsProcessDPIAware+00000465
[ 40] 0x00000000777511f5 C:\Windows\SYSTEM32\ntdll.dll+00332277 KiUserCallbackDispatcher+00000031
[ 41] 0x000000007718908a C:\Windows\system32\USER32.dll+00102538 PeekMessageW+00000186
[ 42] 0x00000000771850fe C:\Windows\system32\USER32.dll+00086270 GetKeyState+00000238
[ 43] 0x0000000077183a6f C:\Windows\system32\USER32.dll+00080495 PeekMessageA+00000087
[ 44] 0x000000006aff94db C:\Program Files\MATLAB\R2013b\bin\win64\uiw.dll+00234715 UIW_SetCurrentDialog+00000731
[ 45] 0x000000006b021632 C:\Program Files\MATLAB\R2013b\bin\win64\uiw.dll+00398898 ws_FreeSystemFont+00000482
[ 46] 0x000000006f156600 C:\Program Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01009152 services::system_events::PpeDispatchHook::~PpeDispatchHook+00055552
[ 47] 0x000000006f156fc5 C:\Program Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01011653 services::system_events::PpeDispatchHook::~PpeDispatchHook+00058053
[ 48] 0x000000006f157e10 C:\Program Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01015312 services::system_events::PpeDispatchHook::~PpeDispatchHook+00061712
[ 49] 0x000000006f160596 C:\Program Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01050006 sysq::removeProcessPendingEventsHook+00010998
[ 50] 0x000000006f16089a C:\Program Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01050778 svWS_ProcessPendingEvents+00000138
[ 51] 0x000000006e4e552d C:\Program Files\MATLAB\R2013b\bin\win64\mcr.dll+00087341 mcr::runtime::setInterpreterThreadToCurrent+00033693
[ 52] 0x000000006e4e57fb C:\Program Files\MATLAB\R2013b\bin\win64\mcr.dll+00088059 mcr::runtime::setInterpreterThreadToCurrent+00034411
[ 53] 0x000000006e4d9545 C:\Program Files\MATLAB\R2013b\bin\win64\mcr.dll+00038213 mcrInstantiationError::operator=+00003221
[ 54] 0x000000006e4dc872 C:\Program Files\MATLAB\R2013b\bin\win64\mcr.dll+00051314 mcr_invoke_on_interpreter_thread+00001602
[ 55] 0x000000006e4e98e6 C:\Program Files\MATLAB\R2013b\bin\win64\mcr.dll+00104678 mcrDesktopMain+00000230
[ 56] 0x0000000140004f0b C:\Program Files\MATLAB\R2013b\bin\win64\MATLAB.exe+00020235
[ 57] 0x0000000140006a07 C:\Program Files\MATLAB\R2013b\bin\win64\MATLAB.exe+00027143
[ 58] 0x000000007749652d C:\Windows\system32\kernel32.dll+00091437 BaseThreadInitThunk+00000013
[ 59] 0x000000007772c541 C:\Windows\SYSTEM32\ntdll.dll+00181569 RtlUserThreadStart+00000033
Thank you for any help.
Philip Borghesani <
phi...@mathworks.com> wrote in message <lfo274$iac$
1...@newscl01ah.mathworks.com>...