02-27-2018 01:36 PM - edited 02-27-2018 01:36 PM
Hello - I have a NI PCIe 1427 frame grabber with IMAQdx installed. NI MAX sees the frame grabber and I can snap or grab images fine from the camera I'm using, a Xenics Bobcat 320. I need to use python 3.5 to grab images from the frame grabber and I found a python wrapper, pynivision: https://github.com/robotpy/pynivision
When I try to opening the camera using: IMAQdxOpenCamera I keep getting a error: ctypes.ArgumentError: argument 1: <class 'TypeError'>: wrong type
I'm not a newbi to Labview and Machine Vision but am a newbie to python. Has anyone successfully used pynivision?
This is the simple example I'm running:
import core as nivision
import sys
name = "img0"
id = nivision.IMAQdxOpenCamera(name, nivision.IMAQdxCameraControlModeController)
pic = nivision.IMAQdxGrab(id)
closeCam = nivision.IMAQdxCloseCamera(name)
import core is part of the pyniwrapper that defines all the IMAQ functions.
Thank you for any help.
Solved! Go to Solution.
02-28-2018 02:14 PM
The 1427 uses IMAQ, not IMAQdx, and thus will not work with that Python wrapper.
02-28-2018 03:47 PM
Thanks BlueCheese, big oversite on my part. Now back to the drawing board. I'm guessing just removing the 'dx' in the api won't work with IMAQ.
06-09-2020 05:30 AM
Did you finally solved this issue?
I am trying to connect also a NI frame gabber(1433) with Python but i guess it is also IMAQ
03-10-2021 12:29 PM
You need to convert your string into a ctype. You can see by typing
print(nivision.IMAQdxOpenCamera.argtypes)
that the first argument needs to be a ctype.
Try:
name = ctypes.c_char_p(name.encode('utf-8'))