From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
03-08-2015 01:16 PM
I have an Instrument that can be read only by the software provided by the manufacturer. The Software has visual basic for applications (vba) and I'd like to take the values, queue in LabVIEW for further processing and storage. Then I'd like to call a method in vba passing the result of processing in LabVIEW.
My problem is what is the best way to interface Visual Basic and LabVIEW? I could for example write the values in a text file and read from LabVIEW and vice versa but I think this is far from the best practice of programming.
So I have a event an routine in VBA like that below. I Would like to Queue Value1,Value2 and Value3 in LabVIEW.
Private Sub Value_Change(ByVal Value1 As Integer, ByVal Value2 As Integer, ByVal Value3 As Integer) 'Need to Queue Value1, Value2 and Value3 in LabVIEW End Sub
Then I'd like to call a subroutine in VBA passing the result:
thanks
Paul
03-08-2015 05:21 PM
If you have access to the VBA source code, you re-write it in LabVIEW.
You don't interface LabVIEW to VBA.
03-08-2015 08:37 PM
As I think, you should specifed the "Software" for asking an answer.
03-09-2015 05:06 AM
The software and is called THD traceability Viewer and it shows the value and information of position sensors. It is installed with the instrument, which doesn't communicate with a simple protocol, like OPC or TCP so I need the software.
This software has a software development kit with many functions, and examples of use in VBA. I don't think rewrite in LabVIEW its a good idea because, the code is not so simple and it works great.
03-09-2015 07:38 AM
@rick2008 wrote:
This software has a software development kit with many functions, and examples of use in VBA. I don't think rewrite in LabVIEW its a good idea because, the code is not so simple and it works great.
Then, you'll be forced to use their software.
03-09-2015 06:17 PM
I am using the software and I will use. LabVIEW will not replace it in anyway. I am using LabVIEW to do something more, like mathematical models.
The problem is the interface between VBA and LabVIEW. I am writing the values in a text file, reading through LabVIEW, processing the information and returning set-points to the software in the same way: Writing a text file and reading through VBA.
The question is, is there a better way to do this instead text files? I think there must be some, and I am asking for your help.
Thank you all
03-09-2015 07:18 PM
Chances are good that you can translate the VBA examples to LabVIEW easily. You wouldn't rewrite their software, you would just access it differently. I assume their code is not actually written in VBA, rather they provide an ActiveX or similar component that can be accessed from multiple languages and they just chose to use VBA for their examples. If so, you should be able to access that same component from LabVIEW. If you provide an example of the VBA code, we can probably explain how you would do the same thing in LabVIEW.