Hi!!I have some problems with the synchronization of my system, and I don´t know how I can solve this!

My system consists of differents vi´s.Some of them are used to read analogic inputs and digital inputs, using the serial port.
The values that I read, go through differents vi to be proccesed, and at the end, these values are written in a file, all the values in the same file.
My problems of synchronization are:
1. I have one vi per input, and all of them use the same serial port. How can I synchronize them to avoid serial port conflicts? (using queues??) And how can I do, to get differents number of samples/sg with every vi? I have to introduce them in differents loops?
2. The other problem is that, for example, I want to read 8 samples/ s but I only want
to write two samples every second. How can I do to avoid stoping the data flow?
Maybe, my problem is that I want to see the system like
one block, and I am ignoring that, although all the system works like a block, every part works using a different "speed". I don´t know how tools can I use to combine two ideas, working like an only system( data dependence, some vis need the data of others vi to be able to work) and working getting differents numbers of samples/s.
I have seen that there are synchronization vis. I am going to glance at them, maybe I find something interesting but I amsure that your help will be very useful?
Thanks in advanced!!
Graci

I think you are pretty much on the right track with Queues. I have implemented a very similar system myself using queues. I have even different systems connected to the serial interface, but I can synchronise them all easily using the following method:
1) Make a VI for opening the serial port and reading the data. The data (parsed to extract the numbers required) are then stored in an array (Shift register). If the pre-determined time delay is reached (say 5 seconds) the values are averaged and written to a Queue with a defined data type. Save the VI as a VI template.
2) Make a VI which starts an instance of this template VI for every channel you require. You can use VI Server to set values on the new front panel before you set it's property to "running". Setting a timer value for all can help ensure that the X-Axis of your timing values (if you require) are synchronised. The clue here is to define and initiate a QUEUE per channel. (RS-232_1, RS-232_2 and so on). The QUEUE name needs to be passed to the VI Template before running so that each VI running in the background has an individual link to the main program.
The second part of this VI simply uses an array of QUEUES, polling them one after another with a timeout of, say 5 ms. If data is found, append accordingly to an XY-Graph.
I also add in some "Auto termination" in the VI template (MAx number of values allowed in the QUEUE for example) to allow for the background processes to find out if the front-VI is still running or not. There are many different ways to do this, shoose the best for your application.
With this approach, it's not even important what instrument is connected as long as data is written in a specified format into a known QUEUE. I have also developed systems where I can transparently (almost) drop in VI Templates for instruments with similar functionality (output data) from different suppliers.
I would post an example, but the time it would take me to clean it up is too large. Sorry. If you have any further questions, don't hesitate to ask further questions.
Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)

Similar Messages

Maybe you are looking for

  • After HP support replaced Motherboard, the window 2008 r was running okay after few days I got a Black Screen stating windows is not genuine

    After HP replaced the motherboard, and few days later I got a black desktop and windows not genuine afterwards. Any suggestion what I should do. I tried to use Microsoft support website on the server, and it will not let me proceed to any of their si

  • Straight Line Interpreter

    Hi All I am doing exercise of book "Modern Compiler Implementation in JAVA" by Andrew Appel. It is first exercise and have to develop two functions maxargs to find the maximum number of arguments for print statements ..I am not able to understand the

  • Lazy loading differences Toplink vs. Hibernate - plz. explain

    I'm in the process of evaluating both Toplink and hibernate as potential ORM framework to use for a project I'm currently involved in. My question is about how Toplink resolves lazily loaded associations. In hibernate I have to perform a query inside

  • How to replace image?

    Hi people out there, me facing a problem on replacing the image. I have a array of images. When i double clicked any of the image, there will be a file chooser appeared. This allows the user to choose another picture to replace the current image. So

  • Problem with tiger to snow leopard upgrade

    Hi, I wanted to upgrade from Tiger to Snow Leopard and bought a retail 10.6 Snow Leopard install disc MC223Z/A. on the box. 2Z691-6428-A on the disc. It would not let me install it unless I erased and partitioned the destination disc thus losing my s