Welcome to our user forum (read only mode).
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Unable to retrieve proper trigger settings and capacity in Matlab for STG

Go down

Unable to retrieve proper trigger settings and capacity in Matlab for STG Empty Unable to retrieve proper trigger settings and capacity in Matlab for STG

Post  JimHokanson Fri Jul 28, 2017 9:36 pm

After much trying I can't get the GetCapacity or GetTrigger methods to work. The only value that seems to work is the channel map for GetTrigger. In particular, I've verified that setting the 'repeat' value works, based on stimulation time, but I can't properly query the 'repeat' value from GetTrigger.  Is it possible these methods aren't working properly? Can anyone show a solution in Matlab or even C# in which these methods work?

Some example code:
Code:
device.SetCapacity(ones(1,4,'uint32'),ones(1,4,'uint32'))
chan_cap = uint32(device.GetCapacity);
%chan_cap isn't 1,1,1,1 as expected

device.SetTriggerSource(0,1,1,100);
c2 = NET.convertArray(zeros(1,4),'System.UInt32');
s2 = NET.convertArray(zeros(1,4),'System.UInt32');
r2 = NET.convertArray(zeros(1,4),'System.UInt32');        
[c2,s2,r2] = obj.h.GetTrigger(c2,s2,r2);
repeats = uint32(r2); %not showing 100 as expected

Calling into .NET

Code:
         
UInt32[] c1 = { 1 };
UInt32[] s1 = { 1 };
UInt32[] r1 = { 10 };

//dbasic => public CStg200xDownloadBasicNet dbasic;
dbasic.SetupTrigger(0, c1, s1, r1);
uint[] a = { 1, 1, 1, 1 };
uint[] b = {0, 1, 2, 3};
uint[] c = {0, 0, 0, 0};
dbasic.GetTrigger(ref a,ref b,ref c);

System.Console.WriteLine(c[0]);

//c[0] not 10 as expected.

Additionally, I'm curious as to why GetTrigger uses "ref" definitions instead of "out". The results from the sync_map and repeat from GetTrigger seem to just be the "inputs" that I am passing to the function.

I'm using 3.2.45 of the dll and an STG4004 SW version 1.46

Thanks,
Jim

JimHokanson

Posts : 8
Join date : 2017-07-07

Back to top Go down

Unable to retrieve proper trigger settings and capacity in Matlab for STG Empty Re: Unable to retrieve proper trigger settings and capacity in Matlab for STG

Post  Frank MCS Tue Aug 01, 2017 2:17 pm

Dear Jim,
it's indeed a bug in the .dll. Could you provide an e-mail, or write to support@multichannelsystems.com, so we can send the fixed version?

Frank MCS
Frank MCS
Frank MCS

Posts : 188
Join date : 2008-07-14

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum