LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to give same inputs but multiple times on XY graph

I attached image of Multiplot XY graph connection.Graph is showing current vs Fault no.This diagram is only for One fault like that i have to make for 45 faults.I have to connect all 45 faults data on only one XY graph.Every fault has their own modbus address.

I made this for one fault but I am facing problem for more than one.Please Help and give any suggestion.

0 Kudos
Message 1 of 18
(1,892 Views)

I think you need to re-think your entire program. When I see a gigantic stacks of sequence structures that don't really do anything, then going from an integer array to a cluster, unbundling all element and apply the same scaling, resulting in a scalar DBL which you convert to an array of DBL with that single element via another crazy detour over clusters and string arrays. I am questioning everything in this program. I think it could be done with 10% of the code.

 

Do you want one plot per fault or all faults on a singe plot? What is the meaning of x? Can you attach a simplified version of your VI containing some typical data?

 

 

0 Kudos
Message 2 of 18
(1,880 Views)

Do you realize trying to help some troubleshoot code when we are provided a partial picture of the code is often impossible?

 

Please attach an actual VI.

 

Based on the limited picture you provided us, I can only offer some comments.

 

Don't use stacked sequence structures, I see a 45 frame stacked sequence in there.  That is an indication of a poor architecture design.  I assume that correlates with the 45 faults you are talking about.  If you need to do something 45 times, that indicates you need a loop (I don't see any signs of one in that partial screen shot).  Usually that means working with arrays and looping over individual elements of a 1-D array, or perhaps the individual rows of a 2-D array.

 

I see a mix and match of various array and cluster functions in there.  Sometimes converting from an array to cluster, sometimes converting from a cluster to an array.  Converting from an array to a cluster than unbundling is Rube Goldberg Code.  Use Index Array when you want individual elements of an array.

 

Another Rube Goldberg is the string of functions where you go from a scalar to a string to a cluster to an array (single element) to an array of doubles (single element). Four functions to convert a scalar to a single element array.  But still not sure why.

 

I would recommend you learn more about LabVIEW from here. How to Learn LV

 

The inner single frame sequence structures don't seem to server a purpose either.

 

 

 

 

0 Kudos
Message 3 of 18
(1,871 Views)

Actully I am new in labview.may be i did some mistakes.and thats why i asked the query.I want multiplot per fault.On X axis is the fault No and on Y axis Current.I will send you the Vi.

0 Kudos
Message 4 of 18
(1,855 Views)

Since you are new to LabVIEW, be sure to take those tutorials!

0 Kudos
Message 5 of 18
(1,847 Views)

@avana2006 wrote:

Actully I am new in labview.may be i did some mistakes.and thats why i asked the query.I want multiplot per fault.On X axis is the fault No and on Y axis Current.I will send you the Vi.


Since the x values are consecutive integers, all you need is a waveform graph (possibly with x0 set to 1). No need for xy graphs and complicated data structures.

 

Where is the VI?

0 Kudos
Message 6 of 18
(1,841 Views)

Every fault consists of fault number on X axis and  four different values of current on Y axis. So I have to make for 45 faults on only one graph.Here is the VI.

0 Kudos
Message 7 of 18
(1,838 Views)

@avana2006 wrote:

Every fault consists of fault number on X axis and  four different values of current on Y axis. So I have to make for 45 faults on only one graph.Here is the VI.


Nobody is eager to troubleshoot a VI that spans about 100 screens!

 

Is there one U16 array with four elements for each sensor of four U8 arrays containing one (of four) value for all possible sensors. Here's how to graph on set given a U16 array input. You can easily built a 2D array to form 4 plots with 45 points each. We can only give the final advice once we know how the data is organized.

 

altenbach_0-1599286938889.png

 

 

 

0 Kudos
Message 8 of 18
(1,829 Views)

Ok .Thank you 

I got the correct output for first fault. I am stuck in other 44.The thing is every fault having there own modbus address.Using that address it is communicating with hardware.I attached the output of first fault showing on graph.

0 Kudos
Message 9 of 18
(1,813 Views)

First, look at all those single frame sequence structures you copied over and over.  You recognized something was special about that piece of code since you framed it and copied it repeatedly.  Every one of those does the same thing.  There are very few differences:  the value of a constant, and what cluster (which is really an array that never should have been made into a cluster).   Bring that constant outside of the frame.  Then everything in the frame can be made into a subVI.  Now you have greatly reduced the amount of code you have written.

 

Now that you have a subVI and realized you are repeatedly using it, then you can see "Oh,  that should be in a loop, I just need to feed it different inputs on each iteration!".   Now you have a For Loop, and the data that varies can be arrays that you auto-index at the border of the For Loop.

 

Here is another Rube Goldberg.   First, you don't need the In Range and Coerce because the math will never generate a number other than 0 through 255.  Just build the booleans into an array, to a boolean array to number.  Done!

Download All
0 Kudos
Message 10 of 18
(1,775 Views)