Test and Measurement Forum

Passing UDT to ps5000SetTriggerChannelProperties

Post your VB and VBA discussions here

Passing UDT to ps5000SetTriggerChannelProperties

Postby Jay H » Mon Apr 12, 2010 8:07 pm

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:

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?

Jay H
Posts: 0
Joined: Wed Mar 31, 2010 2:13 pm

Re: Passing UDT to ps5000SetTriggerChannelProperties

Postby Robin » Tue Apr 13, 2010 10:46 am

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

Zen Master
Zen Master
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Return to VB and VBA (Excel, Access)

Who is online

Users browsing this forum: No registered users and 0 guests