Post general discussions on using our drivers to write your own software here
- Posts: 0
- Joined: Mon Feb 22, 2016 2:43 am
I am using the PT-104 data logger and writing some software to control it. The API provides a UsbPt104GetValue function - prototype:
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?
Code: Select all
PICO_STATUS UsbPt104GetValue (
long * value,
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.
- PICO STAFF
- Posts: 2855
- Joined: Tue May 31, 2011 3:43 pm
- Location: St. Neots, Cambridgeshire
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 to the call it should write the value to the 6th element in the array.
Hope this helps.
Software Dev. Engineer