The appeal of LabVIEW VI of Python

Hi Ppl,

I'm calling python LabVIEW VI using LabVIEW ActiveX or the LabVIEW run engine of ActiveX that can be enabled in the advanced options of the application builder.

The problem that I am facing is: I use the VirtualInstrument.Call () method to run VI and pass parameters to and from the VI's. When you use this method, I am able to pass arguments to simple controls easily tables e.g., Boolean numerics

However when I tried to transfer data to a cluster as in the attachment data 1. jpg in this form I get errors:

Python code:

...

...

#Parameters

Channel_1 = [1,2,3]

Channel_2 = [1,2,3]

Data = [Channel_1, Channel_2]

Read = 'TRUE '.

ParameterNames = ("Data", "Read")

Parameters = [data, read]

VIPath = "Screw LabVIEW C:\Users\Sathish\Desktop\Calling of Python using LVRTE\Complex Data.vi"

Reference #Get VI

Application._FlagAsMethod ("GetVIReference")

VirtualInstrument = Application.GetVIReference (VIPath)

Front #Open VI in hidden mode

VirtualInstrument._FlagAsMethod ("OpenFrontPanel")

VirtualInstrument.OpenFrontPanel(True,3)

#Call VI

Print ("VI\n LabVIEW call")

VirtualInstrument._FlagAsMethod ("Call")

VirtualInstrument.Call (ParameterNames, Parameters)

...

...

...

Error Msg:

VirtualInstrument.Call (ParameterNames, Parameters)

File ""> ", line 2, the call"

com_error: (-2147352567, "Exception occurred.", (0, zero, zero, zero, 0,-2147352571), 2)

However, the same code works for the second data attachment 2.jpg

What I gather is that Python is not able to distinguish a data type of table 2D in a cluster having subclusters with the same number of elements, as in our example, a high-level group with two subclusters with 3 numeric characters. Is there a way to solve this problem. How explicitly I tell python that's a cluster and not a table?

Thank you

Sirot

Data 1

Data 2

I modified your original Python script to work with comtypes. Here it is:

#######

types import *.
import comtypes.client

ComTypes. CoInitialize()

# Path to the type library.
TypeLibPath = "C:/Program Files / National Instruments/LabVIEW 8.6/resource/labview.tlb.

# Attention: For the first reason of type import library through
# GetModule() fails if comtypes.client.gen_dir is set to a directory.
# Workaround: Set it to zero so all imported data is kept in memory.
ComTypes.client.gen_dir = None
comtypes.client.GetModule (TypeLibPath)

Try:
Request = comtypes.client.CreateObject ("LabVIEW.Application.8", zero, zero, comtypes.gen.LabVIEW._Application)

#Parameters
Channel_1 = [1,2,3]
Channel_2 = [4,5,6]
Data = [Channel_1, Channel_2]
Read = 'TRUE '.
ParameterNames = ("Data", "Read")
Parameters = [data, read]
VIPath="C:\zjmwi\ComplexData86.vi".

Reference #Get VI
VirtualInstrument = Application.GetVIReference (VIPath)

