Running a microscope camera through pvcam32.dll

VISA; TCP/IP, CAN and similar protocols
valib
interested
interested
Сообщения: 4
Зарегистрирован: 13 июн 2012, 03:25
Версия LabVIEW: 2010
Контактная информация:

Re: Running a microscope camera through pvcam32.dll

Сообщение valib »

mzu2006 писал(а):I believe it does! Please, find my next iteration below. I have added an enum for camera status (I think you can do a good service for all future users of this package if you wrap some other constants from pvcam.h in enums...). And couple more cosmetic changes: adding a stop button, adding a wait so that it does not load CPU 100%, checking for other camera statuses, adding pvcam_uninit in the end.

I think you can give it a try now.
Dear mzu2006, I have read all the previous posts and tried both my onw pvcam32 library and the one you attached in this post, they works with no error. But when I try the attached main vi (I mean the cascade_cam.vi), the problem is that only the first four bytes of our *pointer have data. All other bytes seems to be zero. I am using labview 2011 32bit. I have tried to change the dlls in your malloc and moveback vis to the labview 2009 run-time as well. It seems the data of the first four bytes are fixed as well.
Would you please help me figure out why? Or do I have alternative method to check the data grabbed by the CCD? Thanks.
Аватара пользователя
mzu2006

Professionalism Tutorials Black
doctor
doctor
Сообщения: 2456
Зарегистрирован: 16 авг 2008, 02:12
Награды: 3
Версия LabVIEW: 7.1 10 11 12
Откуда: St-Petersburg (RU), Phila, Boston, Washington DC
Контактная информация:

Re: Running a microscope camera through pvcam32.dll

Сообщение mzu2006 »

valib писал(а):I have read all the previous posts and tried both my onw pvcam32 library and the one you attached in this post, they works with no error. But when I try the attached main vi (I mean the cascade_cam.vi), the problem is that only the first four bytes of our *pointer have data.
Not sure what you refer to. Please, post all your code and a detailed description/screenshot of the problem.
wcarpenter
interested
interested
Сообщения: 7
Зарегистрирован: 29 май 2012, 22:48
Версия LabVIEW: 8.5
Контактная информация:

Re: Running a microscope camera through pvcam32.dll

Сообщение wcarpenter »

Hello mzu2006,
I have edited my pl_exp_setup_seq and I no longer have the -1 error code. With a friend's LabView 9.0, I was able to view your pl_exp_setup_seq that you included in PVCAM90.zip from 30 June 2011. I edited my pl_exp_setup_seq to mimic yours, but now I receive the 1097 error from the CLFN in my error output. I am sure there is something small that I'm not seeing, but I haven't made any progress in a while because of this error. Attached is my edited pl_exp_setup_seq. Thanks for all your help.

wcarpenter
Вложения
pl exp setup seq.vi
(22.06 КБ) 386 скачиваний
Аватара пользователя
mzu2006

Professionalism Tutorials Black
doctor
doctor
Сообщения: 2456
Зарегистрирован: 16 авг 2008, 02:12
Награды: 3
Версия LabVIEW: 7.1 10 11 12
Откуда: St-Petersburg (RU), Phila, Boston, Washington DC
Контактная информация:

Re: Running a microscope camera through pvcam32.dll

Сообщение mzu2006 »

That error usually indicates that either the parameter order or datatype(s) are wrong. Can you, please, post the whole code leading to that error.
valib
interested
interested
Сообщения: 4
Зарегистрирован: 13 июн 2012, 03:25
Версия LabVIEW: 2010
Контактная информация:

Re: Running a microscope camera through pvcam32.dll

Сообщение valib »

mzu2006 писал(а):
valib писал(а):I have read all the previous posts and tried both my onw pvcam32 library and the one you attached in this post, they works with no error. But when I try the attached main vi (I mean the cascade_cam.vi), the problem is that only the first four bytes of our *pointer have data.
Not sure what you refer to. Please, post all your code and a detailed description/screenshot of the problem.

Hey, mzu2006.
I have read a lot of posts recently and I run the program "cascade_cam.vi" in your post attachment "PVCAM take3.zip" again. This time I replaced your "malloc" and "free" vis by the Labview "DSNewPtr" and "DSDisposePtr" vis. I think it should not affect the results. My problem is that I can get the imaging data this time when I run the program in "highlight execution" mode (see the attached picture "Result_highlight"), but when I run the program nomally, the imaging data is wrong (see the attachment "Result_normal"). You can see the "status out" is 3 in "Highlight execution" mode, which meas the "READOUT_FAILED" but I can get the imaging data. And in normal execution mode, "status out" is 2, which meas the "READOUT_COMPLETE" but I get the wrong imaging data. What's wrong do you think? How should I modify the pogram to execute it nomally?
Another problem is that: as you know, you initally a 1D array with a length of "exp_bytes_out" in the "moveblock" vi for storing the imaging. It seems if I change that array data type to "unsigned int 16 bit" and reduced the array length to one half, I will not get the right imaging data, all the array elements are zero except the first four elements (of course I have changed all the related parameter setting). Sorry I did not do the screen shot for this case so I cannot attach a picture currently. I was wondering, can we only set the imaging data arrya in "unsigned int 8 bit" format?
Thank you very much for your help!
Вложения
Result of "highlight execution" mode
Result of "highlight execution" mode
Result of normal execution
Result of normal execution
wcarpenter
interested
interested
Сообщения: 7
Зарегистрирован: 29 май 2012, 22:48
Версия LabVIEW: 8.5
Контактная информация:

Re: Running a microscope camera through pvcam32.dll

Сообщение wcarpenter »

Sorry about that. Thanks for your help and patience.
Вложения
Pvcam32.zip
(1.23 МБ) 426 скачиваний
pvcam32.vi
(35 КБ) 392 скачивания
Аватара пользователя
mzu2006

