opengds / OpenGDS

Open GOOP Development Suite
MIT License
55 stars 14 forks source link

Error 1556 when accessing GOOP4 passed to Actor #116

Open pettaa123 opened 1 month ago

pettaa123 commented 1 month ago

Hello, I am not sure if this code have ever worked but I get error 1556 when trying to access a GOOP4 class' attribute from an Actor, when the vi holding the Create finishes before I read in Actor Core. image I am using LV 2023Q4 , but I don't think this: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000001EABFCA4&l=en-GB is related, since the application instance looks the same for all VIs IMHO.

achuthaperumal commented 1 month ago

@pettaa123 Did you create the DVR_Actor with GOOP Suite? or with Default NI's Actor Scripting? Can you share the Write Test.vi?

Because If you have created with GOOP, Before you store anything, you have to call _Create.vi like you have done for Test.lvclass

pettaa123 commented 1 month ago

This is a defualt NI's Actor. So the DVR goes out of scope and gets deleted when Untitled 1.vi finishes execution. Do you know how to inherit from MGI's Panel Actor instead of Actor? When adding Panel Actor.lvlib to my project, Panel Actor doesn't show up as option. image

pettaa123 commented 1 month ago

However, I created a pure GOOP4 Actor with mObj ObjectAttribute member. But when creating mObj in a VI before setting it to GOOP4 Actor, the mObj DVR gets deleted, despite added to the Actor. image

achuthaperumal commented 1 month ago

@pettaa123 May I know why are you calling the testactor_Create.vi twice? That's the problem! When you call the testactor_Create.vi in the Actor Core.vi again, It creates a new DVR and the old DVR will be overwritten.

Make Sure the _Create.vi is called only once per instance.

achuthaperumal commented 1 month ago

This is a defualt NI's Actor. So the DVR goes out of scope and gets deleted when Untitled 1.vi finishes execution. Do you know how to inherit from MGI's Panel Actor instead of Actor? When adding Panel Actor.lvlib to my project, Panel Actor doesn't show up as option. image

Currently, I'm exploring the code to see if there's support to MGI Panel Actor. I shall let you know if there's any way.

pettaa123 commented 1 month ago

I think for Actor's it is advantageous to init their members before launching them. This makes error handling easier. It seems this is impossible right now, at least with GOOP4 members. Maybe it is better use GOOP3 members with actors then?

achuthaperumal commented 1 month ago

I think for Actor's it is advantageous to init their members before launching them. This makes error handling easier. It seems this is impossible right now, at least with GOOP4 members. Maybe it is better use GOOP3 members with actors then?

Hi, It's possible with GOOP4. But you need to delete the _Create.vi once the Actor is generated.