LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting odd results

Solved!
Go to solution

Hello. I have LV2014, using a USB-6002 DAQ, password to my attached Vi is "2015". The Vi runs the way I need it to, although I am sure I probably could have programmed it better. The issue I have is with my voltage in from my Marchand power amp. The power amp is driven by the USB-6002 and then provides a 0-2mV signal back to the USB-6002, which is then scaled to represent 0-200VDC. On the main Vi "Piezoelectric displacement test v.2 launch", front panel, "Program Run" tab, under the communications headline are my coms locations. The issue I am having is with the one labeled "Volts from Amplifier". When the Vi runs correctly, under the "Voltage" column of the array to the right of the coms section is reading what is coming from the Marchand, after it is scaled. I am having trouble getting this repeat voltages. Last week Friday it ran fine. No changes were made to the Vi, over the weekend. Today, my values are not repeating and not scaled properly. I make changes to the values for "calibration" on the tab labeled "Alarms/Errors", from the front panel. The array should be reading 0,20,40,60,80,........200. The scaling takes place on the block diagram, in case named "Test in progress". It is labeled "Current Test Voltage", as an output after scaling. In the folder with my main Vi is my sub-Vi's that I use here. I have put an O-scope on the monitor voltage from the Marchand Amplifier and it is reading correctly. I put an analog meter on the 0-200VDC output from the Amplifier and it is correct (0,20,40,60,80,.......200). So, the only place it could be is in my Vi but I have tried re-writing everything pertaining to that scaled voltage value but it changed nothing. To rule out the USB-6002 I moved it to another channel, same problem. I realize my "Test in Progress" case has repeat code but nothing else I tried, worked. I really have run into a wall here and don't know what else to try. I tried another piezoelectric device to test but it had no affect either. I would appreciate if you would please see if there is something I missing as well as welcome any feedback you may have about my project in general, as this is my first Vi. Most pressing however, is that I can't get a steady, repeatable value.

Thank you 

0 Kudos
Message 1 of 11
(3,670 Views)

This is a bit difficult to debug without being there with you and your device.

 

Have you tried probing along all of the Volts From Amplifier input wires to see where it starts to be values that you don't expect? Have you tried probing right after the MyDAQ Write VIs to make sure the values being read are correct?

You say you're not seeing what you expect, so what are you seeing (what values)?

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 2 of 11
(3,659 Views)

@James.M wrote:

This is a bit difficult to debug without being there with you and your device.

 

Have you tried probing along all of the Volts From Amplifier input wires to see where it starts to be values that you don't expect? Have you tried probing right after the MyDAQ Write VIs to make sure the values being read are correct?


Have you tried probing along all of the Volts From Amplifier input wires to see where it starts to be values that you don't expect? Yes Sir, and I get the same results that are displayed at the end of the test.

 

 

 Have you tried probing right after the MyDAQ Write VIs to make sure the values being read are correct?  Yes, I get the same value, just not scaled. The problem seems to be coming from my sub Vi. With that in mind, I took all that out of the Vi, tested it on a temporary Vi, and it went as desired. This is very confusing to me.

0 Kudos
Message 3 of 11
(3,648 Views)

@ceilingwalker wrote:
Yes, I get the same value, just not scaled. The problem seems to be coming from my sub Vi. With that in mind, I took all that out of the Vi, tested it on a temporary Vi, and it went as desired. This is very confusing to me.

 

What subVI? The MyDAQ subVIs? Those are very simple DAQmx subVIs so those shouldn't affect you data.

 

So what values are you seeing when they're not what you want?

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 4 of 11
(3,645 Views)

@James.M wrote:

@ceilingwalker wrote:
Yes, I get the same value, just not scaled. The problem seems to be coming from my sub Vi. With that in mind, I took all that out of the Vi, tested it on a temporary Vi, and it went as desired. This is very confusing to me.

 

What subVI? The MyDAQ subVIs? Those are very simple DAQmx subVIs so those shouldn't affect you data.

 

So what values are you seeing when they're not what you want?


The last one I ran went 4.982, 25.02, 45.32, 65.08, 85.12, 104.98. So I adjusted my offset by subtracting 5 from the multiplier. It then swung my numbers way below, by almost 5. Then I cut that change in half (2.5) and it put most of my numbers over, the target voltages, and some of them under. (-0.05, 20.75, 41.32, 60.93, 81.24, 101.44, 119.75, 139.87, 141.62, 159.92, 181.15 and 201.34). To me these numbers make no sense, they are scattered about. When I used a simple DAQ-Write and DAQ-Read on a separate Vi, it gives me the values I expect. I know my sub-Vi's open and close these DAQ Vi's frequently, do you think that might be an issue?

0 Kudos
Message 5 of 11
(3,606 Views)

ceilingwalker wrote:


