LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem of using timed loop with keithley 2000 and 2700 DMM

I have made a subVI to read the DMM using GPIB plug and play driver. This subVI work satisfactorily. But when this subVI was put inside timed loop  the kiethley DMM got hanged up. It carries out multiple read. I have tried different settings of timed loop also. This problem only appears during reading of keithley DMM. This is not a problem with Fulke and Agilent make DMM. Kindly help me for this problem.

0 Kudos
Message 1 of 7
(2,836 Views)

The GPIB plug and play driver: where do they come from?

 

You have to know that a timed loop executes the code in it in a single thread. I assume that the plug and play driver must split its execution in several threads which is suppressed by the timed loop. Please note that this is an assumption.

 

But maybe it is more of interest:

Why do you use the timed loop at all? Timed loops are primary for RT systems. And since GPIB is not deterministic, the timed loop is definetly the last construct i would choose to use GPIB in it......

 

hope this helps,

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 7
(2,821 Views)

@Norbert B wrote:

 

You have to know that a timed loop executes the code in it in a single thread. I assume that the plug and play driver must split its execution in several threads which is suppressed by the timed loop. Please note that this is an assumption.

 


Norbert, your assumption may be in error.  Here is some code that has two separate loops running in parallel.  I would think that each loop runs in its own thread.  The code runs fine without any problems.

 

19529i8B5102196E028645

 

Monika:  Can you attach your code, or the part that is giving problems?

- tbob

Inventor of the WORM Global
0 Kudos
Message 3 of 7
(2,813 Views)

I am sorry, tbob, but your code proves nothing.

In fact, i am not assuming that timed structures run in a single thread, i know it 🙂

 

"Each Timed Loop represents a unique thread, and you can use the Processor Assignment section of the Configure Timed Loop dialog box to designate the thread to run only on a specific processor core, as illustrated in Figure 3 below." (taken from here)

 

All features the timed structures supply are possible because the structure handles its content in a single thread. Otherwise, the overhead would be so gigantic that you wouldn't ever use timed structures..........

 

just my 5 cents,

Norbert

 

PS: If there has been a change in this in one of the past LV versions, there is at least no documentation available about this......and i doubt it seriously.

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 7
(2,799 Views)

I believe you Norbert, but I'm confused.  I thought that if two loops ran in parallel, that each one had its own thread.  Is this not true if they are by themselves, without any timed loop?  Now if the two parallel loops are put in a timed loop, you say the timed loop runs in one thread.  But what about the code inside the timed loop, like the two parallel loops.  Aren't they in separate threads?  Just trying to get clarification.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 5 of 7
(2,785 Views)

tbob,

 

both loops inside the timed structure (so also true for the timed sequence) will be executed in a single thread. If you place those loops into a subvi (without any timed structure) and configure the vi settings to Preferred Execution System to User Interface, both loops will also run in a single thread: The UI thread. So you see that parallel loops do not necessarily create dedicated threads.

In fact, a mechanism called "clumping" is taking place to split the codes execution into different threads. In the example of the parallel loops (no timed loop around), it is most likely that two threads/clumps are created; but we cannot tell for sure. Also note that different clumps can be attached to the same thread, so "clump" is not a synonym for "thread"!

Afaik, clumping is suppressed in timed structures which will result in a single thread handling the timed structure.

 

hope this helps,

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 6 of 7
(2,774 Views)

Thank you for the explanation.  I didn't know about clumps.  I have always thought that parallel execution meant different threads.  It's amazing that after using Labview for over 10 years, I am still learning new things almost daily.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 7 of 7
(2,765 Views)