LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does Lab View code work through USB and sometimes it does not?

I have a code for display power of 1936-C optical power meter, connected through USB. I used Newport's instruments drivers, Code works fine some times and displays power when I run it, and some times it does not show any power when I run the code. This happens with any working LabView code that I have to communicate through USB with the instrument.

I created a simple code for SMC100 motorized stage to display and move the actuator, Code does not have any error, yet sometimes it works and some times it does not. Could anybody let me know what is wrong?

 

0 Kudos
Message 1 of 12
(4,621 Views)

It will be hard to tell you with only that description to go by, "Sometimes it works sometimes it does not".

 

Can you post any code or give more details.

 

Rgs,

 

Lucither.

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 2 of 12
(4,605 Views)

Hello,

Please see the attachment, this code when 1936-c is connected to PC through USB does not have any error.

If I run the vi, it does not have any error either yet, it does not read power (does not display power).

In Block diagram if I activate the Highlight Execution, I can see the correct instrument address travels to the while loop, passes through Send Cmnd, and then "error -1. or error -2" comes out, this is the only way I can find there is an error. I opened each individual sub vi, I can not find any errors.

All these sub vi are part of the instrument driver of 1936-C that I got them from Newport Corp's website. I mean I di not wrote them.

If I turn power meter on and off, and run the code it start reading power, when I stop the vi, and run it again, it does not read power.

1936-C.jpg

0 Kudos
Message 3 of 12
(4,579 Views)

You did not include the most important part - the subVIs from newport. If their code does not work, then you should be in contact with them. There are numerous possible implementations of USB communication that they could have used and they are probably the only ones who can analyze the problem and fix it

0 Kudos
Message 4 of 12
(4,572 Views)

Hi Dennis,

I sent my questions to Newport, I had no response yet, I think the usbDLL.dll is broken, I do not know what it is, I think all subvi are affected by that, Would you think I can get uncorropted usbDLL.dll file some where? is it some thing universal? or it depend to each instrument?

Please see the attachment for subvi

Could you please let me know if there is any solution?

Thanks

Golshan

0 Kudos
Message 5 of 12
(4,567 Views)

It's their dll. You will just have to wait for Newport.

0 Kudos
Message 6 of 12
(4,564 Views)

As Dennis said it is their dll. USB may stand for "Universal Serial Bus", but the only thing universal about it is the description of the interface, each bit of hardware has its own implementation of what the messages sent are and do. Many companies do use the same .dll drivers, from the company that manufactured the particular USB interface chipset, particularly those that are using it like an old "serial" port, but even then they sometimes encapsulate the calls to that lower level .dll in a .dll of their own, some of which I have found don't play nicely with LabVIEW. I haven't any experience with your specific instrument.

 

Another thought is that you are loosing the usb connection from your computer, as you mention a problem with an XY stage? Is that also part of the power meter code or seperate? I had problems about a year ago where occasionally the USB on the test computer would "glitch", causing, in my case, the USB to Serial adapter I was using to be "reinstalled" by Windows, resulting it this case in a new com port #. My program had no way of knowing that this had happened, or what the new port mapping was. The final resolution, with NI's support telling me that they had seen problems with certain motherboard's USB, was to plug a USB adapter board into the computer's motherboard for my instruments and comm ports. Since your problem seems to be corrected by power cycling the instrument I'm wondering if Windows is intermittently loosing communications with it. Here is a fairly lengthy discussion about what I went through to find the problem.

 

Good Luck, let us know of your progress so we can help, or learn.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 7 of 12
(4,546 Views)

Hello LV_Pro and Dennis,

I am still waiting for Newport's response on dll file!!

Thank you for your input I will post my experiences soon.

0 Kudos
Message 8 of 12
(4,527 Views)

Hallo all who read this thread,

I have also a similar problem that Salam has faced.

I am trying to program newport optical power meter 1936-c in Labview but could not communicate with the instrument over USB connection.

I have installed the drivers necessary for the operation of the optical power meter from newport website:

ftp://download.newport.com/Photonics/Power%20Meter​s/x936-C_x1928-C_1918-C_R_%20Software_Suite/

I am running windows XP service pack3, 32 bit version.I believe I have installed the correct version of the driver for communication with the device over USB connection.The application software provided by the newport runs correctly, and I am sending and receiving the commands,but when I try to connect to the power meter using Labview sample programs provided by newport, I am not able to send or receive anything,instead the program seems to run an infinite loop and i get no reply until I have to restart the program.I am using Labview service pack 9 and I have tried all the sample programs 7.x ,8.x and 2009 version,but unfortunately no progress(:

 

I am interested to get power from the meter using power command PM:power?(no smiley) .But it doesnot give anything.Instead it gives an error response"could not connect any USB device".Is it the problem of compatability or some driver issue?as i got some warning messages in the begining(see attached file).The warning seems to occur due to USBWrap.DLL,may be I am using some old version of USBWrap.dll?.I could not understand what the problem is exactly(:

 

I have attached some screenshots of the program I am currently using and the Labview program provided by newport.

 

@Salam, did your problem solved?Can you please share the program you used to get power.I tried to open your file (NP_DataStoreSample_LV8.llb) but it seems to be version 2010,so i could not open with my version 2009.Do you have some program for Labview 2009 version.Thanks!

 

I would highly appreciate if someone could help me.

 

kind regards,

shami

Download All
0 Kudos
Message 9 of 12
(4,312 Views)

Hello IC_designer,

I had to give up and buy Thorlabs' optical power meter, I will post NP_DataStoreSample_LV8.llb in LV 2009 soon.

Thanks

 

 

0 Kudos
Message 10 of 12
(4,291 Views)