LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Weird Spikes in Waveform Graph

Hi, 

 

I am fairly new with using Labview and I am having troubles with some scale readings. 

 

I have a scale connected via a DAQ to a VISA serial. The graph should be at a constant number as the weigh on the scale is constant; however, I am getting a weird spike on the graph itself (and when I write to file) where it randomly jumps to zero. I have attached screenshots below.

 

All the setting on the scale allow for continuous reading even if not stable. 

 

Any suggestions as what the issue might be? 

 

Download All
0 Kudos
Message 1 of 11
(608 Views)

Ensure that new data is available at VISA BEFORE reading it. It looks like the function returned Zero (after timeout for example) because VISA didn't find any new data. 

0 Kudos
Message 2 of 11
(601 Views)

Could you expand a bit more on that? 

 

More info: I am running this VISA as a sub-VI. 

0 Kudos
Message 3 of 11
(588 Views)

Hi student,

 


@hmcengstudent wrote:

I have a scale connected via a DAQ to a VISA serial.


You don't connect a scale "via a DAQ" to "a VISA serial"…

 


@hmcengstudent wrote:

All the setting on the scale allow for continuous reading even if not stable. 

 

Any suggestions as what the issue might be? 


One issue: you don't attach your code. We cannot edit/run/debug images with LabVIEW…

 

Another issue: did you watch this video yet?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 11
(583 Views)

Hi! I'm sorry I am new to this. 

 

I have attached the code below.

 

Thank you for the video suggestion!

0 Kudos
Message 5 of 11
(567 Views)

@hmcengstudent wrote:

Hi! I'm sorry I am new to this. 

 

I have attached the code below.

 

Thank you for the video suggestion!


Unfortunately, nothing attached.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 6 of 11
(563 Views)

Hi student,

 


@hmcengstudent wrote:

Hi! I'm sorry I am new to this. 


And you are using the very latest LabVIEW version.

 

Could you please downconvert (File->Save for previous) to LV2021 or older? I prefer LV2019.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 11
(543 Views)

What scale are you trying to communicate with?  We need a lot more information on the communication protocol before we can give any real advice.

 

But some general comments:

1. If you are not using the standard display style for your string constants, make the display style visible (right-click, Visible Items->Display Style).

2. Turning the Termination Character off is a major red flag to me in an ASCII based protocol.  That is likely a problem.

3. Your Write and Read should be in a loop if you want to keep getting measurements.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 11
(537 Views)

I am using the current software. I have attached it as the 2019 version.

 

I am using a cole-parmer lb-200-6002i that is connected to labview via an rs-232.

0 Kudos
Message 9 of 11
(522 Views)

Thank you for attaching your 2019 version of your code.

 

What @crossrulz was mentioning was that many instruments (and probably your Cole-Parmer) "speak and listen in ASCII", as indicated by your command "CP\r\n".  They will answer the same way, a string of text followed by <CR><LF>.  Take advantage of this by doing the following:

  • Leave the VISA configuration setting "Enable Termination Character" True, and leave the default at 0x0A (<LF>).
  • To read a response to a command, do a VISA Read of 1000 (or any suitably large number) characters -- it will stop when it gets the <LF>.  Now parse your response.
  • To get a "feel" for your instrument, plug it into your PC, open MAX, find the Instrument in the Devices and Interfaces, and open a Test Panel.  You can configure all the VISA Setting, and experiment sending Commands and reading the Responses to be sure you are communicating correctly, and have all the settings correct.

Bob Schor

 

0 Kudos
Message 10 of 11
(514 Views)