取消
显示结果 
搜索替代 
您的意思是: 

access class object in multiple threads

已解决!
转到解答

Hi!

I realized that objects are by value, so how to realize my problem? I can not figure out how to get the reference to my object.

BR / Thomas

lv1.PNG

0 项奖励
1 条消息(共 4 条)
3,083 次查看
解答
接受人 Thomas_J

Search for "DVR" and "LVOOP".

 

There are plenty of discussions on teh topic.

 

Shane.

2 条消息(共 4 条)
3,080 次查看

OOP in LabVIEW not based on by reference like in c++, but is based on by value. 

So you will not be able to get any reference to your OOP object.

 

So what is happening in your code, is that a the fork of the object wire your are creating to copies of your object.

One thing you could do is have DVR in the private data of the class. Make a method that initialize the DVR, and call that method before the fork.

The in your read/write method, make use of the DVR to share the data.

3 条消息(共 4 条)
3,064 次查看

Thanks to both of you!

It took me some time to get it all right but now it works.

So I now have to redefine all my inputs and outputs for the class functions.

If I understand it correctly, there are no 'new vi from template' for creating read/write vi.s for classes with DVR.

/thomas

0 项奖励
4 条消息(共 4 条)
3,054 次查看