DASYLab

cancel
Showing results for 
Search instead for 
Did you mean: 

DASYLab RS-232 input quandry

I have been evaluating DASYLab for a project I am starting. So far, I like it a lot. But I can't seem to input basic data from my instrument.

I will just show you the raw output of my instrument when I query it for data. It says:

A001 2007/03/04 19:59:16 00<LF><CR>
     70.655 DEG F  TEMP-1 <LF><CR><LF>
<CR>

Okay, great. All I need is that temperature field and I am ready to go. But ty as I might, I can't decipher which code to enter into the "Data Format" box on the Serial setup screen. The correct setting alludes me after a couple of dozen attempts and well ove ran hour trying different strings. I tried things removing all of the garbage on the top line by using a 29xa\r and similar things.

Can someone show me how to remove the extra text fields, CR, and LF data so I can just log the numbers? When I am in the RS232 Monitor screen, sometimes the "Value" field will be correct when I sen the data request command. But the log file is still empty. By empty, I mean that all of the temperature data points are missing, although the time stamps are there.
0 Kudos
Message 1 of 3
(7,311 Views)
It may take some "trial and error" testing to get it right.

Because the data is on two lines, we need a way to anchor. We often can use the CR LF characters as an anchor, but you cannot.

So, the string is:

A001 2007/03/04 19:59:16 00<LF><CR>
     70.655 DEG F  TEMP-1 <LF><CR><LF>
<CR>

Use "A001" to anchor on the line, unless this is an increasing number. Is it static or an index? If static, then, I would do the following:

"A001" 26x a \r\n

This finds the start of the first line, then skips 26 characters to find the temperature.

Is there anyway to configure the device so the record is all on one line? That would work much easier!





Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
0 Kudos
Message 2 of 3
(7,308 Views)
That was so incredibly easy, as I figured it would be. Thanks a lot! You swapped the /n and /r, I think, but it worked.

Yes, the A001 is a static instrument number, so it is easy as pie. I did not know about being able to quote text at all. The help file for DASYLab is immensely GOOD, but it was not in this case riddled with enough examples or data type descriptions to help me here.

And no, the instrument always displays two lines and is not configurable. It's not really made for this, perhaps. It supports Modbus RTU, but I haven't been able to make it work with DASYLab. The ASCII data will be fine for now until I get that working. The Modbus RTU method allows me to pick out double-register 4-byte floating point numbers, but as I said, it just seems to output garbage right now.

And then, with that working, I tried to setup for logging the entire instrument's data values, 15 in all, which conveniently fits into the DASYLab RS-232 box, but barely. Anyway, it was another convoluted trial-and-error here before I figured it out. Here is the data coming from my instrument, with input numbers (0-14) added by me for reference:
A001 2007/03/05 17:06:31 00<LF><CR>
      0.000 Gal    NET-V1 <LF><CR>0
      0.000 G/M    NET-F1 <LF><CR>1
      0.000 Gal    NET-V2 <LF><CR>2
      0.000 G/M    NET-F2 <LF><CR>3
      0.000 Gal    NET-VD <LF><CR>4
      0.000 G/M    NET-FD <LF><CR>5
      0.000 G      MASS-D <LF><CR>6
      0.000 G/M    MAS-FD <LF><CR>7
     65.047 DEG F  TEMP-1 <LF><CR>8
     65.294 DEG F  TEMP-2 <LF><CR>9
      0.247 DEG F  TEMP-D <LF><CR>10
      0.000 Gal    GRS-V1 <LF><CR>11
      0.000 G/M    GRS-F1 <LF><CR>12
      0.000 Gal    GRS-V2 <LF><CR>13
      0.000 G/M    GRS-F2 <LF><CR><LF>14
<CR>

What I ended up doing is I setup the RS Master Channel 0 with the "Data Request Command" which sends all of this data. All of the subsequent channels needed to have that field blank. Then, for channel 0, it needed to say:
"A001"26xa\r

in the "Data Format" box and each of the rest of the input channels just needed this
a\r
and it worked. When I had a /n in there someplace, it was getting an extra value somehow, so that lines 8 and 9 appeared to be data points 9 and 10, respectively.

I will now need to look into the precision of the logging... so far, the ascii log I made was just using two digits past the decimal.

Thanks again.
0 Kudos
Message 3 of 3
(7,299 Views)