04-29-2008 04:06 PM
04-29-2008 08:26 PM - edited 04-29-2008 08:27 PM
05-01-2008 01:20 PM
05-02-2008 04:32 AM - edited 05-02-2008 04:33 AM
05-02-2008 07:38 AM
I'll have to read from the start (which I will do next), but:
Why do you want an acquisition loop for each port? Think of it as an Event system. The "event" is acquire data. Therefor, you only need 1 loop to acquire the data.
I would create a vi (sub-vi) which handles the serial communication. Make the vi re-entrant.
Before giving more advice, I would need to know the rate of acquisition because it would have an impact on the appropriate architecture. That means I will now go read the original post.
be back soon 😉
RayR
05-02-2008 07:49 AM
I will answer within your question:First of all, you already have code that may help you implement your solution. Do you have access to the source code? If so, are the terminals available on the connector pane to communicate with the existing VI? If not and you have the source code, wire that up.
dtp wrote:
1. User will connect as many devices as he need and set up their parameters such as samples per second and connection port.That works to your advantage. You can also use this to determine how many ports to use. Draw a state chart on what events can take place and the different outcomes. This will help you to design your solution.2. User will select the channels that will be save on disk.Put this in the state chart as well. The event is save to disk and a parameter is which channel to save, and maybe the naming of the file. This becomes a function (sub-VI) that you can call3. When the acquisition starts the VI must be able to read data from all configured instruments at the same time.This is why you need one (1) single solitary loop for your acquisition event. The idea of Daemons comes to mind, but this will depend on how big / often / how long each acquisition is, and what is meant by simultaneous.4. After data is received the VI must be able to save only those channels that were previously selected and optionally plot them.Does it do this while it is acquiring more data?5. There must be a window which shows the program status for example if a device is disconnected, which channels are enable tosave data and if an error ocurrs.Does it verify before doing acquisitions or during the acquisitions or at all times (constant monitoring)?
05-05-2008 12:34 PM
Hello JoeLabVIEW:
Thanks for replying. I will give you more information so that you can provide me more suggestions.
The acquisition will be continuous from 1 day to 1 week, so how long the acquisition is, it depends on the period of time that the user needs. How often depends on the sample rate that the user needs for each three-channel device, it could be 50, 100 or 200 samples per second. And my idea of simultaneous is that my VI must be able to read data from all ports when the acquisition starts.
About saving and plotting data, it will be while my VI is acquiring more data. In my previous VI the data were read from my device and saved on files of 10, 20, 30 or 60 minutes of duration.
About the window that shows the program status, it will be necessary only during the acquisition.
Regards, dtp
05-06-2008 07:32 AM
dtp wrote:
The acquisition will be continuous from 1 day to 1 week, so how long the acquisition is, it depends on the period of time that the user needs.
Let's keep the architecture very simple... This will be your main loop. A while loop would be more appropriate. You can set the granularity to what you want, but 1 minute is probably sufficient. So you would have a control that the operator enters the duration, ie 1 day to 7 days. You take a timestamp when the test starts and you add the duration to it. That will be the end of test condition. Not necessarily stop the loop. You should have a seperate STOP button for that.
How often depends on the sample rate that the user needs for each three-channel device, it could be 50, 100 or 200 samples per second.
You will need a control [cluster containing 3 numeric values?] that sets the sampling rate for each channel. I suspect you may want to configure them individually. If not, then a single control could do. Since you want to perform other tasks while the system acquires data, then you could have a sub-vi that is re-entrant handle the acquisition. Another approach is the use of Daemons (my preference) - similar concept, using timed loops. I would use an Active Engine to buffer the data (I need to think about this because you may want to actually call something else to then write to file... and there are 3 buffers... which is why I did not say "Functional Global". --- sorry.... I'm thinking out loud ---
Actually, a producer / consumer architecture is probably more suited for this and you could use a queue to pass data to the consumer loop for handling. It would have a state machine to appropriately handle the data (plot, store, etc).
Question: would it be acquiring data continuously at 200 samples per second non-stop for 7 days? If so, what type of PC will be running this? Multicore? single core? And what Labview version is used for development?
Message Body: Message cannot exceed 10000 characters.
05-06-2008 07:32 AM
(part 2)
And my idea of simultaneous is that my VI must be able to read data from all ports when the acquisition starts.
That would be handled by calling the vi (sub-vi / daemon above). Simply make sure they start at the same time. Make sure the sub-vi has an error in on the connector pane. It will make life easier.
About saving and plotting data, it will be while my VI is acquiring more data. In my previous VI the data were read from my device and saved on files of 10, 20, 30 or 60 minutes of duration.
Plotting the data is relatively easy. If you need help, simply describe how you want to plot it and provide sample data.
Saving the file at different intervals. Again, a control is needed to allow setting the interval time. Do you really want to wait 60 minutes before saving data? Maybe save every minute and change filename after the duration. Explain your thoughts on how file saving occurs. Will it be one single huge file or several timed-interval files?
About the window that shows the program status, it will be necessary only during the acquisition.
If you use a properly architectured producer / consumer architecture, you could also monitor events such as changes to the test environment and display the status. That would mean that the producer loop would contain an Event Structure that handles operator interface events (pushing a button, entering value, etc. And also monitor the status of the software as it runs. It would also start appropriate Daemons (or sub-vi) and stop them for the duration of the acquisition. It would also monitor the timing to trigger the consumer loop to handle the various events that would be passed to it at regular intervals (plot data, store file, update satus display).
There is a template of what I describe if you select New VI from Template and you look for an event structure (with data?). Unfortunately, I do not have LV installed on this PC. Also do a search within this forum for Event Structures. and Action Engines... and Daemons.
05-12-2008 06:51 PM
Hi JoeLabView,
Excuse me for not replying quickly. But now I will clarify some points:
Well, the data will usually be acquired continuously at 100 sps from 1 to 7 days non-stop for each three-channel device but there must be an option to stop the acquisition whenever. My PC is a pentium III with 512MB RAM and I'm programming in Labview 8.0. However the final user has a laptop with better features.
About how to save the data, in the previous version of my program, first the three-physical channels of a device are configurated in a dialog box specifying the duration of the files in minutes(1-60) and this configuration is saved on a configuration file. Next, the program is run and the data are saved on successive files with the configurated duration in a folder for each physical channel.
However in the new version, before running the program the user must configurate as many logic channels as he need one by one using a dialog box. Moreover each time that he configurate a logic channel, this configuration will be saved on a different configuration file. After when he run the program, the received data of all logical channels must be saved on successive files wich will be in a folder for each logic channel.
Thank you for helping me!
Best regards, dtp