Components

cancel
Showing results for 
Search instead for 
Did you mean: 

Current Value Table (CVT)

Hello Guys,

 

I try increasing the network publishing time to 1000ms but still havin the same issue. Also try to increase scan time to 100ms, but I couldn't because I am using softmotion and it need to run with the scan engine at 10ms or less, so I had no success with this. when I check the cpu load in Distribute System Manager, it is at 100%

 

I create copies of all my application vi's and replace all the network share variables with CVT tags. I create the tags list with the Tag Configuration Editor, then I use the "CVT Load Tag List.VI" and after that the "CVT Init.VI" in my main vi to load the tag list. However, when I run my appication it stop because apparently there is a tag that has not been initialized. When I check the error functions of the "CVT Load Tag List.VI" it read the error, "Tag List is Empty". The tag list is not empty, so I don't have idea why I am getting this error.

 

I thing I will go back with the network share variables vi's and increase the wait time of my loops to check what happens. Any other sugestion will be welcome.

Ferdinand Martinez
FMO Automation LLC
0 Kudos
Message 51 of 164
(8,756 Views)

ModbusTCP?

 

I know it doesn't make much sense, using an open fieldbus when your HMI is a NI product. But it will work, and you can effectively manage CPU loading by slowing down or speeding up the writing and reading to/from modbus.

 

I too ran into 100% CPU loading when I had many network published shared variables. I kept the shared variables, but removed the network publishing option. ModbusTCP was always going to be included in my project, it's a crazy suggestion for yours, but it could work.

 

During the course of my development, many NI folks also recommended the CVT, as well as some other messaging 'products'. Have look at AMC (asynchronous message communication), and the STM (simple messaging refernce library).

 

0 Kudos
Message 52 of 164
(8,750 Views)

Ferdinand,

 

It sounds like you may have a loop with no timing assigned to it, so it is running as fast as it can. Is it possible for you to post your code/project?

 

Also, have you looking into using the the real-time Trace toolkit to help debug? http://www.ni.com/pdf/manuals/323738a.pdf   You can download a 30-day trial of the software if you don't have it

--------------------------------------------------------------------------------------------------

--CLD--
LV 6.1 to 2015 SP1
0 Kudos
Message 53 of 164
(8,744 Views)

It could be as Jim suggests, that you have something untimed. However, if you are running softmotion at fast rates, that may be the source of the CPU usage. What sort of set-up do you have on the softmotion side? You may also disable network publishing for any scan engine variables you don't need, although it sounds like you've mostly proven that that is not a problem by changing the rates.

 

As for the CVT problem, there could be a few issues. Rather than sending your whole code (in case you feel uncomfortable) could you post here or PM me with your tag list and a screenshot of your initialization (specifically, how you have load tag list.vi and cvt init.vi wired up)?

My two thoughts, without looking at your code:

-Make sure that the file is in the correct spot on your target. File paths look different /c/ni-rt/startup/, but that is handled by LabVIEW. You just need to form a standard path  like c:\ni-rt\startup, and the path will resolve correctly. Its possible that error 7 is being thrown but CVT init does not check for that.

-Make sure that you are using load tag list with the correct device as input. That is, if you renamed your controller in the TCE to "softmotion1" then the text input to load tag list should be "softmotion1".

 

Thanks,

Daniel

0 Kudos
Message 54 of 164
(8,734 Views)

Hellow Guys,

 

Sorry for the delay on reply but I am mostly working in my customer facilities with until late with no internet acces.

 

S1ack, I try your advice of removing the network publishing option of the share variables that don't need it, but still get stock with around 98% of CPU load and the application did not respond. I will make aresearch for the modbus fieldbus and how to apply it, if you have any reference link I will appreciate it.

 

JimMcD, I am pretty sure that I don't have any untimed loop, I had checket them lots of times and changed the rates in each of them trying to get better results.

 

D_Smith, you were right, my problem loading the CVT Tag List was that I was using the wrong device as input (my bad, is the first time that I try to use CVT), but anyway, I discovered that I have a real mess with the tags and finding out all the mistakes and re-debug the code with the CVT will take me probably around a week or more.

 

At this point of the project I need to work with the fastest posible option taking into consideration some limitations.

 

  1. Our customer is waiting on us (me) to start running production in this machine.
  2. My boss will not be happy if I tell him that the solution is spend 4 or 5 thousand dollars in a new more powerfull controller. (if that is a posible solution).

If there is any other posible solution to this matter I will appreciate any sugestion.

 

