Closed neixlo closed 1 year ago
@neixlo Hi, please excuse me for having kept you waiting for the last few months.
It is not clear to me if harvester or the camera itself updates the Height if the LineCount is set.
The behavior between GenICam feature nodes are completely closed by its XML file and there's no chance where Harvester slip in to hack it. I would recommend contacting KEYENCE representative so that you can make sure the behavior you've observed. If there's an action so that I can help you, please feel free to come back here. Thanks, Kazunari.
@kazunarikudo, I appreciate that you came back to my issue and thank you for the response! I think the unexpected behavior (from my point of view) is actually intended by the KEYENCE camera.
Going to close this as resolved, and thanks again for coming back to it. :)
Hey @neixlo I just got the same camera as you and I'm struggling a bit with using Harvester to automate the image capture process. I was wondering if maybe you could answer a few questions I have? How do you find the list of callable attributes from ia.remote_device.node_map ? (like the OperationMode, LineCount, Height) Are you able to get the shape image with Lumitrax lighting if that is your setup? I can't seem to find what line of code refers to the different image types.
Thanks a lot!
I have :
Hi @jpl-c ,
to your questions:
Hope this helps :)
Hi @neixlo, Thanks for your reply! I was able to get all the functions and attributes, but there are a whole lot! The GUI definitely helps understand things, thanks for the suggestion. Ok I see, and do you know a way of loading the UserSet (.xml file) in the python script just to make sure? Also, are you able to collect all of the images at once (normal, shape, custom filtered) or is it only one by one? It would make sense to me that you can get all of them together, but for the moment I'm only able to display the normal image
Hi @jpl-c ,
I've never loaded the UserSet via python/harvesters but I think this is possible. I always set the UserSet in the VJ Editor, so that it's loaded automatically at startup.
I just use one of the images and my controler is configured to just send one. Still I think you should get all images (if the controller is sending it). You might need to have a look at the recieved image object and the shape, I recommend vscode and the debugger. Within harvester-gui, i'm not sure if you can display all images. May just the first image in the recieved object is shown there.
Hope this helps. :)
Okay thanks! I'll keep on trying and will keep you posted with what I can achieve. My guess is this might interest other people later on too :)
Here's an updated on my struggle to get multiple images from the camera : It turns out I needed to do several ia.fetch calls for a single capture. To prevent the camera from taking another picture during the fetch() call , I had to change the MultiCaptureUpdateImage node value to False and change the MultiCaptureImageType node value to the image type (a str) I wanted to retrieve from the camera. You can find more info on this in the Keyence VJ Series System Integration Manual :
Regarding the User Set, it is actually not possible to save it and load it from a standalone software. The only way to load parameters is through the Feature List that is saved as an xml file. You have to read through the whole file and update each feature one by one in the same order as in the xml file (making sure you have W or RW access to the feature). Here is the code I used for that :
`def load_xml(self, filepath): tree = ET.parse(filepath) root = tree.getroot()
if self._ia is None :
raise Exception("Image acquirer needs to be initialised first. Please run init_ia() method first")
self._ia.remote_device.node_map.OperationMode.value = "SetupMode"
for i in range(len(root)):
feature = root[i]
name = feature.attrib["Name"]
access = feature[1].text
node_type = feature[0].text
if node_type != "Command" and access != "R":
value = feature[2].text
if value == "TRUE":
value = True
elif value == "FALSE":
value = False
setattr(getattr(self._ia.remote_device.node_map, name), "value", value) #Change the node value
print(f"{filepath} successfully loaded to camera")
self._ia.remote_device.node_map.OperationMode.value = "RunMode"
return`
I hope this might give ideas to people who were struggling like me :)
Cheers,
Jpl
Dear @kazunarikudo,
thanks for harvesters and your effort on this awesome opensource project!
I haven an issue which is unclear to me and which I try to understand better. It might not be an issue of harvester at all. Maybe this is expected or done by the camera itself.
Maybe you can help out and answer my question below. :)
Describe the Issue
Short: When setting a value (
LineCount
) in a remote device, another value (Height
) is also updated with the same value. When settingHeight
value to a bigger value thenLineCount
there is an error.Long: When setting the value
LineCount
in a Keyence Line Scanning Camera (VJ Series), the valueHeight
is also updated with the same value. On one hand this makes sense because the height (Height
) of the image to be send from the remote device to the PC can't exceed the collected image size (LineCount
) from the remote device. On the other hand it is unexpected (for me) that values which are not set explicitly are updated in the background. The result for me is, that if I set theHeight
before I set theLineCount
, an error is thrown.To Reproduce Steps to reproduce the behavior:
Sample Code
Traceback:
Expected Behavior It is not clear to me if harvester or the camera itself updates the
Height
if theLineCount
is set.Question: Is harvester setting just the
LineCount
value or is harvester also settingHeight
under the hood.Configuration
Reproducibility
It is fully reproducible but one need a line scan camera (maybe the specific one from keyence).
Actions You Have Taken
Additional context This is much more a question than a issue of harvester I assume. I try to better understand what is happening.