Front #Open VI in hidden mode
(VirtualInstrument.OpenFrontPanel (True, 1)#3)

#Call VI
Print ("VI\n LabVIEW call")

VirtualInstrument.Call (ParameterNames, Parameters)

except:
VirtualInstrument = None
Request = None

# Sunrise again the exception to get the trace full on the console
lift

VirtualInstrument = None
Request = None

Tags: NI Software

Similar Questions

  • I am using IVI step switch in TestStand 4.1.1 and also try to call the Actions of LabVIEW using IVI

    I use IVI pass the stages and steps of IVI DMM TestStand 4.1.1 and then I have an Action step that IVI spend IVI DMM and features.  The problem I have is that if I run the VI in LabVIEW bear only functions without any error, if I run of TestStand without all previous calls to switch IVI or IVI DMM it works also, but if I run the sequence with a step of IVI teststand pass first I get the following error:

    Initialize IviSwtch with Options.vi
    The primary error: unknown status code (Hex 0xBFFA4001)

    «"" "String of full appeal:»»"»
    Initialize IviSwtch with Options.vi

    -1074118655; User-defined error code.

    I remember there used to be a problem with the steps of the IVI and IVI running LabVIEW, does anyone know if this problem has been corrected?

    Other ideas would be appreciated.

    Hello Kevin,

    It is a question of trying to open more than one session to a particular device of IVI.

    Here is a knowledge base on the issue. I found this knowledge base by searching '1074118655' or 'TestStand IVI Action no' to ni.com.

    Please let me know if you have any other questions.

  • stop the script with labview

    Let's say that I run a script using the "DIAdem"run script.vi"due to the demand of the user.  Later, the user wants to cancel because it took longer than expected.

    How to stop the script using labview tools?

    Jim

    Hi Jim,.

    It is possible, but not in the way I think you hope.  I don't know any way to end a VBScript script running in the DIAdem of the 'outside '.  If you have been watching DIAdem you could hit the key, but a subsequent application of LabVIEW goes in "Script stack" of DIAdem and does not run until the first VBScript happens naturally.

    Of course, you need to run all your calls of LabVIEW to Sophie in an asynchronous way, or does not.

    If you can do is set up each VBScript that you think you might want to abandon to periodically query a global variable of tiara, say "B9" and end of inside the VBScript if B9 = TRUE.  LabVIEW DIAdem (ToCommand) command interface will stack Script tiara, but variable interface of LabVIEW DIAdem (ToDataSheet) does not work.  If you can "poke" during execution of the first VBScript variable B9 of LabVIEW and influence its behavior, but only if and when this VBScript uses this variable (B9) get bitten.

    Of course, none of this helps if your VBScript is busy waiting for a simple VBScript command to run, and it helps only if your VBScript executes several activities, among which it can interrogate the variable (B9).

    Hope that helps,

    Brad Turpin

    Tiara Product Support Engineer

  • How to set the parameters of the AKD with LABVIEW driver?

    Hello

    I am looking for a simple example to set or read the AKD with Labview driver settings.

    The AKD has ethernet communication and control is analog - AKD-P00306-NBAN-0000

    I want to use Labview to read the paramerters even as Kollmorgen WorkBench

    Thanks for your help

    Thank your for your help

    I found a solution with the TELNET Protocol

  • The trio of Labview, card PT and Basler A - 610 camera F gray

    Hi all

    I'm doing a project on the merger of the camera with a PH d teacher. As I am the research assistant I can make all preliminary ups. in any case its very annoying that I'm stuck on the first step. Which is simply the video detection from one camera on LabVIEW. The equipment I use is an A-610f "basler" firewire camera, a gray PT 1394b PCI Express Card (http://www.ptgrey.com/products/firepro/index.asp).

    The basler connects with gray map of PT via a firewire cable. Now that the card is not an OR product it is not shown in the MAX I just need to get the video of LabVIEW, but I don't know where I have to access the camera from.

    I'm using LabVIEW 8.2.1 and I Vision Assistant and Toolkit Vision and Motion installed on my machine. In addition I just download demo version of the Vision Development module as well. Again for the clarification that I just need to acquire video from my camera.

    Finally ive it resolved myself!... .. The main problem was with the son of the late himself! .. I was amazed when gray pt was charging me $75 for a firewire cable because it was available in my country of origin for Rs 250 to the free market. I bought one and then started five days of immense struggle and re struggle. Finally, I thought that ive tried all means why not give it a last try and buy the original cable. I borrowed it from a firm surface and 'khatttaaaaaaak'... it works! Although I had to install the SDK of basler to view the video stream. Once the entrance to the camera was visible on the SDK. It was smooth then leave. IMAQ Max was able to detect the camera. The right software was all that remained to be installed. Once the right software has been installed using MAX. It was all great. The power of the camera was visible on max as well. I opened the Vision Assistant and he began to take the camera feed as well.

    I decided to transfer to another device in the PCI card and hooked to another quality firewire cable. The repeatition of above process ensures that the camera is fed was visible on SDK, MAX and Vision Assistant. Although permitted high-speed bandwidth continues to be a problem. Another problem which forced me to bite the nail outlet there is over and done.

    Moral of the story: use the original substance

  • Open the file using Labview 8.5 traditional NI VI

    Hello

    I want to open this VI I have attached below using the version of labview 8.5

    But when run the VI, the error message pop out as below:

    I suspect this VI to traditional aid OR component.

    How can I run this VI using my latest version of Labview?

    Thanks in advance

    Yes, you're right. This is the traditional DAQ VI.

    Install traditional DAQ 7.4.4 (WXP or W2000) and check that you activate LabVIEW support when configuring the installation program.

    PS: The LabVIEW 8.5 and traditional DAQ are not supported under W7. See here (OS<-->LV) and here (DAQ<-->LV).

  • The call of the TestStand of LabView modules

    Hello

    I have some dllmodules developed to be launched from TestStand and so the methods require a context of sequence as in param.

    But now I would call these modules on a computer without TestStand. I thought the call of LabView but is it possible? I do not have access to change the modules.

    You can use the TestStand Deployment Utility, located in the TestStand menu under Tools-> deploy the TestStand system

    In the TSDU, you can create an installer to deploy a workspace TestStand and tab of Setup options, you can even choose to include the TestStand engine in the installation program.

  • Retrieve the names of the measures of the stage using LabVIEW

    How retrieve you the names of the measures a digital multiple of the step using LabVIEW?

    I have built a vi to be called TestStand and will pass the "ThisContext', but the vi is not complie.  That's how far I got.  The vi is attached.  The error message is:

    "The method selected in the invoke node is invalid or no method has been chosen.  Click on the invoke node and select a method. »

    My vi is an attempt to write the code of

    Normal
    0

    fake
    fake
    fake

    MicrosoftInternetExplorer4

    / * Style definitions * /.
    table. MsoNormalTable
    {mso-style-name: "Table Normal";}
    MSO-knew-rowband-size: 0;
    MSO-knew-colband-size: 0;
    MSO-style - noshow:yes;
    "mso-style-parent:" ";" "
    MSO-padding-alt: 0 to 5.4pt 0 to 5.4pt;
    MSO-para-margin: 0;
    MSO-para-margin-bottom: .0001pt;
    MSO-pagination: widow-orphan;
    do-size: 10.0pt;
    do-family: "Times New Roman";
    MSO-ansi-language: #0400;
    mso-fareast-language: #0400;
    mso-bidi-language: #0400 ;}

    message.ID = 10653 in LabVIEW.  More precisely:

    Normal
    0

    fake
    fake
    fake

    MicrosoftInternetExplorer4

    / * Style definitions * /.
    table. MsoNormalTable
    {mso-style-name: "Table Normal";}
    MSO-knew-rowband-size: 0;
    MSO-knew-colband-size: 0;
    MSO-style - noshow:yes;
    "mso-style-parent:" ";" "
    MSO-padding-alt: 0 to 5.4pt 0 to 5.4pt;
    MSO-para-margin: 0;
    MSO-para-margin-bottom: .0001pt;
    MSO-pagination: widow-orphan;
    do-size: 10.0pt;
    do-family: "Times New Roman";
    MSO-ansi-language: #0400;
    mso-fareast-language: #0400;
    mso-bidi-language: #0400 ;}

    Dim MyStep ACE [step]
    Dim MyMeasurement As PropertyObject

    MyStep =
    seqContext.AsPropertyObject.GetPropertyObject ("Step", 0)
    MyMeasurement =
    MyStep.AsPropertyObject.GetPropertyObject ("Result.Measurement [0]", 0 ")

    MsgBox (MyMeasurement.Name)

    Can someone help me complete the vi?

    Thank you

    Thank you very much.

    A small change to the vi required.

  • How to save stationglobals the disk in Labview

    Hi, can anyone suggest me how to save the values of stationglobal the disk when my vi is running? I update the stationglobal property set API TS call in my vi. But when I left the TestStand and open again the old values of stationglobal are still there and not news. What should I do to update the values of stationglobal? If anyone has any sample vi please provide me.

    Thanks in advance,

    Nadie

    Try this. You don't mention the version of LabVIEW, you use so I recorded to 8.0.

  • How to change the time timestamp labview at the UTC time

    Hello

    I have table of database in UTC time field.i select and insert data in the database table based on labview timestamp controll.

    example:

    Table:

    S:no U.name PWD Epoch (UTC 1970)

    1 1450422341 123 kumar

    mock 2 786 1450421623

    the era of labview is difference from UTC time. so ADD this second 2082844800 at the time of labview that it will work for selection quary but time insert is not a job.

    Here's how to convert a timestamp of LabVIEW to a timestamp of Excel (OLE).

    Red the explainiation down and I'm sure you can figure out how to change it to get the party time you need.

  • When I change the setting by LabVIEW on my device, I see change on the monitor of the device?

    When I change the setting by LabVIEW on my device, I see change on the monitor of the device?

    This question should be addressed to the manufacturer of the device. From your previous posts, I guess you use GPIB or serial. If the unit has received the order, the manufacturer should be able to tell if no indicators on the device to update when the order is received. Based on my experience, however, the device indicators will most likely update on receipt of an order successfully.

  • Is the tool provided with the works of Labview 2009 with LabVIEW2010

    Hello

    I use currently LABVIEW 2010 want to know about toolkit provided with the dvd of LabVIEW 2009

    is compatible with the labVIEW 2010

    Thank you

    Check out this link.

    http://www.NI.com/support/LabVIEW/lvtool.htm

    If the required toolbox does not "(ou supérieur) ' after the requirement for 2009, or specifies LV2010 it is not compatible."

  • Open the project Veristand Labview 2012 2012

    Hello!

    I have on my maschine 2012 LabVIEW and NI Veristand 2012.

    I am trying to open the 2012 2012 LabVIEW Veristand in project. Here's the sequence that I made:

    -Open Veristand separately (Yes, I know, it can be called with the help of command line)

    -Run the vi as illustrated in the diagram below:

    -as in the photo above, I received error 1172.

    I checked in my task manager--> there is no double open veristand

    I restart my PC, repeat the same procedure--> does not work. Received the same error message.

    Someone at - it experience even?

    Thank you

    Rajamodol

    Dear Rajamodol,

    VeriStand gateway creates a TCP/IP communication channel that
    facilitates communication with the VeriStand engine on the network.

    So if you are running a project on a desktop PC, gateway VeriStand initiates the
    VeriStand engine. If you run a project on an RT target, the VeriStand
    Bridge synchronizes with the system definition file that is running on the
    Target of RT.

    If you set the gateway VeriStand "localhost".

    Kind regards
    Oleg Scherling, mengg | Engineering applications. National Instruments | NIG. |

  • LV load error code 9:VI version (13.0) is newer than the version of LabVIEW (11.0)

    Hello

    We have a copy of LV2013 and several copies of a LV2011 running. A project of LV originally written in LV 2011 was opened by the LV2013 and then saved in LV2013. Now when LV 2011 tries to open the project, there are very few errors loading.

    As it appears on the pop-up error;

    "LabVIEW: file version is later than the latest version of LabVIEW.".

    An error occurred loading VI ' Series.lvlib: Close .vi 178XB BK precision.

    "LabVIEW support 9 error code: version of VI (13.0) is newer than the version of LabVIEW (11.0).

    Currently, the LV2011 to LV2013 update is not an option. Then there is other ways to solve this problem?

    Please help, thanks in advance.

    Open the project (or the toplevel VI) in 2013 and go to "file... except for the previous version. Selection 2011.

  • Call the function in LabView from a DLL, and then access the global variable of DLL

    I've created a DLL in LabWindows with a function and structure.  I want to call the function from LabView and then access the overall structure.  I am able to call the function in the DLL with a "call library function node" and has access to the return value, but I can't understand how to access the overall structure.  The structure is declared in the header DLL with __declspec (dllimport) struct parameters file.

    Is it possible to access this structure without using the library of network variables?

    My guess is that you need two bytes of padding after "in_out" and another to two bytes of padding after "anin."  The reason being that ints are 4 bytes, and most of them C compilers will align on 4-byte boundaries.  The struct will naturally start to such a limit (in fact, in Windows, it will probably start to an 8 byte boundary).  If you then count bytes in your structure, you are 70 byte after "in_out."  70 is not divisible by 4, so you need 2 bytes more to reach the next 4 byte boundary.  You can also you could reorganize your struct so that "anin" follows "in_out" and this is probably the best option if it won't cause you other problems.

    Unlike most C compilers, LabVIEW compressed structures as closely as possible, without filling.  I don't know enough about the history of LabVIEW and internal parts to explain the reasons and to do this performance penalty, but, as choice of LabVIEW "endianness", it is probably a remnant of the first versions of LabVIEW that were running on the Mac.

    If for some reason you want to force your C struct to match package LabVIEW, you can use the #pragma pack (x) directive, but I wouldn't recommend that here because you can control the C and LabVIEW.

    EDIT: in the cases where it was not clear, add padding to your cluster of LabVIEW, insert appropriate size or items at the place desired in the cluster.

Maybe you are looking for

  • get the error when you run bootcamp on Sierra

    When you run Bootcamp-can not go beyond the second screen that gives me an error of pop-up windows 'startup drive must be an OS X extended (journaled) formatted partition. Workaround attemps I have partitioned my drive native and also used an externa

  • CNN feedback form does not load

    Several strange things with the CNN site. First, when I was at about 13:45 or so I typed in a term in the search field and kept getting in the message box in my lower left corner screen that was transmitting the data to something like falsemail [dot]

  • "Clips do not have enough media for the transition?

    I have two clips between which I want to insert a cross fade.  The first clip is 19 seconds long, the second is 16 seconds. When I try to put in the transition (I did two seconds of time), I get a message saying "Clips do not have enough media for th

  • DAQmxErrChk and regeneration

    Hello I wanted to inform you on the DAQmxErrChk function. What is it and how can it be used to control the regeneration? I have observed the following syntax: DAQmxErrChk (DAQmxSetWriteAttribute (genTaskHandle, DAQmx_Write_RegenMode, DAQmx_Val_DoNotA

  • BlackBerry world carousel

    Dear BlackBerry, First of all, you have published a how-to 'get you the App on the BlackBerry World carousel'. Then you submitted an application flashlight: During the last weeks, you have been endowed with a game called 'AA '. In fact, it is listed