Error 1671 TypeError: Strided Arrays not Supported When Using Python Node In LabVIEW

Updated Sep 3, 2020

Reported In

Software

  • LabVIEW

Issue Details

I'm working with LabVIEW 2019 64bit and Python 64 bit, to develop my application.
When using a Python node to read an array from Python script, I get the following error:
Python returned the following error: <class 'TypeError'>
strided arrays not supported
 

Solution

LabVIEW added support to convert LabVIEW arrays to numpy arrays and back. LabVIEW uses the 'numpy.ctypeslib' from numpy to convert between C representation (for LabVIEW) and python representation of the numpy array. Strided arrays are not supported by the numpy library's ctypeslib.

Possible solutions for this issue are:
  • Convert the Numpy object to a string, and in LabVIEW convert it back to an array.
  • In Python, convert the strided arrays to a regular Numpy array in order to read it correctly in LabVIEW