I'm having trouble to read detector pixels using a ZPL.
The syntax should be NSCDetectorData,surface,object,pixel,data
However, I get error message and do not know how to solve.
Can somebody provide me with a example of a piece of ZPL code to get the job done.
Ideally reading the detector into a 2D array
But I'm already happy with a single statement reading out say the 6th pixel iof the 5th row
Hope somebody can help me
Best answer by David.NguyenView original
This was more complicated than I thought, but this should help you.
The macro I used is the following:
Hopefully, it is self explanatory except for the pixel numbering part. The pixel numbering is what got me confused at first, but here is what I obtained (you can also download my file, which has the macro in it, and check for yourself):
As you can see, pixel 1 is the bottom left corner, and pixel 2 is the next one to the right, etc.
Let me know if that makes sense. I let you do the math for the 6th pixel of the 5th row, which is different depending on the origin. Note that the indexing starts at 1. You probably need something like 5 times the row length + 6 or similar.
At this point, I would strongly suggest to look into the ZOS-API, particularly if you are doing any sort of post-processing with Python or MATLAB, or even C++/C#.
I hope this helps.
Great! This helps and is super! I understand it and tested it. A good step forwards for me.
You mention Python, MATLAB or C++/C#. I'm unfortunately not familiar with these languages and the learning curve is too long for me.
I am though familiar with VB excel and I think I have understood that it sould be possible to read, write and give a command to trace to Optics Studio but I have no clue how to do that. I have not seen any examples. If these exist I would be interested!
At the moment I will work with the more primitive ZPL. Also there I need some learning to do.
Thank you again for your great help!
I'm glad I could help. Feel free to mark my reply as the answer to your question (there should be a button on the top-right) as it can also help others.
I completely understand the issue with the learning curve. It does require some effort to get started. To be fair, you can do most of the things with ZPL, it's just sometimes less convenient.
I have heard of people using the ZOS-API with VB, but never seen it myself. I have found this other post though, maybe that can help.
Let us know in the forum if you have other quesitons about ZPL, and the community will try to help :)
Thank you David