« Close

Datasheets and User Guides

App Notes

Software & Driver

 

4.2.4 - eAddGoGet()

This function passes multiple requests via arrays, then executes a GoOne() and returns all the results via the same arrays.

The parameters that start with “*a” are arrays, and all must be initialized with at least a number of elements equal to NumRequests.

Declaration:

LJ_ERROR _stdcall eAddGoGet (  LJ_HANDLE Handle,
                               long NumRequests,
                               long *aIOTypes,
                               long *aChannels,
                               double *aValues,
                               long *ax1s,
                               long *aRequestErrors,
                               long *GoError,
                               long *aResultErrors)

Parameter Description:
Returns: LabJack errorcodes or 0 for no error.
Inputs:

  • Handle – Handle returned by OpenLabJack().
  • NumRequests – This is the number of requests that will be made, and thus the number of results that will be returned. All the arrays must be initialized with at least this many elements.
  • aIOTypes – An array which is the list of IOTypes.
  • aChannels – An array which is the list of Channels.
  • aValues – An array which is the list of Values to write.
  • ax1s – An array which is the list of x1s.

Outputs:

  • aValues – An array which is the list of Values read.
  • aRequestErrors – An array which is the list of errorcodes from each AddRequest().
  • GoError – The errorcode returned by the GoOne() call.
  • aResultErrors – An array which is the list of errorcodes from each GetResult().

4 comments

Need Code Example just in 2-3 lines

What programing language or program are you using to write your code?  We have many examples here: http://labjack.com/support/ud/examples

Generally using the separate AddRequest, Go, GetResult functions are easier to work with since you don't have to deal with arrays.  Especially if doing something simple with just a couple requests.

I have used above function to get 2 inputs from ain0, ain1. (in a loop, to get signal countinuesly)

I am getting the appropriate inputs form both channels.

But if switch off the input signal generator (2-4 times) labjak_u3 hangs.

Then i need to unplug usb to reset it.

Also it doesnot happen in U12.

I doubt that is related to this particular function.  Try just running the test panel in LJControlPanel and see if you can make the same thing happen.  I suggest you continue this issue via email to support@labjack.com or by posting on the forum.