LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need a VI to link to historical modbus data and produce a Graph on the VI and have the ability to write to .xls file for a specified range of time

I am trying to create a VI that links to a Modbus I/O variable that I access through NI DSM: The VI need to be able to select (hopefully by a drop-down) a test unit we have that is currently reading temperature. It then need to be able to access (trace) the historical data it has been logging and produce it to a waveform/graph. I also need the ability to specify what date/time range I want to see on the waveform/graph. I am trying to set this up for the lab technicians so they can select a test unit on the VI and view on a graph, the temperature data from the past day/week/ etc range that they need to see. If there is an issues, they need a way to save that range of data to an .xls so they can plot/print the data to present to superiors. Attached is the NI DSM and the VI that I have started to attempt to build. I'm very new to this and do not have access at work to the tutorials or YouTube as refereance sources. Am I headed in the right direction?

 

0 Kudos
Message 1 of 6
(933 Views)

Not really, no... You need to be learning about file IO, data acquisition, event driven programming and a bunch more.

 

You need to find someplace where you can access the tutorial material, whether at home or perhaps a library or something. Here are some good links in case you need them.

 

3 Hour Introduction http://www.ni.com/white-paper/5243/en/
6 Hour Introduction http://www.ni.com/white-paper/5241/en/
LabVEW Basics http://www.ni.com/gettingstarted/labviewbasics/
Self Paced training for students http://www.ni.com/academic/students/learn/
Self Paced training beginner to advanced, SSP Required http://sine.ni.com/myni/self-paced-training/app/main.xhtml
LabVIEW Wiki on Training http://labviewwiki.org/LabVIEW_tutorial#External_Links

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."
Message 2 of 6
(903 Views)

Mike,

 

I got a lot done today.... I'm a fast learner. So maybe you can help me with my next issue. I'm trying to format my graph.... I gave it two time stamps in which it read data from, but the X-axis is not showing that it took from that range..... it's actually showing either much more or much less when I run it. Also, every time I stop>start, it adds more data! I also created a save button which I added to the event window. I want the operator to save to excel this way as well....but it doesn't save as an excel spreadsheet or even a readable spread sheet. I can right click on the graph and plot to excel, which is okay too. I just need this graph to represent the correct range that I input as the start and stop time stamps. See attached

0 Kudos
Message 3 of 6
(895 Views)

At this stage of the game, it would be best to practice making your VI presentable.  All the crooked wires and stuff may not make much of a difference now, but just wait until your code gets a little bit more complicated.

 

If you've ever programmed in a text language, this is analogous to having indents.  You could have random indents - the computer could care less - but you sure would have a hard time understanding the code!  Smiley Happy

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 6
(882 Views)

butttt...... how do i format my graph to represent the start time - stop time on the x-axis

0 Kudos
Message 5 of 6
(855 Views)

I don't have the right version of LabVIEW to open your VI, so I'm just looking at the image you posted. Right now you are charting data that isn't associated with any time points, so you can't limit the data displayed to a particular period of time. Perhaps the easiest solution is to track the start time for the data and the time interval between points, and then when the user wants to see only a certain range of data you can calculate the correct set of elements and use array subset to extract just that range. To do this you'll also need to use a graph, not a chart (since, as youv'e already discovered, writing new data to a chart just adds to the existing data).

 

To clear a chart, write an empty array to its History Data property, using a property node.

Message 6 of 6
(834 Views)