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

View previous topic View next topic Go down

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

Post  JimHokanson on Fri Jul 28, 2017 8:36 am

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 : 7
Join date : 2017-07-07

View user profile

Back to top Go down

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

Post  Frank MCS on Tue Aug 01, 2017 1:17 am

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
avatar
Frank MCS

Posts : 183
Join date : 2008-07-14

View user profile

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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