LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RT code works from LabVIEW environment, but not when I build and deploy

Solved!
Go to solution

I figure there a lot of reasons why this might happen, but I can't seem to pin it on one.

 

I have a classical controls program that runs on a cRIO. We recently decided to change the communication from a comsoft ProfiBus card to Ethernet/IP. (The industrial protocol for Allen Bradely PLCs.) For various reasons, we put the communication bit in the control loop.

 

Now when I run this from LabVIEW, it works fine. I can see the data going to and from the PLC. I can sniff the packets and they look right. I get about 30 milliseconds on the loop, which is long, but since I am running from the IDE, I figure is not bad. (In other words, I get data in and out every 30 milliseconds.)

 

When I compile and put the binary on the cRIO, it breaks. I can still sniff packets, but what I get now is that all traffic to the PLC is read requests. My write requests are missing. Further the read requests are badly formed. Instead of asking for 43 elements of an array, they are asking for 1.

 

One test I tried was to turn off the read requests. For the binary I see no traffic. For the IDE, I see write requests.

 

I am using LV 2009 SP1. I have the NI-Labs version of the Ethernet/IP driver. (We have a request for a quote in, but don't have the official driver yet. In the meantime, the quicker I get this done, the happier everyone will be 😉

 

Any suggestions?

0 Kudos
Message 1 of 4
(3,079 Views)
Solution
Accepted by topic author clendon.gibson@canrig.com

Look out for property nodes thats usually my problem when that happens.  Some that say they work in RT dont work in compiled RT. 

0 Kudos
Message 2 of 4
(3,050 Views)

This is exactly the problem. I was using the "Strings" property of ENUMS to calculate the size of a couple of arrays. With those arrays broken, the code would not work.

0 Kudos
Message 3 of 4
(3,041 Views)

Ahh yes, that one has gotten me before too, the NumElements fo enums dosn't work also.  I have this little thing that I use in place of those property nodes before.  Works so long as all the enum values are unique.  

 

Image 1.png

Message 4 of 4
(3,033 Views)