Kathryn62 Posted January 17, 2005 Report Share Posted January 17, 2005 Hi, This is my first Labview project and I am struggling. I feel I ought to be able to pick up Labview much easier. I am trying to talk to a simple serial device (spectrophotometer) and get it to periodically measure and plot to 3 scrolling XY graphs on the front panel, and respond to simple commands such as calibrate, measure and export. I started with the low level while loop which successfully measures, plots (sort of) and writes values to a file. Then I started at the top to write a custom user event structure example - which also kinda works. (1)My major problem is deciding how to integrate the two bits - deciding which should be in top level and which in subvi. I would like: The 3 XY plots to be visible all the time and to show updates in real(ish) time - I guess this means they should be in the top level - but that means they are also on the front panel of the subvi??? Measurement to occur automatically (1 min), but also to respond to top level pause and quit commands. I am confused how to utilize my top level user event - does it need to get passed to the subvi? Where should I initialize the serial device? Other problems: Top level: (2) I don't know how to selectively just disable one of my user events - measure timer. I tried separating it with a different typdef file and use not a refnum constant but the error seem to say this was only for front panel events. Unregister seems to unregister all events for that refnum (3) Quit button stopped working (4) SubVI: Measurements may stop for hours, so I thought I could not use Charts without having a lot of zero values. I tried to use registers with XY plot to simulate a chart, but don't know how to scale this. Any help would be appreciated. Thanks, Kathryn Download File:post-1348-1105996219.zip Quote Link to comment
Kathryn62 Posted January 21, 2005 Author Report Share Posted January 21, 2005 Hi,(1)My major problem is deciding how to integrate the two bits - deciding which should be in top level and which in subvi. I would like: The 3 XY plots to be visible all the time and to show updates in real(ish) time - I guess this means they should be in the top level - but that means they are also on the front panel of the subvi??? Measurement to occur automatically (1 min), but also to respond to top level pause and quit commands. I am confused how to utilize my top level user event - does it need to get passed to the subvi? Where should I initialize the serial device? 3550[/snapback] Total brain fault now fixed.... My major problem was that I had never had a front panel and shift registers in a "subroutine", so I thought I had to somehow pass these up to the top level. My solution was to delete the while timing loop in the subvi and move the subvi's shift registers onto the top level's event loop; move all the XY graphs to the top level and just pass the 3 values for the graphs. The event timer then triggers the subvi at the required interval. My second subvi was much less stressful Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.