LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview Api Selection with Matlab

Hi 

 

I'm calling LabVIEW from Matlab, but I have LabVIEW 2018 64 and 32 Bits, when I run the next Script the 64 Bits version It's called but I want the 32, Does anyone know how to specify the version to call?

 

clc
clear all
close all
mainpath = 'C:\User\Documents\MATLAB\APP\Public\PortOpen.vi';
lv = actxserver('LabVIEW.Application');
fw_com_port = 'COM10';

fw_open_vipath = [mainpath, '\Public\PortOpen.vi'];
fw_close_vipath = [mainpath, '\Public\PortClose.vi'];
fw_txrx_vipath = [mainpath, 'Serial\Public\Tx_Rx_Log.vi'];

S_fw_open = invoke( lv, 'GetVIReference', fw_open_vipath );
S_fw_open.SetControlValue( 'Port(Alias)', fw_com_port );
S_fw_open.FPWinOpen=1;
S_fw_open.Run();
BoolPortFound = S_fw_open.GetControlValue( 'PortFound?' );
BoolVISAOut = S_fw_open.GetControlValue( 'VISA Out' );
S_fw_txrx = invoke( lv, 'GetVIReference', fw_txrx_vipath );
S_fw_txrx.SetControlValue('VISA in', bool);
S_fw_txrx.SetControlValue('Write', 'Prueba');
Lectura = S_fw_txrx.GetControlValue('Read');
S_fw_txrx.Run()
S_fw_close = invoke( lv, 'GetVIReference', fw_close_vipath );

S_fw_close.SetControlValue( 'VISA In', fw_com_port );
S_fw_close.Run()
delete( lv );

Ing. José Antonio Páez López
Functional Test Engineer & CLAD
0 Kudos
Message 1 of 3
(2,220 Views)

Hello Ragnaroknight!

 

By what you described I believe the issue is that the actual default version of LabVIEW to open applications is the 2018 64 bits and not the 32 one. Is that it?

 

As you can check on this KB, LabVIEW chooses the default version by choosing the higher and newer version. If you would like to open it in the 32 bits version let LabVIEW opened before running your script.

 

Also, is there any reason for having both LabVIEW versions?

 

If you have any further question, just let me know.

 

Best regards,

Lucas Freitas
Technical Support Engineering
National Instruments Brazil

0 Kudos
Message 2 of 3
(2,074 Views)

Hi yes, my customer was working in same PC at different time using LabVIEW 32 bits for a different application that will be deployed in 32 bits systems. And the Idea of using scripts of Matlab is to don't have necessary open LabVIEW.

 

I change the script call to refer to the global variable of the version of LabVIEW.

Ing. José Antonio Páez López
Functional Test Engineer & CLAD
0 Kudos
Message 3 of 3
(2,062 Views)