キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

Power meter

解決済み
解決策を見る

Hello,

 

I am using the PM100D instrument, and I wrote the code. The code worked fine the first time, but the problem comes when I try to run it again; the PM100D initialize.VI gives an error.

The error is "Specified type of lock cannot be obtained, or specified operation cannot be performed, because the resource is locked." I have to shut down the labview and open it again to run a second measurement.

The question is, how can I run the code several times without having this error?

0 件の賞賛
メッセージ1/12
6,179件の閲覧回数

This sounds like you did not close / release the resource.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
メッセージ2/12
6,175件の閲覧回数

When you call initialize, you must also call close at the end. This is like, when you pick up the phone to make a call, you need to end the call, you can't just leave it hanging there.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution
0 件の賞賛
メッセージ3/12
6,171件の閲覧回数

I already did that and you can see the code in the attachmentimage.pngimage.png

0 件の賞賛
メッセージ4/12
6,139件の閲覧回数

You should perform the Initialize before the loop and Close after the loop.  Many instruments do not like rapid opening and closing of resources.  If I am reading the code correctly (hard to tell from the icons), then you should be able to move the measurement configuration to before the loop as well.  This would just leave the reading the measurement inside the loop.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
メッセージ5/12
6,115件の閲覧回数

Hi,

 

Thanks for your reply

 

I already did that and still give the error.

MosFo2sh_0-1705073537713.png

 

0 件の賞賛
メッセージ6/12
6,064件の閲覧回数

Once you have this problem you will need to shut down LabVIEW completely to release the resource.  Have you tried that yet?

 

I use PM100Ds all the time and there are some drivers needed to get it working due to the IVI handles used as the reference.

 

I think I installed the main utilities on this page:  Thorlabs - Your Source for Fiber Optics, Laser Diodes, Optical Instrumentation and Polarization Meas...

 

AND, also had to go to the older page to get the PM100D.dll installed:  Thorlabs - Your Source for Fiber Optics, Laser Diodes, Optical Instrumentation and Polarization Meas...

 

EDIT: Don't forget to close any Thorlabs apps before you try to open the device in LabVIEW and vice-versa.  I'm pretty sure they lock each other out.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
メッセージ7/12
6,059件の閲覧回数

Hi,

 

Thanks for your reply.

 

Yes, I tried this, and it is working when I shut down the labview and open it again.

But I thought it had a solution other than this.

I am using the PM100D from the same links you mentioned.

 

Anyways, thanks guys I appreciate your time and help.

0 件の賞賛
メッセージ8/12
6,054件の閲覧回数
解決策
トピック作成者MosFo2shが受理

You shouldn't have to close LabVIEW to keep it working unless the references are screwed up.  This can happen if you neglect to close them, OR if you open too many of them at once.

 

I would try closing everything and rebooting your PC.  After that your code with the INITIALIZE before the loop and CLOSE after the loop should work correctly.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
メッセージ9/12
6,048件の閲覧回数

Try running with execution highlighting on.  This will slow everything down.  If that makes it better put a few stall data flow in and set the delays up starting at 100 ms and going down until it screws up again.

 

Programming -> Timing -> stall dataflow.vim

メッセージ10/12
6,027件の閲覧回数