LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Overflow of data and improper data recording in RS-232

Hi!

 

I am trying to establish an RS-232 interface to read and record data from a GFK330a Adam scales. The problems that I have met are as follows:

 

1) First, I tried to record data every second (1 event/1s), but it would always overflow the buffer and this type of error would always occur - VISA:  (Hex 0xBFFF006C) An overrun error occurred during transfer. A character was not read from the hardware before the next character arrived. However, when I turn off "End read and write on termination character", it takes data just fine, without interruptions, but it gives 6 or 8 data points every second which does not suit me. I have put the VISA buffer in the while loop, and the overrun error does not happen now when I am taking data. However, the data is being recorded awfully (see the attached file TXT file). Is there any way to set the recording time the way I want and to read all amount of data at once?

 

2) The data appear in the read string with GROSS label. Is there any way to get rid of this and record just numbers with kgs?

 

Thanks!

Download All
0 Kudos
Message 1 of 5
(2,332 Views)

1. Generally it is better to not use both End on Termination Character and Bytes at Port at the same time.  If a device sends a termination character, using End on Termination Character assures that you either get a complete message or a timeout error.  You may notice that your text file has several incomplete messages.

 

1.a. When you get multiple data points per second, what value do you use for milliseconds to wait?  Does the scale only transmit one data point each time you send a command or does it send continuously after it starts sending data?

 

2. Look at the String palette. Several functions there can help you manipulate the data.  Match Pattern. Decimal String to Number and then display with units. Scan Value.  Probably the Spreadshhet String to Array function, although not exactly th eway you are using it.

 

3. You need to wire the file refnum through the Error and False cases or the text file will not be closed.  Turn off Use Default if Unwired on those tunnels.

 

Lynn

0 Kudos
Message 2 of 5
(2,328 Views)

Hi, Lynn!

 

Thank you very much for your prompt response. I am sorry for getting back to you so late, but I have played again with the program. First of all, I have solved issue 3 mentioned by you. In fact, I did not mention this to you very first time, but it would always spit out an error (see write_to_file attachment), BUT it is not an issue anymore since I have done everything as you have told.

 

Now I what I really want (my ultimate goal) is to be able to write into file the number (weight) per time that I specify. In other words, say, I want to record 1event per 1 sec or one event per 5 sec. The latter would be even better! The scales transmit data in continuous mode. When I turn ON read and write on term. character, it transmits only one data point each time (currently my delay time is 1000 msec), BUT the TXT file looks terrible (see file scales_Nov_12_1.txt). Besides it does not read all the bytes in the output that are sent into the input. When I turn read&write on term. char. OFF, it transmits several data point and READS exactly the same number of bytes that has been transmitted into the input. The TXT file for the continuous data file input is attached (scales_Nov_12.txt). 

 

Besides the chart looks awful too in both mentioned above cases. It has all these zero gaps. Please see the attached picture.

Download All
0 Kudos
Message 3 of 5
(2,312 Views)

The picture is attached! As you see, it spits out as GROSS 2.76 kg. How can I get rid of GROSS?

0 Kudos
Message 4 of 5
(2,311 Views)

I see that your file path includes "neutrino." Obviously this is the problem because the mass is much too large for a neutrino!

 

Seriously, do you know exactly what characters the scale is sending?  I cannot tell from either the text file or the images because the important details are either invisible or may be modified before it gets here.  Does the manufacturer of the scale publish the data format?  Do you know whether there is a pause between the end of one transmission and the beginning of the next?

 

If you know the format or can figure it out, use the string manipulation functions as I mentioned in an earlier post to eliminate GROSS.

 

Run your program until you get something like what is shown in scales.png. From the Edit menu Make Current Values Default.  Save the VI with a different name and post the saved VI.  Then we can look at your data.

 

Lynn

0 Kudos
Message 5 of 5
(2,306 Views)