LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reading data takes 2 seconds

Solved!
Go to solution

Hi there,

 

I have a code which contains three while loops. The first loop is controlling a DAQ device which provides a DC voltage (changing in steps 0.05 or 0.02)

 to run an electromagnet for generating a field sweeping from -ve to +ve. When this loop finishes the second loop starts doing the opposite procedure and when it finishes the whole code stops. The third loop is for taking the measurement as it takes the field reading through a gaussmeter and also a

voltage of the tested sample (no relation with the DAQ voltage) from a keithley. This loop starts when the first loop starts and stops when the second loop stops.

The problem that I have is that I have to put a time delay (2.5 sec) in the first and second loops to allow a syncornization with the third loop that is taking the measurement. Without doing this, the third loop will have to skip some points as the first loop and then the second are faster. The kiethely is connected via GBIP while the gaussmeter is connected through RS232. I really appreciate any help in getting this sorted.

 

Many thanks,

 

Hadiq

Islam means peace
0 Kudos
Message 1 of 28
(3,742 Views)

we'll need to see some code.


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 28
(3,731 Views)

I'll try to attach the code but the problem when I try to save it in flash memory device there is always missed components.

Islam means peace
0 Kudos
Message 3 of 28
(3,724 Views)

While multiple loop programs are common and often the best way to do things, I suspect that one loop light be enough for your program.  Make it a state machine. While running, the states would be Get Next Current Value, Write Current to Magnet, Wait (2.5 s), Read Gaussmeter, Read Keithley, repeat until all values checked.  Keep the Current value in a shift register. After each iteration increment it until Maximum, then Decrement until Minimum.  Use a boolean in a shift register to keep track of the direction.

 

Hint: Try Save as... >> Duplicate Hierarchy to a Different Location.  This should save the main VI and all subVIs except those in vi.lib.

 

Lynn

 

 

0 Kudos
Message 4 of 28
(3,703 Views)

Thank you for replying. I attached the code. There is still missing components related to the tesla-gauss meter but apart from that the code is fine.

Islam means peace
0 Kudos
Message 5 of 28
(3,685 Views)

I think you need a bit more familiaraity with the basics of LabVIEW.  Have you looked at the Examples and tutorials that ship with every version?


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 28
(3,665 Views)

Hi Jeff,

 

Have you figured out what is the problem in the code provided?

Islam means peace
0 Kudos
Message 7 of 28
(3,659 Views)

to be blunt the list is exhaustive: I did suggest some tutorials that would benefit new LabVIEW programmers.

 

without the driver's (or the hardware) I can make some educated guesses at places to look but you'll need to do some digging to see if I'm right.

 

In order:

1) hit CTL+U  the code is a mess and even CTL+U helps.

 

2) I'm betting that the FWB6010 driver is not communicating correctly.  the error out of the function is disconnected this looks like a hack to ignore errors from improper set-up or configuration.  Create a test vi for that device and see if you have something wrong.  as an example of a test vi (that you can use to encapsulate the device functions look at the attached module which drives a 34401A.

 

3) if the FWB6010 is working right get that error chain re-connected and use exactly 1 in the "third loop"  then delete the sequence structure- the error chain will enforce proper flow. 


"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 28
(3,636 Views)

Thank you Jeff for the informative reply!

 

The FWB6010 vi is working fine and communicating with the device. The problem I think is either in the loop or in the case structure inside the third loop as the

two reading from FWB6010 and keithly are suffering a delay which I don't know how to solve. Therefore I am hoping that your third suggestion will solve this.

 

Many thanks 

Islam means peace
0 Kudos
Message 9 of 28
(3,627 Views)

Hi Jeff,

 

I tried to apply the suggestions you made last night but I'm afraid that I need more help. I removed the sequence structure but there was no difference. I also connected the error chain output to FBW6010 outside the loop that does not help. You asked me to put all of error in and out in single chain but I could not do that as I get disconnected wires when I do that. As you suspect that the FBW6010 link may not connected properly, I attached the original

code and would like you to show me how I can connect it in a while loop so that I can integrate it in my code later.

 

Many thanks for your help  

Islam means peace
0 Kudos
Message 10 of 28
(3,601 Views)