Jump to content

As of July 17, 2015, the LabJack forums here at forums.labjack.com are shut down. New registrations, topics, and replies are disabled. All forums are in a read-only state for archive purposes.

Please visit our current forums at labjack.com/forums to view and make new posts. To post on the current forums, use your labjack.com login account. Your old LabJack forums login credentials have been retired. There are no longer separate logins for labjack.com and LabJack forums.


Photo

False ground reading.


  • Please log in to reply
7 replies to this topic

#1 Rogerio

Rogerio
  • Members
  • 9 posts

Posted 23 September 2012 - 09:45 PM

Hello. I am using VB 2010 express. When connecting AIN0 to ground (on the U6) I sometimes get 0 volts and sometimes 5 volts. This is the code I'm using: Try u6 = New U6(LJUD.CONNECTION.USB, "0", True) LJUD.eAIN(u6.ljhandle, 0, 199, dblValue, LJUD.RANGES.BIP10V, 0, 0, 0) Label0.Text = dblValue Catch ex As LabJackUDException showErrorMessage(ex) End Try If I do 10 quick reads (using a button) I get at least three 5 volt readings. This only happens with ground, VS reads 5v always, and connected to DAC0 it reads correctly. Any reason or ideas of what is going on? Thanks!

#2 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 24 September 2012 - 09:35 AM

Confirm that you don't see the problem in LJLogUD or the test panel in LJControlPanel. All I can think is that there must be something strange in your code? Perhaps zip up an example project and attach it for us to try ourselves.

#3 Rogerio

Rogerio
  • Members
  • 9 posts

Posted 24 September 2012 - 01:40 PM

Confirm that you don't see the problem in LJLogUD or the test panel in LJControlPanel.

All I can think is that there must be something strange in your code? Perhaps zip up an example project and attach it for us to try ourselves.


Yes, it works OK with LJControlPanel.

There isnīt much code, 1 button, 1 label.

************************************************************
Imports LabJack.LabJackUD
Imports System.Threading.Thread

Public Class Form1

Dim u6 As U6
Dim dblValue As Double

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Try
u6 = New U6(LJUD.CONNECTION.USB, "0", True)
Catch ex As LabJackUDException
showErrorMessage(ex)
End Try

End Sub

Private Sub showErrorMessage(ByVal err As LabJackUDException)

MsgBox("Error #" & Str$(err.LJUDError))

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Try
LJUD.eAIN(u6.ljhandle, 0, 199, dblValue, LJUD.RANGES.BIP10V, 0, 0, 0)
Label0.Text = dblValue
Catch ex As LabJackUDException
showErrorMessage(ex)
End Try

End Sub

End Class

************************************************************

I'm attaching a RAR with the whole project.

Now it's showing numbers similar to this -2.93961567 and -0.00010846 intermitently (with button clicks).

Attached Files



#4 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 24 September 2012 - 02:49 PM

Yes, it works OK with LJControlPanel.

There isnīt much code, 1 button, 1 label.

************************************************************
Imports LabJack.LabJackUD
Imports System.Threading.Thread

Public Class Form1

Dim u6 As U6
Dim dblValue As Double

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Try
u6 = New U6(LJUD.CONNECTION.USB, "0", True)
Catch ex As LabJackUDException
showErrorMessage(ex)
End Try

End Sub

Private Sub showErrorMessage(ByVal err As LabJackUDException)

MsgBox("Error #" & Str$(err.LJUDError))

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Try
LJUD.eAIN(u6.ljhandle, 0, 199, dblValue, LJUD.RANGES.BIP10V, 0, 0, 0)
Label0.Text = dblValue
Catch ex As LabJackUDException
showErrorMessage(ex)
End Try

End Sub

End Class

************************************************************

I'm attaching a RAR with the whole project.

Now it's showing numbers similar to this -2.93961567 and -0.00010846 intermitently (with button clicks).


I ran your executable from the RAR file and couldn't get the same thing to happen. When I jumpered AIN0 to GND I was always geting a value right near 0.0. The bouncing like that almost seems like it could be caused by a bad connection. Have you tried screwing the wire in with a different GND terminal?

#5 Rogerio

Rogerio
  • Members
  • 9 posts

Posted 24 September 2012 - 06:39 PM

I ran your executable from the RAR file and couldn't get the same thing to happen. When I jumpered AIN0 to GND I was always geting a value right near 0.0. The bouncing like that almost seems like it could be caused by a bad connection. Have you tried screwing the wire in with a different GND terminal?


Tried all the GND terminals as well as SGND with the same results, readings go from -2.9xxxxx to 4.9xxxx, sometimes it does read 0.000xxx.

Tried it through an active hub, a pasive hub and directly to the USB port on a laptop to see if it was a general grounding problem. Is there something on the hardware side that could cause this?
Itīs strange as GND seems to work ok if I use it with a pressure transducer with 0-10v output, but it just seems to float if I use it alone.

#6 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 25 September 2012 - 08:02 AM

You said you don't see a problem when you use the test panel in LJCP, so that suggests there is not a hardware issue and it is something unique to your VB program. Try doing channel 15 (internal ground) instead. Try using any different examples that read an analog input. What driver version and firmware version are you using? We will have the person who did the test here compare.

#7 Rogerio

Rogerio
  • Members
  • 9 posts

Posted 25 September 2012 - 10:29 AM

You said you don't see a problem when you use the test panel in LJCP, so that suggests there is not a hardware issue and it is something unique to your VB program.

Try doing channel 15 (internal ground) instead.

Try using any different examples that read an analog input.

What driver version and firmware version are you using? We will have the person who did the test here compare.


Ok, I found out what the "problem" was. It's just a display thing. What I thought where -2.xxxxx or 4.xxxx volt readings where actualy something like this -2.93961562789491E-05! This does not display on the label completly for some reason, the label is big enough. Anyway I can get around this if I format all variables before displaying (which I should have done before anyway).

So the U6 is working great! It's just me and maybe VB that are at fault :-)

Thank you for your support, great service!

#8 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 25 September 2012 - 12:08 PM

Ok, I found out what the "problem" was. It's just a display thing. What I thought where -2.xxxxx or 4.xxxx volt readings where actualy something like this -2.93961562789491E-05! This does not display on the label completly for some reason, the label is big enough. Anyway I can get around this if I format all variables before displaying (which I should have done before anyway).

So the U6 is working great! It's just me and maybe VB that are at fault :-)

Thank you for your support, great service!


That sounds like a fix we can make in the example so future people do not run into the same thing. Thanks for bringing it to our attention.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users