Professionalism Tutorials Black
doctor
doctor
Сообщения: 2456
Зарегистрирован: 16 авг 2008, 02:12
Награды: 3
Версия LabVIEW: 7.1 10 11 12
Откуда: St-Petersburg (RU), Phila, Boston, Washington DC
Контактная информация:

Re: Running a microscope camera through pvcam32.dll

Сообщение mzu2006 »

wcarpenter, I looked at the code. I do not see anything obviously wrong. Are you sure that the error is generated by pl_exp_setup_seq and not by any of the previous functions. Unfortunately, I do not a PVCAM compatible camera at the moment. May be you can make and a short movie, how you trace the execution through your pvcam32.vi with execution highlighted. You can use CamStudio for this.
Аватара пользователя
mzu2006

Professionalism Tutorials Black
doctor
doctor
Сообщения: 2456
Зарегистрирован: 16 авг 2008, 02:12
Награды: 3
Версия LabVIEW: 7.1 10 11 12
Откуда: St-Petersburg (RU), Phila, Boston, Washington DC
Контактная информация:

Re: Running a microscope camera through pvcam32.dll

Сообщение mzu2006 »

valib писал(а): But when I try the attached main vi (I mean the cascade_cam.vi), the problem is that only the first four bytes of our *pointer have data. All other bytes seems to be zero. I am using labview 2011 32bit. I have tried to change the dlls in your malloc and moveback vis to the labview 2009 run-time as well. It seems the data of the first four bytes are fixed as well.
Would you please help me figure out why? Or do I have alternative method to check the data grabbed by the CCD? Thanks.
OK, I figured out the problem. In CLFNs form the malloc library we have the path to the dll specified as a direct path to the lvcrt.dll. This is not quite correct. The path should be specified as "labview" (Single lowercase word). This way LabVIEW will take it from whenever the current version/execution environment is. New, corrected malloclib is attached. (and also uploaded to original post containing malloclib).

Difference between step-by-step execution and regular execution usually indicates some kind of a race condition. Please, post the code for your VI where you have
valib писал(а):replaced your "malloc" and "free" vis by the Labview "DSNewPtr" and "DSDisposePtr" vis
.
valib писал(а):It seems if I change that array data type to "unsigned int 16 bit" and reduced the array length to one half, I will not get the right imaging data
Please, post the code.
Вложения
malloclib.zip
(39.42 КБ) 382 скачивания
song000
interested
interested
Сообщения: 1
Зарегистрирован: 01 фев 2013, 01:57
Версия LabVIEW: 2012
Контактная информация:

Re: Running a microscope camera through pvcam32.dll

Сообщение song000 »

Hi can you give me an example about how to use pvcam32 vi? I just begin to use it, and have no idea how to do it.

thanks a lot,
Bill
Аватара пользователя
mzu2006

Professionalism Tutorials Black
doctor
doctor
Сообщения: 2456
Зарегистрирован: 16 авг 2008, 02:12
Награды: 3
Версия LabVIEW: 7.1 10 11 12
Откуда: St-Petersburg (RU), Phila, Boston, Washington DC
Контактная информация:

Re: Running a microscope camera through pvcam32.dll

Сообщение mzu2006 »

sunil
interested
interested
Сообщения: 1
Зарегистрирован: 19 фев 2013, 20:40
Версия LabVIEW: 9
Контактная информация:

Re: Running a microscope camera through pvcam32.dll

Сообщение sunil »

HI,
Iam using PVCAM.DLL to interface my princton instruments camera.
i am able to control the temp and all parametres of the camera.
but when i am not able to run pl_exp_start_seq function. i am getting 0 as retrun function
Аватара пользователя
mzu2006

Professionalism Tutorials Black
doctor
doctor
Сообщения: 2456
Зарегистрирован: 16 авг 2008, 02:12
Награды: 3
Версия LabVIEW: 7.1 10 11 12
Откуда: St-Petersburg (RU), Phila, Boston, Washington DC
Контактная информация:

Re: Running a microscope camera through pvcam32.dll

Сообщение mzu2006 »

HAve you tried the code posted here: http://labviewportal.org/viewtopic.php?p=41952#p41952
raw476
interested
interested
Сообщения: 1
Зарегистрирован: 18 апр 2013, 15:10
Версия LabVIEW: 8.5.1
Контактная информация:

Re: Running a microscope camera through pvcam32.dll

Сообщение raw476 »

Dear mzu2006,

I have try the code above. Each vi of pvcam32 worked well, but the return array of all pixels was a zero array.
Is there any problem in malloclib? :help: :help:

PS: the attached file the the code I used

Thank you in advance!
Вложения
pvcam32_test_1.vi
(61.87 КБ) 346 скачиваний
Аватара пользователя
mzu2006

Professionalism Tutorials Black
doctor
doctor
Сообщения: 2456
Зарегистрирован: 16 авг 2008, 02:12
Награды: 3
Версия LabVIEW: 7.1 10 11 12
Откуда: St-Petersburg (RU), Phila, Boston, Washington DC
Контактная информация:

Re: Running a microscope camera through pvcam32.dll

Сообщение mzu2006 »

cesare90
interested
interested
Сообщения: 1
Зарегистрирован: 16 май 2014, 19:39
Версия LabVIEW: 2013
Контактная информация:

Re: Running a microscope camera through pvcam32.dll

Сообщение cesare90 »

I saw that topic and it was very useful. The fact is that I'm using win 64bit so I made those library with the pvcam64.DLL but it seems not working at all.. I just copied the blocks that you used in retake3

Do you have any suggestion? I just need images :)
Ответить
  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «Communcation with devices»