Passing UDT to ps5000SetTriggerChannelProperties

Post your VB and VBA discussions here
Post Reply
Jay H
Newbie
Posts: 0
Joined: Wed Mar 31, 2010 2:13 pm

Passing UDT to ps5000SetTriggerChannelProperties

Post by Jay H »

Sent a question to TechSupport which Robin might have read already but just in case anybody out there have figured this out.

I have the core of the scope program ported from C to Visual Basic 6.0 and have it working for the most part for Block Data Mode and Streaming Data. I have not implemented ETS or Rapid Block Mode yet, but am trying to get multiple Triggers up and Running. My code works fine for a single array of Structs when passed to ps5000SetTriggerChannelProperties but I get an INVALID TRIGGER_PROPERTY when trying to pass 2 or more elements in the array of struct (UDT type is "TRIGGER_CHANNEL_PROPERTIES").

I think it is because of the UDT and passing that to a C DLL, the C program doesn't know how to traverse the VB UDT or is trying and failing miserably.

Here is a MSDN link that seems pertinent:
http://support.microsoft.com/kb/194609

However, obviously I have no access to the C code. I am somewhat new to VB and VB 6.0 and wondering if somebody can help me figure out if this would be possible given the DLL and VB6.0?

Thanks
Jay

Robin
Advanced User
Advanced User
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Re: Passing UDT to ps5000SetTriggerChannelProperties

Post by Robin »

Hi Jay

I have gotten around this in the Excel (VBA) example by using a wrapper DLL. Both the Excel example and the wrapper DLL (including source code) are available in the SDK.

See the functions SetTriggerConditions and SetTriggerProperties in ps5000wrap.c

I hope this helps

Robin

Post Reply