LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Time Division Multiplexing and Processing Different Loops at the same time

        Hi, I am new in Labview so you may find my questions too silly, sorry about that:)

I want to design an interface to control the test&measurement devices remotely. I have two desks and there are several devices on these desks. The real problem is to use two different devices at the same time. To do this I heard that I can use time division multiplexing. But I couldn't find enough information about it in Labview. Another advice I heard was to use a matrice and hold the on/off state of the devices in this matrice. 

Where should I start the design to create such a system? Do you have any advices? Thank you in advance.

My basic GUI is attached.

0 Kudos
Message 1 of 10
(3,567 Views)

You did not give us several important pieces of information.

 

How will the computer communicate with the devices? Do you have device drivers for all of the devices?

 

What is involved in "using two different devices at the same time"? Does this include user interation with the devices or automated actvity? 

 

How much information will be sent to and from the devices? How fast will it be sent? How often does data need to be displayed to the user or saved to a file?

 

Is this part of an automatic control system?  Do the different devices interact with each other?  Will you ever need to use more than two devices simultaneously?

 

Lynn

0 Kudos
Message 2 of 10
(3,516 Views)
In general you can interact with multiple devices at the same time -- but there are limitations. For instance, if the devices share a common communications resource -- like a single GPIB port or a multipoint RS485 connection. In those cases you need to finish the interaction with one device before you start interacting with another device.

An interesting special case is Ethernet. Although you may only have one physical port on your computer, the underlying protocols were designed to allow for multiple simultaneous connections.

Beyond this, it sounds like you are mixing a lot of different things together and I would echo Lynn's questions. To give detail responses, we need detailed input.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 10
(3,502 Views)

         You're right, I realized that I didn't provide enough information. I am planning to communicate with the devices using GPIB and LXI. Device drivers are actually not important for this step of the project because now I am only trying to create a frame. Actually my problem is the parallel execution. To explain my question clearly, I prepared a little example. A matrice is used to hold the on/off states of the loops. So I want the counters to count simultaneously when I press the buttons.  This is a model of my case actually. I hope this is clearer. Any help would be appreciated.

0 Kudos
Message 4 of 10
(3,496 Views)

As Mike pointed out you cannot communicate in parallel on the GPIB bus - unless you have separate buses for each instrument - and that defeats the purpose of a bus. I am not sure about LXI.

 

With regard to your VI:

1. Do not use global variables to pass your data around.

2. You should use the Array data type, not the Matrix data type. The Matrix data type in LabVIEW should only be used for matrix mathematical operations (linear algebra) which cannot be easily performed on the array data type. You have many more tools in LV to work with arrays.

3. The Event structure needs to be in a parallel loop. This is basic data flow. If you do not understand this concept, get some training, either though the online tutorials or through a class.

4. Use Value Changed events and place the button terminals inside the event case for that control.

5. The parallel loops need to have a Wait or some other function which causes a delay. Otherwise, the first one to start executing could consume all available processor resources. These are called "greedy loops." 

6. Use integer data types for case structure selector inputs. Floating point values are coerced to integers at the inputs. If the values resulted from calculations, unexpected rounding effects may occur, resulting in the wrong case being selected. In some cases using type defed enums may be even better. The underlying data is integer and the enum item names show up in the case selector labels, helping to document what the case does or why it was selected.

7. Remove the timeout case from the event structure since it never executes. Also avoid Use Default if Unwired on the terminal with your matrix (array) data. You never have a situation where an empty array is appropriate.

 

Before going any further with the program questions, you need to carefully define your requirements.  How many instruments will you have? How many can be active at one time? What kinds of communication between the program and the instruments is required? This includes commands to the instrument, data returned from the instrument, error handling, and timing requirements. What will be done with the data? Display, save to file, use to automatically control another device? What safety requirements or constraints need to be met? Once you have a good requirements document, then you can begin to determine what kind of program architecture is best suited to meet the needs.

 

I suspect that you may be making some things much more complicated than they need to be while ignoring other important issues.

 

Lynn

0 Kudos
Message 5 of 10
(3,468 Views)

       Hi again,

I already have seperate buses for each instrument, I can connect to the instruments using Agilent or NI Max. The problem is to prepare a kind of interface as I mentioned. The user should be able to adjust variables of the instruments from his computer and display the waves(if the instrument is an oscilloscope). User should be able to manage two different instruments at the same time. I don't need more, 2 is enough.  I know that I should have instrument drivers for this. However I am not interested in them at this stage of the project since I am now only trying to create a frame. Here is a simple user experience for the program I am trying to create: User launches the program and sees 8 different instruments. Clicks one of them and he finds the controls and display screen of the instrument in a new window. Then he clicks another instrument and uses that instrument too without exiting the other instrument's window.

To create such a frame, I planned to hold the on/off states of the devices in an array. So I can know which loops to execute and don't have to control all the loops. But I appreciate all advices.

 

 

Here are the answers for your questions:

I am only sending the data of the controlling the test devices: voltage level, range selection, trigger, ovp selection...

I am receiving the displaying data: waveform charts, actual voltage level, actual current level...

I am not planning to use any data coming from any instrument to control any other device.

I have to admit that I don't understand what you mean by safety requirements.

Thank you for your time.

0 Kudos
Message 6 of 10
(3,438 Views)
You really have a dedicated gpib controller for each instrument? And a separate nic? That is what separate buses would be.

What is a frame? A window, sub-panel, block diagram?

You can launch a subVI asynchronously and have each instrument in a new window. That would not require parallel loops. I also think your concept is overly complicated.
0 Kudos
Message 7 of 10
(3,422 Views)

I agree with Dennis that launching a VI for each instrument with its own window seems best if you really have spearate buses.

 

The safety question related to a situation, for example, where a power supply is controlled by the software and could be left with the output energized at a high voltage if the software failed. If the supply powered a large motor and feedback was used to limit the motor speed, leaving the supply energized without the feedback could result in the motor running to maximum speed and being destroyed. When situations like this exist, special precautions must be taken to assure safety.

 

Lynn

 

0 Kudos
Message 8 of 10
(3,404 Views)

1. I don't know if I confused you but I am not interested in safety requirements too, at least at this stage.

2. I have a table where are 8 devices and the GPIB devices are connected. There are also some LXI devices. Here is my simple block diagram:

My PC --- Router --- Switch --- GPIB --- GPIB devices

                                           --- Ethernet --- LXI devices

 

3. I mean the framework, the skeleton by the word "frame". 

4. The devices should have instrument drivers which could be used as subVI's. These subVI's should be in separate loops since I want the subVI's to display changes automaticly, whenever the user changed some control adjustments of the device. I don't have to press the "run" button anytime I changed something on the window.

5. I thought that if I know whether a subVI(a device) is working or not, I start that loop or not. Otherwise I have to start all the loops of the subVI. So I planned to hold the on/off states of the devices. I don't know it is the proper way of doing it or not.

Thank you for your time.

0 Kudos
Message 9 of 10
(3,375 Views)
No, it's not the proper way. You said you wanted the front panels of the instruments visible on separate Windows and there is no need to have multiple loops. The loop would be inside the subVI. The subVI would have an event structure that would handle control changes and call particular functions inside the driver.
0 Kudos
Message 10 of 10
(3,371 Views)