The last one I ran went 4.982, 25.02, 45.32, 65.08, 85.12, 104.98. So I adjusted my offset by subtracting 5 from the multiplier. It then swung my numbers way below, by almost 5. Then I cut that change in half (2.5) and it put most of my numbers over, the target voltages, and some of them under. (-0.05, 20.75, 41.32, 60.93, 81.24, 101.44, 119.75, 139.87, 141.62, 159.92, 181.15 and 201.34). To me these numbers make no sense, they are scattered about. When I used a simple DAQ-Write and DAQ-Read on a separate Vi, it gives me the values I expect. I know my sub-Vi's open and close these DAQ Vi's frequently, do you think that might be an issue?


 

From looking at your VI, the only things that are altering your values are those calibration controls (multipliers). Also, your first value should always be zero, right? it's weird that it would come out at as ~5. Are your values coming in all over the place from run to run (if you don't change anything)?

 

You could be trying to read too soon after the Write value was sent, although 10 seconds seems like a long time... Is that Delay Time still set at 10 seconds?

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 6 of 11
(3,600 Views)

@James.M wrote:

@ceilingwalker wrote:


The last one I ran went 4.982, 25.02, 45.32, 65.08, 85.12, 104.98. So I adjusted my offset by subtracting 5 from the multiplier. It then swung my numbers way below, by almost 5. Then I cut that change in half (2.5) and it put most of my numbers over, the target voltages, and some of them under. (-0.05, 20.75, 41.32, 60.93, 81.24, 101.44, 119.75, 139.87, 141.62, 159.92, 181.15 and 201.34). To me these numbers make no sense, they are scattered about. When I used a simple DAQ-Write and DAQ-Read on a separate Vi, it gives me the values I expect. I know my sub-Vi's open and close these DAQ Vi's frequently, do you think that might be an issue?


 

From looking at your VI, the only things that are altering your values are those calibration controls (multipliers). Also, your first value should always be zero, right? it's weird that it would come out at as ~5. Are your values coming in all over the place from run to run (if you don't change anything)?

 

You could be trying to read too soon after the Write value was sent, although 10 seconds seems like a long time... Is that Delay Time still set at 10 seconds?


From looking at your VI, the only things that are altering your values are those calibration controls (multipliers). Also, your first value should always be zero, right? it's weird that it would come out at as ~5. Are your values coming in all over the place from run to run (if you don't change anything)? Yes, it is supposed to be "0" by design. What it does is create a loop that ramps up, then back down.

 

You could be trying to read too soon after the Write value was sent, although 10 seconds seems like a long time... Is that Delay Time still set at 10 seconds? Yes, it is in seconds.

 

0 Kudos
Message 7 of 11
(3,593 Views)
Solution
Accepted by topic author ceilingwalker

Right, so it's meant to ramp up from 0 to 5.5 in increments of 0.5, which is why you run 11 iterations with each loop. So logically, you should be sending out 0, 0.5, 1, ... 5.5 and receiving back the same values. If you're not seeing zero as the first value, then I believe that means you're either sending the wrong value out, or you're reading at the wrong time before it's had time to settle. Try messing with your timing a bit and confirming that the outputs are what they should be.

 

If it worked to use simple DAQmx VIs instead of those subVI's why don't you just do this? Your subVI's are waaaaay overkill in terms of starting and stopping the tasks. You can just Start each task once at the beginning and Stop at the end. Otherwise I don't know what's wrong with your current setup, which usually points to timing issues.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 8 of 11
(3,542 Views)

@James.M wrote:

Right, so it's meant to ramp up from 0 to 5.5 in increments of 0.5, which is why you run 11 iterations with each loop. So logically, you should be sending out 0, 0.5, 1, ... 5.5 and receiving back the same values. If you're not seeing zero as the first value, then I believe that means you're either sending the wrong value out, or you're reading at the wrong time before it's had time to settle. Try messing with your timing a bit and confirming that the outputs are what they should be.

 

If it worked to use simple DAQmx VIs instead of those subVI's why don't you just do this? Your subVI's are waaaaay overkill in terms of starting and stopping the tasks. You can just Start each task once at the beginning and Stop at the end. Otherwise I don't know what's wrong with your current setup, which usually points to timing issues.


Try messing with your timing a bit and confirming that the outputs are what they should be. Did that yesterday, had no affect. The timer is normally set to 1-second. I set it to 10-seconds.

 

If it worked to use simple DAQmx VIs instead of those subVI's why don't you just do this?  When I created this project I thought the other Vi's for opening, starting, stopping, and clearing, were all required for it to function properly. I am going to change that on the Vi. There is a lot of duplicate code but I couldn't find another way to get it to work for me. My sub-Vi's alone, are quite time consuming.

 

It's a crappy program and as I gain experience using LabVIEW, it will get better. Thank you for your help.

0 Kudos
Message 9 of 11
(3,444 Views)

Good luck, let us know if you have any problems once you've adapted it to utilize the basic DAQmx VIs instead of your MyDAQ Vis.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 10 of 11
(3,422 Views)