And my code is attached if you guys want to take a look. Just don't be hard with me, this is just my third project with LabVIEW. The main VI is "PAC v2.vi" it call all the other sub-vi's. I had to remove the duplicated vi's where I replace the share variables with CVT tags and the ones where I replace the wait until next millisecond multiple with wait functions in order to be able of upload the attachment. (the whole file take more than 12MB.

Ferdinand Martinez
FMO Automation LLC
Download All
0 Kudos
Message 55 of 164
(8,715 Views)

Ferdinand,


There is a LOT of code there! I couldn't make it through everything, but a few things I noticed/had questions on:

 

1) Where are you hosting your shared variables? (cRIO? HMI? a desktop computer?) Hosting is determined by where the Library is deployed from (i.e. which target it is dragged under)

2) You can probably remove the "Use Buffering" under the network options for your shared variables, as most of them are boolean. This is likely adding a lot of overhead: http://www.ni.com/white-paper/12176/en

3) You can also probably remove the "RT FIFO" from your variables, as they are intended to be used to pass data between Determanistic, and Non-Determanistic loops. As far as I can tell, you do not have loops that are explicitly determanistic. This adds more CPU overhead: http://zone.ni.com/reference/en-XX/help/370622J-01/lvrtbestpractices/rt_bp_svars/

 

 

Also, not specifically related tou your code, but still important to the sucess of your project: Have you developed a compliance test for this system once it is installed (i.e. verify that IO is wired correctly, that functionality acts as expected, test how the system responded when something is broken/wires not connected, etc...)

 

-Jim

--------------------------------------------------------------------------------------------------

--CLD--
LV 6.1 to 2015 SP1
0 Kudos
Message 56 of 164
(8,706 Views)

Jim,

 

 Thanks for the quick response. My share variables are going to be hosted in the cRIO. When I run the vi's from my computer I move the variables libraries under my computer to host them there and run everything from my computer. When I going to build the specification fro the cRIO, I move the share varaibles libraries under the cRIO, build the specification and then deploy the builded specification to the cRIO.

 

Tomorrow I'm going to try your sugestion of removing the "Use Buffering" and the "RT FIFO" options and post the results here.

 

Thanks for the support that you are giving me guys.

Ferdinand Martinez
FMO Automation LLC
0 Kudos
Message 57 of 164
(8,694 Views)

Hello Guys,

 

After Jim's last sugestion of removing the network buffering and RT FIFO options from my variables we get some success. I was able to run the application from the cRIO, but the CPU load is still around 90% and the machine rsponse is slow, increasing my cycle time and reducing my required production rate. Also, due to the slowering in the system, some values in the HMI are not showing the actual values, since the updating  of the values look to run behind. I feel that I am in the right track with your support guys. Thanks a lot for it. I will continue looking for more options to reduce CPU load. If you guys have any other sugestion, thanks in advance.

 

I still has not enough time to research Sack1 sugestion of using modbus to communicate the controller and the HMI, but that looks like a major change that will require more time. If I don't find something else that can be implemented a little more quicker I will look at that in deep.

Ferdinand Martinez
FMO Automation LLC
0 Kudos
Message 58 of 164
(8,675 Views)

"some values in the HMI are not showing the actual values, since the updating  of the values look to run behind."

 

Are you saying they are still buffering? This is one thing I noticed when my shared variables were network published.

 

In your earlier post you mentioned disabling the buffering option. Could it be this change was not deployed properly? Perhaps you could wipe the cRIO, re-install software, and re-deploy. (Just clutching at straws).

 

I ended up with Single Process Shared Variables, RT FIFO Enabled: Single Element. I vaguely recall either LabView training, or an NI support engineer recommending RT FIFO for use with timed loops.

 

 

 

 

 

0 Kudos
Message 59 of 164
(8,667 Views)

Ferdinand,

 

That is good you are having some success with reducing CPU use.

 

The other major source ouf CPU use is probably based on your actual while loops. I suggest downloading the trial of the "RealTime Execution Trace Toolkit" http://sine.ni.com/nips/cds/view/p/lang/en/nid/209041   With this, you will be able to take a short sample of your code while it runs, and you can see how much time each VI takes to execute http://digital.ni.com/manuals.nsf/websearch/92B3D9F738DC54F386256E530076FEA4


This should work well for you since you have all of your loops contained within VIs at the top level.

 

-Jim

--------------------------------------------------------------------------------------------------

--CLD--
LV 6.1 to 2015 SP1
0 Kudos
Message 60 of 164
(8,662 Views)