LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Clock reset ??

@Dennis

 

The total number of samples is set-up before hand ...for instance if I have 1000 mV to scan at 100 mV/s from 0 V to 1000 mV it will take 10 s to complete the scan. The total number of data points depends on the resolution of the instrument.  If the instrument is able to acquire a data point for every mV then 1000 data points will be acquired in 10s. e.t.c

 

will post my terrible looking code tomorrow.

 

regards

 

B

 

0 Kudos
Message 11 of 16
(938 Views)

Dear All

 

Please find attcahed my terrible code .....it works fine ...except for the timing problem tha I am having.

 

The timing of the loop depends on how fast I enter data into each sequential frame.

 

Regards

 

0 Kudos
Message 12 of 16
(920 Views)

barrys wrote:

Please find attcahed my terrible code .....it works fine ...except for the timing problem tha I am having.


You have a weird definition of "fine". I don't have your device and your subVIs are missing so I cannot really troubleshoot, still....

 

  1. What is the point of the "ms timer value" indicator in the first frame? It will never show anything useful.
  2. Are you really trying to run a timed loop at a dt=10ms, but include file writing and xy graphing inside it for each iteration?
  3. Is is a really bad idea to design the program is a way that the operator needs to enter things in a strict order and can never go back to an earlier step. Why can't he enter everything at leasure and press GO, at which time all the commands are sent in the right order and the acq loop started? What that huge sequence of while loops? One loop should be enough and the sequence should not even be needed.
  4. You only plot one point on the xy graph because you clear the data for each call. I don't uderstand your "down to plot" control. Makes little sense.
  5. At one point you have a 2D array. What possessed you to convert it to a matrix datatype?
  6. None of your polling loops have a wait. Each doing the same thing over and over as fast as possible, waiting for inputs while consuming 100% CPU (unless there is a wait in the subVI).
  7. You VI has absolutely no error handling. Why not?

Do you have a list of the instrument commands?

0 Kudos
Message 13 of 16
(914 Views)

Dear altenbach

 

1. The 'ms timer' was there for no reason ...I just wanted to see what the ms value was.

2. The dt value changes depending on scan rate - the loop writes x and y values at each loop , as well as plots the x,y value on the graph.

3. You are right about the strict order ...but in this case it doesn't really matter - this is not important and although 'not elegant' is not he poblem here imho.

4. The down to plot toggle alows you to plot one point each loop and keep the previous points on the grph at the same time . If the toggle was up , it would as you suggest, plot one point and clear each time.

5. I have x,y,z values coming off the instrument seperated by a comma, i just chopped the values up and then recombined the values required y,z for instance to plo to graph and into file. Again not elegant but works.

6 **** This could be what the problem is ........could you further elaborate what you mean with regards polling loop ?? 

7. I am new to Labview and don't really understand error handling very well. There is not much that could go wrong really ...just giving the instrument a series of commands and collcting data.

 

 

Regards

 

B

 

0 Kudos
Message 14 of 16
(907 Views)

Dear All

 

The source of my problem , as I have just found out is that the timed loop is out . This causes my GPIB card to time-out...if I set the timed loop timing to correspond to my 'scan rate' , I can adjust the period of the loop and the time for complete iteration in order to keep the "expected time - actual time" down to below the value that my card times out at. 

 

A different way of answering my question would be given a single input (i.e: scan rate) , how would one go about dynamically adjusting the difference between two numbers (expected-actual) to keep the difference within a certain range ?? 

 

Regards

 

B

 

 

0 Kudos
Message 15 of 16
(895 Views)

Hi,

the code looks much better if you press Control-U 🙂

Anyway, I still don't think I get your problem. Could you describe in more detail what do you want to do now?

 

Ad 6.

If you don't put a "Wait" or "Wait until next ms multiple" function, the loops will run as fast as possible.

 

Best regards,

0 Kudos
Message 16 of 16
(860 Views)