I'm back after a few weeks of playing around with LabVIEW to try to fix it myself. I've gotten pretty far, I think, considering I have only myself and the two books "Learning with LabVIEW 7 Express" and "LabVIEW Graphical Programming" to help me!
My previous post on this subject can be found
here, though it is not necessary to read in order to help me with my current problem.
With this post you will find 3 VI's that I have created, these are:
"sub-test.vi" is my first attempt at creating a usefull sub-vi. I have documented it and made an icon for it, but all it does is really save me from a few extra blocks in my program.
"neat but not working.vi" or ex1: I think it looks neat, but it will not work the way I would expect it too.
"messy and still not working.vi" or ex2: this one looks more messy, uses a for loop instead of a while loop and is not working the way I want it too either.
-----------------------------------------------------
What I am trying to do:
I have incomming serial data tagged with the channel name. I know how to extract the data (16bit unsigned int) from the header and footer using match patterns and type-cast (see sub-test.vi). I now want to "save" the incomming channel data (for simplicity lets assume that I only have one channel, called T1) in an array called T1. Naturally, I need to be relativly sure that my array actually does store my data (coming in at about 2/second). I then want to display that array in a graph at a set interval, say, every 2 seconds for example.
-------------------------
So far I have been playing around like a blind person on an open field, feeling my way in the dark. I have tried a lot of solutions that seemed like good and logical solutions to me, but they didn't work, so obviously my logic is flawed.
In Ex1 I tried to time the graphing by placing the graph and array in a sepparate while loop along with a "Wait until next ms multiple". The reading of the serial port is handled in a separate while loop running at max speed to catch all incomming data. It doesn't work the way I want it too.
In Ex2 I tried to achieve my goal with another tactic. In this I get the graph to display stuff all the time, but I am unable to time the "refresh" of the graph.
----------------
You may notice that I use the "old" serial port VI's (if you take context help on the Serial Port Init VI you will see a note explaining how it has been replaced with VISA VI's in the functions palette.. I have tried to use those, but I find them to be more difficult to set up. That is, I got it up and running and accepting data, but I got some errors and crashes from time to time, so I guess I used them incorrectly. Anyway, what I want to say is that if you feel that I should use the VISA VI's instead, I will need someone to set them up correctly for me the first time so I can see how it should be done.
------------------------
Both Greg McKaskle and Brian Powell provided a lot of help in my first thread at the very beginning of my project, and I hope that someone will be just as helpfull this time around!
I use LabView 7 (the posted VI's from school) and Labview 7 Express on my personal laptop. (what -is- the functional difference between the two? I have not found anything? The only difference beeing that the Express have a watermark on the VI's?
All the systems use Windows XP