LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get a constant value/graph for my Ampere/Voltage over time?

Solved!
Go to solution

Hey there!

I am kind of stuck here and hoped that the community can maybe help me. So, for a project at my uni, i would like to get a 3-D measurement for a magnetic field using 4 sensors. The magnetic field itself is being produced by a coil magnet i build myself. To measure the current i build in a shunt resistor. Furthermore i want to measure the Voltage/Ampere from my power supply.

My problems are:

 

  1. The program doesn´t display a constant value for my Ampere/Voltage. Instead i see always small "chunks" which is not what i want. I am not sure now if it is because my loop is taking too long or if its a different issue.
  2. The first value of my string is missing a part in the beginning, thats why there is a spike in the first graph. I get as first value for example ".13" or "13" but it is actually "0.13"

 

Here is a screenshot of my program and the file is also attached.

Any help would be much appreciated!

 

Program.PNGScreenshot (220).png

 

 

0 Kudos
Message 1 of 6
(1,912 Views)

Wow that is sensory overload in more ways than one ; ). It's probably not the best idea to have all that in the same loop, that will cause problems and is why you are not getting 'constant' values as you say. Try making a loop for each I/O that you are doing and test them individually. After that you might have a couple loops running in parallel to handle the I/O, In the current configuration you have to wait for everything to finish in the main loop before looping, which is bad. 

 

Also, Sub VIs can help you break up functional blocks of code into better easier to manage code. If each small piece of code works you can put them together to make working larger program that is easier to debug. 

 

Also, wires should only go left to right, if they are going 'back' its a bad sign. 

______________________________________________________________
Have a pleasant day and be sure to learn Python for success and prosperity.
Message 2 of 6
(1,891 Views)

Hey 🙂

first of all thank you for your help🙏

 

So i extracted now only the part from my loop that i want to improve/speed up, but i have the same result...

kind of feel lost here😩

 

Screenshot (18).png

 

Screenshot (16).png

 

Can it have something to do with the settings i have in my DAQ Assistant?

 

Screenshot (19).png

0 Kudos
Message 3 of 6
(1,830 Views)

if you feed small parts of wfrms into a waveform-chart it will regard the timestamp and display it accordingly, so that's what so see shunks of data with a pause inbetween .  seems that you don't read continiously.

 

if you don't care about the timing and only want to show the incomming data as a continious stream just use the Y-data of the wfrm and wire it to the chart.

 

real the LabVIEW help about chart (I think it's explaned there ...somewhere)

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 4 of 6
(1,821 Views)
Solution
Accepted by topic author Jugo

@Jugo wrote:

Hey 🙂

first of all thank you for your help🙏

 

So i extracted now only the part from my loop that i want to improve/speed up, but i have the same result...

kind of feel lost here😩

 

Screenshot (18).png

 

Screenshot (16).png

 

Can it have something to do with the settings i have in my DAQ Assistant?

 

Screenshot (19).png


As with many things in LabVIEW there is an awesome example of how to set up a voltage reading. From any VI click on Help/Find Examples then use the explorer to navigate to the desired example, For this one I searched 'voltage' and you get many examples, see attached. 

 

Jay14159265_0-1655221083162.png

 

 

It shows you how to programatically set up a voltage input then read it. Setting things up via DAQ Assistant works but you might find it more useful to set things up directly in code using the DAQmx VIs which are quite handy. 

 

______________________________________________________________
Have a pleasant day and be sure to learn Python for success and prosperity.
Message 5 of 6
(1,816 Views)

Hey😊

the example finder helped me a lot! And so far i get a constant value for my voltage so that is awesome!! I just have to see what´s going to happen once i put it into my "big" program. But so far it looks good! Thank you so so  much for your help i really appreciate it.

 

I just wonder what settings i messed up with the DAQ Assistant.. Because it should also be possible that way, right?..

 

So the first of my 2 problems is solved which is great.

 

Does anyone have an idea, what causes the values of my sensor to act so weirdly?... Is it the size of the loop? What a mystery this is..

 

 

0 Kudos
Message 6 of 6
(1,762 Views)