07-15-2013 11:44 AM
Tengo un programa en LV, en el cual están las variables compartidas 'shared variable' que poseen los campos de ciertas señales de unos sensores, necesito conectar uno nuevo, como modifico el programa para agregar esta variable?
Muchas Gracias
07-15-2013 12:50 PM
Courtesy of Google Translate:
I have a program in LV, which are shared variables 'shared variable' fields possessing certain sensors signals, I need to connect a new one, and modify the program to add this variable?
many Thanks
If you already have shared variables, that means you must have a shared variable library defined in your project. You just need to right click on that library and create a new shared variable. Within its properties, you can bind that variable to another cFP module and channel. Those cFP modules and channels should already be defined within your project as well.
07-15-2013 03:23 PM
Thank you so much, I'll check it out, and get back to you to tell you how it went
07-16-2013 09:01 AM
My input is a vector (shared variable) that includes the signals from different sensors, the issue I have is that I need to plug a new signal where I used to have another one, this new signal has to be display in a chart called "impulsión 2" I attached a screen shot where you can see the block diagram.
I thank you in advance for your help
Jimmy.
07-16-2013 10:31 AM
The data going into that chart is determined by what is going on inside your subVI with the icon Fltr Ctr 502/AI. Since I don't have a copy of your subVI, I don't know how or where that is getting its data.
Your 12 frame stacked sequence structure scares me. That is a lot of hidden code.
There are a lot of local variables. Neither of these things are good LabVIEW coding practices.
For your shared variable, Entradas Corriente, there is no need to duplicate that variable or duplicate the Index Array. Just read the SV once, then feed it into an Index Array that you can stretch downwards to get the 0th and 1st elements automatically.
07-16-2013 11:03 AM
Thanks for your quick answer, I'll atach the vi, so you can tell me what you think I shoud do, I just started working in this proyect unfortunatelly I did not design the vi,
the password for the block diagram is this one: gqsgqnlgme
07-16-2013 12:22 PM
I think you should redesign the VI. It is just full of abuse of local variables and sequence structures. There are a lot of Rube Goldbergs in there as well such as the 1-D boolean array to cluster, to unbundled, to 1:0 to multiply by an index value then adding up (what if there are multiple trues?) then feeding that to a case structure. Search 1-D array for a true will do the same thing without the potential for bugs.
Read the Rube thread in its entirety to see a wide range of bloated, bad code. Once you recognize patterns, you'll be able to fix things in this code.
Read Why some people say Local Variables are bad...
The code is just a mess. There is no way I can help you figure out how to work with another shared variable in the code.
07-16-2013 01:33 PM
Thanks for your help, I was afraid you were going to say somehthing like that, I guess I might just redesign the VI, I don't eaven know the guy who did it. Do you have some kind of tutorial (besides the one you just told me about) that might help me to get started with this issue?.... the system is quite large, I have a PPC 2115 running this program, it's connected to a cFP 2210, and many I/O expansions, it is supoussed to control two pumps, wich are never active at the same time, it also receives alarm signals from certain sensors that indicate the water level in two tanks, and it shows these signals by plotting them as you could see. (the system has worked just fine since I got here, but now I have to modify it)
Again, thanks a lot for your help
Jimmy Salgado
07-16-2013 02:36 PM
Basic LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours
Since there was heavy use of sequences, it sounds like a state machine architecture would be appropriate for this project. There is template for it if you create a new project. You can also search the discussion forums for "state machine" and find messages and examples.
I'm sure there must be some tutorial or example for working with compact fieldpoint modules. I'd suggest looking through the examples under the help menu. But I don't know where to find a more thorough tutorial. Search NI.com from the top level. And if you don't find something helpful there, google it. Google's search engine often works better finding stuff on the NI website than the search engine on the NI site itself.
07-16-2013 02:50 PM
Ok then, I'll get on it, thank you very much, by the time I'm donne with these tutorials I'll let you know
kind regards
Jimmy S.