Forums › SM Series Discussions › Queued Sweep Synchronizations › Reply To: Queued Sweep Synchronizations
Also, real quickly. Why is the C# API declaration for smSetGPIOSweep commented out for the structs? It should be fairly simple to pass an array of structs from C# to C++, like so:
[StructLayout(LayoutKind.Sequential)]
public struct SmGPIOStep
{
public double freq;
public Byte mask; // gpio bits
public SmGPIOStep(double f, Byte m)
{
this.freq = f;
this.mask = m;
}
}
[DllImport(“sm_api.dll”, CallingConvention = CallingConvention.Cdecl)]
public static extern SmStatus smSetGPIOSweep(int device,[In, Out]SmGPIOStep[] steps, int stepCount);
Is there some mismatch or oddities on the other side? It’s just two fairly straightforward variables.
Edit: If I put one of the GPIO’s on the O-scope, and run the GPIO Sweep sample code with this change in C#, I get a waveform that looks about right….
- This reply was modified 7 years, 8 months ago by
kaiser.