LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible in LabView 7.1. write an OOP script?

I have another software (INCA from company ETAS), which I would like to control from LabView. INCA offers communication via COM (DCOM). Therefore, I need some OOP language. Is it possible to write some OOP script in LabView 7.1.?

I wrote already some scripts in Visual Basic (Visual Studio 2005). Is some possibility to call these scripts from LabView? 

0 Kudos
Message 1 of 15
(4,879 Views)

If I understand you correctly, you want to call some code written in some text-based prog language into (from) LabVIEW, right... ?!


 


@Ondrej7 wrote:

Is it possible to write some OOP script in LabView 7.1.?



If it is the other way that you want to "write" some OOP script in LabVIEW, I think you cannot; because all you can do in LV is "wire", NOT ""write" anything...

But, there is scripting in LV, which means that you can play with some hidden options & use some good features (not tested by NI completely, nor supported by them)...

Please make us clear to help you more.

See reply 7 in the below thread for more details regarding scripting in LabVIEW.

http://forums.ni.com/ni/board/message?board.id=170&message.id=79502

- Partha ( CLD until Oct 2027 🙂 )
Message 2 of 15
(4,863 Views)
You can communicate with a COM or DCOM object in LabVIEW.

It doesn't require a OOP language, you can also call (D)COM objects from C
or ASM.

LabVIEW can be used for OOP programming (>8 allows you to make class
hierarchies). But you won't need this either, although you could use it. It
won't help you with the (D)COM communication.

A program is not called a script, but a VI (Virtual Instruments). Scripting
in LabVIEW is something else, and you will definitelly not need it for this.
Hence the confusion.

Regards,

Wiebe.


Message 3 of 15
(4,856 Views)

Hi, thanks for your answers.

I need to build a communication between software INCA and LabView (data exchange). So I'm looking for the ways how to do it.

1) my first idea was that I will write an script with OOP language and convert this script to dll and the dll I can call from LabView. I started with Visual Basic (it was the simplest way) and I used the VB with .NET framework. My program (as windows application) works and I can control INCA. However, I can ´t find out, how to convert the program to a dll. In VB, there is also possibility to create (write) a "class library". I found out that LabView could also call class libraries. However, it never works in my case.
(I am sorry, I am not familiar with OOP programming and I have just started because of this problem. So may be some expressions are not correct)

2) So next I'm looking, if I can create in LabView some VI, which could communicate with INCA. But as I read your answers, this is probably not possible..

Pls let me know, if I should explain something more clearly.
thanks

0 Kudos
Message 4 of 15
(4,852 Views)
>You can communicate with a COM or DCOM object in LabVIEW.

It is definitely possible. I don't know why you think I said it's not
possible.

For the record: LabVIEW is not per se OOP. You don't need OOP to call
(D)COM. You can do it in LabVIEW, even if you don't use OOP (since OOP is
not a requirement to use (D)COM).

Regards,

Wiebe.


0 Kudos
Message 5 of 15
(4,858 Views)
>>You can communicate with a COM or DCOM object in LabVIEW.

>It is definitely possible. I don't know why you think I said it's not
>possible.

>For the record: LabVIEW is not per se OOP. You don't need OOP to call
>(D)COM. You can do it in LabVIEW, even if you don't use OOP (since OOP is
>not a requirement to use (D)COM).

If he already has a connection from VB.NET application to INCA, I don't see any
point in learning (and getting frustrated) with COM. Just build a DLL with VB.NET
and call it from LV.

For building DLL, see this link.

According to my knowledge VB is not OOP either, they are both Object Based languages.
0 Kudos
Message 6 of 15
(4,860 Views)

Ok, I understand that LabView can communicate with COM but I don´t know how to do it. I need to create a classes and object and everthing what I tried failed.

I already traied to create a dll from VB.net according description, which you mentioned. But such created dll I´m not able to call from LabView.

0 Kudos
Message 7 of 15
(4,849 Views)
You should be able to call a VB dll in LabVIEW.  Maybe you can provide some more information on how you are calling the dll and what about the call isn't working.  Specifically:
Why are you not able to call this dll from LabVIEW? 
Is it giving you any sort of error? 
Are you using the Call Library Function Node?
Can you call any dll's (such as a dll from C:\WINDOWS\system32)?
0 Kudos
Message 8 of 15
(4,838 Views)

Hi Brian,

I called the dll using the Call Library Function Node. I think there is problem, that I cannot specify the function name (LabView cannot find which function are available in the dll). So I cannot start the VI (error: Call Library Function Node: no function specified).
I have some experience with calling dlls in this way (I didn't create these dlls) and it always worked.

FYI: my dll was created from VB.net with the steps describe above. I'm not sure, if it is a standard dll, which can be called with the Call library function node.

Thanks for any hint

  Ondrej

 

0 Kudos
Message 9 of 15
(4,833 Views)
Looks to me you're not exporting the functions when you build the dll. Did
you try a VB example with an exported function?

I agree with Kaêm. If the COM code isn't trivial, you should reuse the VB
..NET code. If it's just a few calls, try it in LabVIEW.

Regards,

Wiebe.


0 Kudos
Message 10 of 15
(4,823 Views)