LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data logging through RS232 stops


@Ezzow wrote:

do you have a better way to program it than the one I mentioned ? 

 

my problem is: the mass should actually be increasing at that point where it's the same .. 


I get that but if the data your are receiving from your scale says it is not increasing, what would you propose to do? 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 11 of 23
(800 Views)

this is what I did: if the derivative of the measured mass [g/s] = 0 (means when the mass [g] is constant), then use the last mass value for the next calculations and not the actual one.

 

it works. However, it's not very clean. It seems like there's no way to make it completely clean. Because the scale isn't compatible for this kind of data logging I guess. 

0 Kudos
Message 12 of 23
(791 Views)

Hi Ezzow,

 


@Ezzow wrote:

this is what I did: if the derivative of the measured mass [g/s] = 0 (means when the mass [g] is constant), then use the last mass value for the next calculations and not the actual one.


When the derivative is zero then the "actual value" is the same as the (previous) "last one"!

What's the difference between using the "last value" instead of the "actual one" in that case???

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 13 of 23
(763 Views)

I'm using the last value of the derivative. 

 

if the derivative = 0, then use the previous value of the derivative. 

 

Because all I need for the next calculation is the derivative value.. 

 

0 Kudos
Message 14 of 23
(755 Views)

I agree with RTSLVU, you're spinning the while loop too fast and no data is coming through and you're interpreting it as missing data so you use the last recorded reading.

 

Let's back up here.

 

How is the scale setup independently of the computer and the CRIO? Is it waiting for a "get me the next reading" via a send commend message or is the scale set up to continuously send data after some delay? I'm no expert on weight scales (I assume that is what you are using), but the ones I've ran into, there is a setting that will let you do this and it looks like the latter is what you're doing.

 

Let us know how the data acquisition part is first, THEN we can explore solutions.

0 Kudos
Message 15 of 23
(735 Views)

The scale is sending data continuously with the following setting: 

 

Baud rate: 19600

stop bit: 1 

start bit: 1 

parity: none 

 

this is the configuration in the attached datasheet: 

Ezzow_0-1666646622349.png

 

datasheet:

https://merlegcenteratmeneti.shoprenter.hu/custom/merlegcenteratmeneti/image/data/PCB-BA-def-1718.pd...

 

do/did you use the same settings before?

0 Kudos
Message 16 of 23
(736 Views)

A couple things...

  1. Have you set the linearization and calibration?
  2. Instead of using the "Continuous data output mode"
    1. AU PC:
      The weighing values are sent automatically and continuously, no matter if the value
      is stable or unstable.
  3. Use the "Data output via remote control commands" mode
    1. rE Cr:
      The remote control commands s/w/t are sent from the remote control unit to the
      balance as ASCII code. After the balance having received the s/w/t commands, it will
      send the following data.
      Take into account that the following remote control commands must be sent
      without a subsequent CR LF.
      s Function: Stable weighing value for the weight is sent via the RS232
      interface
      w Function: Weighing value for the weight (stable or unstable) is sent
      via the RS232 interface
      t Function: No data are sent, the balance carries out the tare function.

Then rewrite your program to query the scale at regular intervals that are far enough apart in time as to not get the same measurement twice

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 17 of 23
(713 Views)

 

  1. Have you set the linearization and calibration?

Since I don't know what that is then apparentely it didn't happen. 

 

I set the rE Cr configuration and now I get the following error with the same program attached in the first post: 

 

VISA: (Hex 0xBFFF0015) Timeout expired before operation completed.

 

 

0 Kudos
Message 18 of 23
(698 Views)

Hi Ezzow,

 


@Ezzow wrote:

I set the rE Cr configuration and now I get the following error with the same program attached in the first post: 

 

VISA: (Hex 0xBFFF0015) Timeout expired before operation completed.


Did you read the last message?

It says:

After the balance having received the s/w/t commands, it will send the following data.

Did you send any s/w/t command before getting the TimeOut error?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 19 of 23
(696 Views)

Hi GerdW,

 

thank you for the feedback!

 

I'm not sure how to do that through LabVIEW. Is there any references you can suggest ?

 

 

best regards 

Ezzow

0 Kudos
Message 20 of 23
(680 Views)