May-20-2019, 10:01 AM
I'm trying to Control LabVIEW front panel in python using by ActiveX communication.
I couldn't assign the input parameter values automatically in LabVIEW.
If I run as follows program code it's assigning as 'zero' for both inputs(Input 1, Input 2).
Whenever I tried to run the program the controls taking as default value.
Is there any method for assigning input values while the VI.Call() function(calling and value assigning should happen simultaneously)?.
Give a conclusion for this issue.
I tried VI.Call() function after set input values and the LabVIEW VI taking input values as 'zero'(0).
How do I call the VI with these input values?
Let me know, If any concerns
I couldn't assign the input parameter values automatically in LabVIEW.
If I run as follows program code it's assigning as 'zero' for both inputs(Input 1, Input 2).
Whenever I tried to run the program the controls taking as default value.
Is there any method for assigning input values while the VI.Call() function(calling and value assigning should happen simultaneously)?.
Give a conclusion for this issue.
I tried VI.Call() function after set input values and the LabVIEW VI taking input values as 'zero'(0).
import win32com.client # ActivX Client LabVIEW = win32com.client.Dispatch("LabVIEW.Application") # Connect LabVIEW VI = LabVIEW.getVIReference(r'D:\New folder\LabVIEW.py') # Get VI Reference VI._FlagAsMethod('Call') # Call the VI VI.Call() VI.setcontrolvalue('Input 1', '56') # Set Input Value VI.setcontrolvalue('Input 2', '10') # Set Input Value result = VI.getcontrolvalue('out') # Get Output Value print(result) # Print result on consoleI expecting input values to be 56 and 53, but the actual inputs are 0 and 0(automatically assigning in LabVIEW as default).
How do I call the VI with these input values?
Let me know, If any concerns