Test and Measurement Forum

Simple question about UsbPt104GetValue

Post general discussions on using our drivers to write your own software here

Simple question about UsbPt104GetValue

Postby iain_w » Mon Feb 22, 2016 2:54 am

I am using the PT-104 data logger and writing some software to control it. The API provides a UsbPt104GetValue function - prototype:

Code: Select all
PICO_STATUS UsbPt104GetValue (
short handle,
USBPT104_CHANNELS channel,
long * value,
short filtered

The long * value argument receives the data. I see that it is a pointer - how large is the returned data? Is it guaranteed to just be a single long-size item, or is the pointer indicating that an array of items can be returned here? If so, how can the programmer tell how much space to allocate for the data?

That's it, really. I'm assuming that just a single long-size item is returned, but assuming things is how bugs tend to work their way into my code! If anyone can let me know for sure, that would be great.


Posts: 0
Joined: Mon Feb 22, 2016 2:43 am

Re: Simple question about UsbPt104GetValue

Postby Hitesh » Mon Feb 22, 2016 9:05 am

Hi Iain,

The value parameter will consist of a single signed 32-bit integer returned from the driver so the argument can either be a variable consisting of a single value or an array.

If it is an array, the value will be written at the position specified e.g. if you have an array called values consisting of 10 elements and pass values[5] to the call it should write the value to the 6th element in the array.

Hope this helps.

Technical Support Engineer
Site Admin
Site Admin
Posts: 2365
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Return to General Software Discussions

Who is online

Users browsing this forum: No registered users and 0 guests