Jump to content

LabVIEW google drive and sheets server


Recommended Posts

I was working on this app over the past year. Happy to make it available under a "Non-Profit Open Software License" 

Allows any labview application on you computer to utilise your google drive and google sheets. This is achieved through a labVIEW executable (GDLVserver), that gets access to Google drive/sheets with a client secret json file, with OAuth 2.0 authentication. Other labVIEW applications can communicate with the executable, and request google drive and sheets function requests. A LabVIEW client library is included to add to your project files. The GDLVserver will work in the background and can be hidden.

I used an executable to handle all the Google Drive API commands, to lessen the file dependency in projects, and also to aim to stabilise the drive connection which has a tendency to freeze on connection. This is still a problem, but is rare, and is unavoidable as it is on the google API side. Once connected the connection is maintained flawlessly. I've run apps for days with data writing data every second with no issues. There is a quota on function calls per user per API, 100 calls per 100 seconds. 

All code is written in LabVIEW 2015 SP1

API: Google.Apis.Drive.v3.dll, Google.Apis.Sheets.v4.dll

Background: Origin of code maggie-otoole

Modification Actions:

  • All VI's re-written
  • .NET testAuth.dll replaced with JNET.dll
  • New VI created for more API features
  • All library references updated to .net45
  • Google API widget, LabVIEW executable created 

Google Drive Functions:

  • Get folder names / ID's, in root folder
  • Get folder names / ID's, in specific folder 
  • Get file names / ID's, in specific folder 
  • Create new sheet

Google Sheet Functions:

  • Append 2D array data
  • Insert 2D array data
  • Read 1D array data

Folders content:

  • GDLVserver:  includes .exe, data folder with .lib references (you will need to place your JSON file here), and an icon folder
  • GDLVclient: includes a LabVIEw project, GDLVclient library, and example VI's

Requirements:

  • a LabVIEW 2015 SP1 32bit runtime engine is required to run the executable (here)
  • a google email account
  • Follow instructions in the "how do" pdf, (enable API's, create JSON, download & rename, run server (admin), try examples)

 

GDLVserver.zip

GDLVclient.zip

GDLV License.pdf

GDLV how do.pdf

  • Like 1
Link to comment

What you are sharing with the community is likely too locked down to be useful for others.  There is no source code to either the Server, which is just an EXE of which I won't be running outside of a sandbox.  And no source for the client which is a packed project library compiled to only run in LabVIEW 2015.  Having only 2017 means I can't use it all.  If you provide the full source I might be able to use this on a project in the future.

Link to comment

Hi @jmor, thanks for sharing your work. Are you planning to share the source code for the client and the server? If not, then a different license would be more suitable than the Non-Profit Open Software License 3.0 (Note: "Freeware" and "Open Software" are different things)

Link to comment

Good points all round, I actually never knew compact libraries couldn't be accessed by other labVIEW versions. I uploaded this work as a finished solution, which I think is very useful. I can't release the code for the Master or Client libraries, as I use a plethora of different COM libraries.

But!, I will upload the .net45 library I built for Google Drive and Sheets (which is probably the bits you want), these are LabVIEW VI's with .NET assemblies, which control the API calls.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

Edit: Library Attached (LabVIEW 2015 SP1), Enjoy!

 

GDLV.zip

Edited by jmor
  • Like 2
Link to comment
  • 1 year later...

UPDATE:  I found the issue.  Had to close newly opened references in "gs_getdata2d.vi"

 

First of all, thanks for the library.

I am having one issue though.  After about 10 or 15 iterations, the system errors out and the error handling (including closing references) is unable to reset itself.  I suspect somewhere, there is a reference that is not closing properly as when I stop the program and restart, everything works again.

Here is the code i'm using for preliminary testing.

image.png.864f441976bcca6a43799972aebd3b7f.png

Edited by Andrew Victor
FOUND THE ISSUE
  • Like 1
Link to comment
  • 1 year later...
  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.