« Close

Datasheets and User Guides

App Notes

Software & Driver

 

2.7 - GoOne()

After using AddRequest() to make an internal list of requests to perform, call GoOne() to actually perform the requests. This function causes all requests on one particular LabJack to be performed. After calling GoOne(), call GetResult() or similar to retrieve any returned data or errors.

GoOne() can be called repeatedly to repeat the current list of requests. GoOne() does not clear the list of requests. Rather, after a particular device has performed a GoOne(), the first subsequent AddRequest() call to that device will clear the previous list of requests on that particular device only.

Note that for a single Go() or GoOne() call, the order of execution of the request list cannot be predicted. Since the driver does internal optimization, it is quite likely not the same as the order of AddRequest() function calls. One thing that is known, is that configuration settings like ranges, stream settings, and such, will be done before the actual acquisition or setting of outputs.

Declaration:

LJ_ERROR _stdcall GoOne(  LJ_HANDLE Handle  )

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

  • Handle – Handle returned by OpenLabJack().

Outputs:

  • None

1 comments

Hello,

I am working on a project at work and we chose a Labjack U3 to use. I am programming the Labjack using Visual Studio and I am using C# as my programming language.

I am trying to read the rpm of a shaft using a keyphasor. This is an unconditioned signal that has some noise in it but basically it sends out a voltage pulse once every revolution.

I have written the code so that I read the rising edge of every pulse with a timer to determine the period of the signal. From here I can determine the rpm.

My problem is that it is not executing the GoOne() command. It gives the me error message "Error in the application". I have attached that section of my code in hopes that you can help me solve this problem.

Thank you

 

 

 static int keyPhasor(int rpm)//Keyphasor input

        {

            u3 = new U3(LJUD.CONNECTION.USB, "0", true); // Connection through USB

            LJUD.ePut(u3.ljhandle, LJUD.IO.PIN_CONFIGURATION_RESET, 0, 0, 0);//configure all ports back to factor reset

            LJUD.AddRequest(u3.ljhandle, LJUD.IO.PUT_CONFIG, LJUD.CHANNEL.TIMER_COUNTER_PIN_OFFSET, 4, 0, 0);//offsets the timers/counters by 4 making the first timer FIO4

            LJUD.AddRequest(u3.ljhandle, LJUD.IO.PUT_CONFIG, LJUD.CHANNEL.NUMBER_TIMERS_ENABLED, 1, 0, 0);//enable 1 timer, this is pin FIO4

            LJUD.AddRequest(u3.ljhandle, LJUD.IO.PUT_TIMER_MODE, 1, (int) LJUD.TIMERMODE.RISINGEDGES32, 0, 0);//tells the timer to time how long it is between

                                                                                                              //rising edges in the data.

 

            LJUD.GoOne (u3.ljhandle);//execute the commands <--This is the problem line.

            (There will be more that goes down here, I have just not done it yet.)

            return rpm;

        }//end of KEYPHASOR