LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Chart Property Nodes to update a second chart

Hi,

I wonder if anyone can help me with the problem.

 

An application we use in work requires the use of a 8 channel waveform chart. The X axis an be changed by the user to display any time from the current shift (it could be before the logging begins, or after the current sample). This part of the program is currently working correctly and we have had no problems with it.

The next bit gets a bit trickier so I will explain it as best as I can: -

We currently require paper copies of the waveform being displayed identical to the properties shown on the screen. This is done by calling a subVI and sending the waveforms, x.offset, xmaximum, x minimum and history. (Additional information is sent but that is separate to this chart)

the information seem to get transferred correctly until the buffer is full, or the x axis is adjusted. The whole aim for the print VI is to recreate the chart exactly how it is displayed on the screen.

I have attached the VI to give you an example of what I mean -

 

Potential1 is the main VI which produces the graph which we would like to print

Print multiple graph1/2/3/4 are examples of the current solutions we have attempted (solution 3 works better then 4 but still has issues once the buffer is full)

 

graph test- this is how we would ideally like the second graph to function.

 

Although I am new to LabView its seems to be very difficult to get graphs to display real-time data when you begin to manipulate the axis.

0 Kudos
Message 1 of 12
(4,109 Views)

Hi Edster,

I haven't examined all your VIs in detail - but I'd like to ask a couple of questions...

Why are you creating a second graph/VI?

How are you "printing" the graph?

It's fairly easy to print a control image directly using "Report Generation" VIs - although the print scaling is sometimes distorted to fit the page size..

Mark.

0 Kudos
Message 2 of 12
(4,097 Views)

A second graph is created to format the page to document template required here. If you look at the VI's you can see the page that is printed is a lot different to the one being displayed. This was how the system was originally designed - I have currently been tasked with trying to solve this problem.

The graph/chart layout is then sent to a default printer and the document is exaclty as it is displayed on the print multiple graph Vi.

I have looked at using the print report option, but I have a number of issues with it and think it will be quite difficult to get the same layout of document as required.

If you get a chance please have a look at the VI in particular print multiple graph 3.

 

 

0 Kudos
Message 3 of 12
(4,088 Views)

Edster,

First of all - I had to tidy up some of your code. It was a bit messy and very difficult to read what was trying to be done. Even though I havn't solved the problem, you might find it useful to see the code laid out a bit clearer. I'm not sure why you used local variables to access inout values instead of just connecting to the wires/terminals.

Unfortunately the bad news is - as far as I can see, once the chart x-axis is scrolled away from showing the most recent data there is actually no way of determining the index into the history array from where the displayed data is taken. The "offset" is not an index into the history array, it's simply a modification the the charts original "zeroth x-value".

Sorry if this is bad news - I can't think of any work around to implement your basic idea.

Mark.

P.S. I've attached some tidied up code of yours. 

0 Kudos
Message 4 of 12
(4,072 Views)

Hi

Thank you very much for the reply, I thought my code was a bit messy - I had recently attempted a different solution, and kept some of the components to build up the this solution. By then I was slightly exasperated with the problem, as I would get it to scroll in one direction but would fall over when I attempted it in another.

I don’t quite understand why it wont allow the data to be moved, when they give you the option to do this in the chart command. Surely if you know the length of the history array, and the actual time that you started the graph you could work out where the sample should be displayed.

I want sure if the idea concept could be complete, but I will keep having I look at it - I have an idea in my head atm. Cheers for the info and the feedback, every little bit helps!! Smiley Happy

Edster

0 Kudos
Message 5 of 12
(4,060 Views)
hi Edster,
 
can U kindly attach the missing VI Print panel to Printer.vi
 
I wish to go thro' it.
 
Regards,
Partha.
- Partha ( CLD until Oct 2027 🙂 )
Message 6 of 12
(4,049 Views)

Hi,

Sorry about that, I have attached the file as requested.

0 Kudos
Message 7 of 12
(4,042 Views)
Hi Edster,
 
Will the attached VI suffice for Ur process of Printing the Front Panel portion that is visible to the user ?
Replace Ur sub-VI for FP printing & try this one to find if it is working or not.
 
Experts pls tell if this can be used in all places where FP printing is required...
 
Regards,
Partha.
- Partha ( CLD until Oct 2027 🙂 )
Message 8 of 12
(4,028 Views)
Hi Partha,
 
Your VI, as is, would only print its own front panel. To use your VI as a sub VI, to print a calling VI's front panel you would need to pass a "reference" to the calling VI from the caller to your sub VI.
 
Note: Your sub VI does not need the "panel" property node - only the "Print Panel to Printer" invoke method is needed to print the referenced font panel.
 
Edster's problem isn't actually with printing part of the font panel - his problem is that he wants to take the user selected "visible data" part of a chart (a part of the chart's "hisory"), then display it in a differently styled chart, which is then printed out.
 
The problem (as far as I can see it) is that there is no way to programaticaly determine which part of a chart's history data is currently visible when the user changes/scrolls the chart's x-axis.
 
Mark.
0 Kudos
Message 9 of 12
(4,022 Views)

Hi Partha - The VI does print but I still have the issue with the actual information displayed on the graph.

 

Mark H - Attached is another attempy at a solution - apologies if the code is not very tidy (still getting the hang of the actual programming language). This program seems to allow you to move the data required, and print out the correct information. Would it be possible for you to have a look at it and comment as to whether you think this is a valid solution.

My only other point would be that if you know the start time for the logging, the length of the array, the max and minimum of the graph and the current time there must be a way of getting the graph to sidplay the correct information, although I current havent been able to programatically write one down I can sort of see the soultion in my head.

0 Kudos
Message 10 of 12
(4,011 Views)