LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Make auto connection to machine through USB

Solved!
Go to solution

Hi, 

 

I am working on a midi Logger GL240, below is the zip file that provided by manufacturer, however, I am trying to edit its setting so that the connectivity to the hardware will be automated once the program is started. May I know how can I do so? I realized that they created their own Type Definition Control and I supposed changes should be made from there? The USB ID is 0 by default from the hardware. 

 

The DLL file is in 32-bit, hence it is a must to have 32-bit LabView running to able to run the VIs. 

Hope to get help and reply ASAP. 

 

Thank you. 

Best regards, 

Wing

0 Kudos
Message 1 of 7
(1,323 Views)
Solution
Accepted by topic author wing98

I am not sure I am understanding what your problem is. My understanding is you are trying to modify the Utility_Main.vi so that you basically run the the connect event when the code first starts up

 

 

If this is correct you should move the code that connects to the USB instrument outside of the event structure so it is performed straight away. See below.

 

USB.png

 

0 Kudos
Message 2 of 7
(1,289 Views)

Dear Niatross, 

 

Thanks for your reply. I tried the way you suggested, it can be connect but it is possible if I don't want to have the popup message and wanting me to click the button connect? I would like to have it connect directly once I run the program. 

 

Hope to hear from you soon. 
Thank you. 

 

Best regards, 

Wing

0 Kudos
Message 3 of 7
(1,282 Views)

Ah. I didn’t look that closely at how those vi’s work. 

by the looks of it they have put untility_main together as an example of how to use the ire code (the green not white vi’s) 

 

If you want to significantly move away from their example I would rewrite it using the green vi’s shown in the vi tree. 

a good idea anyway because in my opinion what they have done isn’t the best example of how to do things. No error handling of any sort for example. 

if you want a quick solution recreate that connect vi so it performs the action in the connect case automatically. 

0 Kudos
Message 4 of 7
(1,266 Views)

Hi Niatross, 

 

Thanks for your answers, I am able to make it auto connect by changing the subVI to Open USB Driver and assign the USB ID in advance as shown in the figure 1 (Left side). 

I am now looking on how to write data received to the network variable. I am able to send data to the variable under "CommandLine": Value Change -> SubVI CommandLine -> Added the WRITE network variable to the data output of R/W Driver as shown in the figure 2. 

I followed the SubVI CommandLine to the R/W Driver for data input and output as shown in Figure 1 in Main, but sadly that I am not getting the results from Main VI. May I know how to solve this problem?? 

 

Thank you. 

 

Best regards, 
Wing

 

wing98_0-1609343672654.png

wing98_1-1609343923938.png

 

 

0 Kudos
Message 5 of 7
(1,231 Views)

This may not be related but,  have you changed the OS power management settings to keep the USB port from being powered off?

 

I know, it seems silly, but a USB port without 5v makes about as much sense as a submarine with a screendoor.  Sometimes you have to ask the question 🤬


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 7
(1,217 Views)

Can you attach your code so far rather than pictures

0 Kudos
Message 7 of 7
(1,196 Views)