LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

when using Drop-box, how do I check from labview if the Drop-box is up do date , as indicated by the little green mark on the Drop-box icon?

Hi,

I am using  Labview to update files on the local drives of several computers which are linked by dropbox.  When several users try to update these files at the same time it leads to creation of conlicted copies .  It would be great if I could check from whithin labview if dropbox is synced, and not trying to update files whilethe vi tries o write new ones. Any ideas?

Thanks!

0 Kudos
Message 1 of 6
(4,796 Views)

I'll have to leave a bit of the work to you since I am not really going to upload my WindowsAPI library at this moment, but here is how I monitor my DropBox status from LV:

 

DropboxStatus.png

 

The basic idea is that I tap into the named pipe which is used by DropBox in order to send a status request.

 

The three subVIs on the left are simple calls into 3 windows functions in Kernel32.dll: GetCurrentThreadId(),GetCurrentProcessId(), and ProcessIdToSessionId().  The Session Id is used to open a connection to the named pipe 'DropboxPipe_SessionID'.  The request is packaged with some number I found in the API, the process id, the thread id, and the request type which is 1.  The path is converted to UTF-16LE by blowing it up into U16 and byte swapping.  If you have funky characters in your file path then substittute a WindowsAPI function to do some real conversions (I find them to be a bit slow and obtuse so I usually skip them).  The request is padded to 540 bytes and written to the named pipe.  The reply from the pipe contains a status code in a C-string at index=4:

Code 0 = Not in Dropbox, Code 1 = Up to Date, and Code 2 = Syncing

 

Grab the OpenG pipes library and you should have all of the VIs you need to handle Named Pipes.  Just remember you are connecting to an existing pipe and not creating a new one.

 

Or you could move to Linux and use the very nice command line tool...

 

 

Message 2 of 6
(4,764 Views)

Amazing.  Every time I think I've seen all there is to see from Darin, he pulls another rabbit out of his hat.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 3 of 6
(4,748 Views)

Thanks!

I learned a lot from this,  but unfortunately i don't have the time to delve deeper into the homework you asigned to me 🙂

 

0 Kudos
Message 4 of 6
(4,681 Views)

Then I have to wonder what makes you think that someone else, volunteering on these forums, will do your work for you? Darin has given you an exceedingly useful piece of advanced LabVIEW knowledge to allow you to do what you need. You asked for ideas and he's given you almost a complete solution!

 

/rant


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 5 of 6
(4,663 Views)

absolutely nothing at all, I was just saying thanks and confessing my ignorance and lack of time.

Message 6 of 6
(4,493 Views)