LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Odd behavior with OOP on cRIO

Solved!
Go to solution

I have a very simple VI - all it does is flash the USER1 LED on a cRIO controller. When I run the cRIO-targeted VI from a remote computer, it works fine. When I compile/deploy it, it works fine. If I then take a LV OOP example, and use it to put an object on the wiring diagram (unwired to anything), and again run the VI from the remote computer, it again works fine.  However, when I then compile/deploy it, it no longer functions (the LED doesn't flash).

 

Any ideas on why just putting an object on the wiring diagram of cRIO-targeted code causes it to no longer function?

 

Thanks in advance for your assistance.

 

0 Kudos
Message 1 of 8
(2,988 Views)

Can you post your code?

0 Kudos
Message 2 of 8
(2,967 Views)

Here is a screenshot of the project and code. It is based on the "Access Scope" LV-OOP example, where I added a cRIO target to the project. I will see about getting the actual code posted.

 

I even took away the loop to make the LED flash, so instead it just turns it on. Still the same problem. I figure it has to be something simple that I am doing wrong.

 

0 Kudos
Message 3 of 8
(2,949 Views)

Can you build and deploy a debuggable executable? That way you can connect to the exe and make sure it's not getting a broken arrow because something wasn't included in the build. Also, have you confirmed the code is running at all? Maybe create another VI that flashes the led without the object constant on the BD and see if that works. 

0 Kudos
Message 4 of 8
(2,944 Views)

Are you including the class in yoru build specification as always included?  Sometimes there seem to be strange things going on with the loading classes into memory on the cRIO.  

Message 5 of 8
(2,932 Views)

@Jed394 wrote:

Are you including the class in yoru build specification as always included?  Sometimes there seem to be strange things going on with the loading classes into memory on the cRIO.  


I agree, this is what I was getting at when I asked him to remove the class and see if the problem goes away. If it worked, this was going to be my next suggestion. Definitely something to try.

Message 6 of 8
(2,924 Views)
Solution
Accepted by topic author Chris_12345

Ah-ha! Yes, that is what the problem was. I put the class into the build specification, and now it is working properly.

 

Thank you for your help!

0 Kudos
Message 7 of 8
(2,907 Views)

That sounds like the answer that Jed gave you.  If so, you should do the right thing and mark his message as the solution to your problem rather than your own message.  First, go to the options menu to the upper right of your message to unmark it as the solution.

Message 8 of 8
(2,894 Views)