Array Based Logger Downloads_Campbellsci论坛问答

Alright! The first person to ask a question in this brand new forum!! What kind of prize do I get?

Here goes:
(NOTE: I apologize profusely for the lengthy message).

Array Based Logger Downloads_Campbellsci论坛问答

Working with a CR10X, Array-based datalogger, named RBPro1


What I'm trying to accomplish:

* Download the historical, hourly / daily data on a periodic scheduled basis
* Store this to a collect-area that I create
* Be able to query this data using data-query


My Problem:

* I just can't figure out how to asociate a collect-area setting to the historical data ("final_storage_1" data)
* How to query that data... see questions at the end...

Here's what I've done:

1) Create the dataloger (Add-device..., it's a child-of a phone-modem-remote )
2) setup a collect area:

* create-inlocs-area RBPro1 RBPro1Data {1 columnname1} {2 column2} {3 column3} etc...
* set-collect-area-setting RBPro1 RBPro1Data 2 1 enables downloads

after doing a get-collect-area setting 14 it shows the collect areas


4) set-collect-area-setting RBPro1 RBPro1Data 23 1000
fsValuesToPoll = 1000
5) set-collect-area-setting RBPro1 RBPro1Data 16 2
dataFileOutputOption = append
6) manual-poll RBPRO1

What happens:
* it downloads the data, I can see the data coming in, and
* the file RBPro9_final_storage_1.dat has all the records I want!
* This datalogger (a RainBird Pro) has 2 array records (108 and 118). thousands of records are in the table file!!! That's the good news.

BUT RBPRO9_RBPRO9Data.dat file

* has 1 record for every time I do a manual-poll.
* It's evidently the data present at the time of the poll.
* The top of this file shows the set-collect-area settings I created in step 2 above.
* I really don't care about this data, I want the data that's contained in the "Final_storage_1" file.


QUESTIONS:

1 ) HOW DO I GET THAT (final_storage_1) DATA?

data-query RBPRO9 RBPRO9Data "20000101" "20100101"
I only get the LAST 1 Record from the RBPRO9Data file


data-query RBPRO9 final_storage_1 "20000101" "20100101"
gives error " invalid table name"


2 ) HOW DO I asociate the Collect-Area-Setting to the Final_Storage_1 data.
i.e., I want to asign the field names, and have them return back with "data-query"


After 30 man hours I'm desperate to get this finished.
Any help would be greatly appreciated.

Eric Robishaw
* Last updated by: ERobishaw on 9/16/2008 @ 11:27 PM *

新对话如下:

ERobishaw,

Way to be brave!

What software are you using to collect the data?

新对话如下:

My own software via the LoggerNetSDK.

I mistakenly thought this forum was specific to the SDK...

Eric

新对话如下:

Wow… CoraScript, an advanced topic right off the bat. Let me just say that most Campbell Scientific customers have probably never heard of CoraScript nor will they ever have the need to learn about it. That being said let me see what I can do.

For starters you said you used the create-inlocs-area CoraScript command to create your collect area. That command will create a collect area for input locations only, not final storage data. There is no history in the datalogger as far as input locations. Whatever is in the input locations will be written over the next time the datalogger program executes and the previous values are gone forever. That's why every time you do a manual poll you only get one record added to the data file. That's all that's available in the datalogger at that time no matter what you set the collect area settings to.

When you add an array based (also know as "mixed array") datalogger like a CR10X to the LoggerNet network you end up with a few collect areas by default. You can use the list-collect-areas CoraScript command to see them. Example:

list-collect-areas cr10x;
*list-collect-areas,"cr10x"
{
"final_storage_1",1
"final_storage_2",1
"ports_and_flags",1
}
+list-collect-areas

If you have scheduled data collection enable for the datalogger or you do a manual data collection, the default final_storage_1 collect area will contain a copy of the final storage data collected from the datalogger. You could simply query using the data-query CoraScript command the final_storage_1 collect area that already exists. If however you really do need to define your own collect area you need to use the create-fs-area CoraScript command instead of the create-inlocs-area CoraScript command. The create-fs-area CoraScript command is used strictly for creating collect areas for final storage data and the create-inlocs-area CoraScript command is used strictly for creating collect areas for input location data.

Hope this helps.
* Last updated by: ChipsNSalsa on 9/17/2008 @ 2:37 PM *

新对话如下:

I hate the cora script, it's so 80's like, but that's what I've got so...

I cannot find a "Create-fs-area" or anything similar in the cora_cmd docs (that's not the first time that's happened!)

what's the syntax?

Thanks for the help.
Eric

新对话如下:

Create-fs-area should be documented in your cora_cmd.chm help file. The help file I'm looking at has a file creation date of 07/03/2007. What's the date on yours?

Are you sure you can't just enable scheduled collection and query the existing final_storage_1 collect area? If not, the following is from the CoraScript help file.

2.13. create-fs-area
This command can be used to create a final storage collect area associated with a classic datalogger. Reasons for doing this include polling the datalogger for data without affecting the state of existing areas.

2.13.1. Input Syntax
command := "create-fs-area" station-name new-area-name area-no.
station-name := string.
new-area-name := string.
area-no := "1" | "2".

2.13.1.1. Arguments
station-name
Specifies the name of the datalogger in the server's network map.

new-area-name
Specifies the name for the new collect area. This name must be unique in the set of collect area names already defined for the datalogger.

area-no
Specifies the datalogger final storage area number. This value should be one or two.

2.13.1.2. Options
This command does not recognise any options

2.13.2. Output Syntax
output := failure-output | success-output "\r\n".
failure-output := "-create-fs-area," reason.
success-output := "+create-fs-area".

The following failure reasons can be produced by this command:

Device name expected first
The datalogger device name is expected as the first argument.

Device session lost
The connection to the server was lost while this command was executing.

Expected the area name
The new collect area name was expected as the second argument.

Expected the area id
The final storage area number was expected as the third argument.

Invalid area id specified
The final storage area number was specified with an invalid value.

Invalid collect area name
The collect area name provided is not unique

Invalid final storage area
The specified final storage area number is not supported for the specified device.

新对话如下:

hmmm... my chm is dated 3/2/06

not sure which version of the SDK I have:
coralib3.dll 1.3.8.51, 7/7/06
All others are 2.2.6.0 (1/3/07)

2 issues as things are (i.e., not setting up a fs-area)

1) I don't seem to be getting data advisor notifications on data from the mixed array logger.

2) data-query RBPRO9 final_storage_1 "20000101" "20100101"
gives error " invalid table name"

final_storage_1 "table" doesn't show up in list-tables, but it does show up with list-collect-areas.

list-tables:
"ports_and_flags"
"RBPRO9Data"

list-collect-areas:
"final_storage_1",1
"final_storage_2",1
"ports_and_flags",1
"RBPRO9Data",3


After doing a create-fs-area RBPRO9 RBPRO9FS1Data 1,
list-collect-areas:

"final_storage_1",1
"final_storage_2",1
"ports_and_flags",1
"RBPRO9Data",3
"RBPRO9FS1Data",3

However list tables still does not show the FS1Data I just created, so I'm still not going to be able to query it!

ARG!!!

Thanks for the help, btw.

Eric

新对话如下:

Also note,
I see no file structure changes after creating the FS-Storage Area (no new files created), although If I attempt to create the same fs-storage-area again, I get an error, indicting to me that the fs-area does exist in the configuration... there's just no file created for the data to go.

Also, I did a manual download, and more data got put into final_storage_area1 file, but still, I cannot query it, AND the advisor did not fire off when the data was received!

新对话如下:

I should point out that a collect area is not a table. I suggest you try to accomplish your goal using the default final_storage_1 collect area and hold off trying to create a new collect area.

I forgot one of the little subtleties of dealing with a mixed array datalogger. Try the following:

Add the device.

add-device cr10x Zippy as-child ComPort_6;
+add-device

I called mine Zippy. At this point if we do a list-collect-areas we get

*list-collect-areas,"zippy"
{
"final_storage_1",1
"final_storage_2",1
"ports_and_flags",1
}
+list-collect-areas

and if we do a list-tables we get

list-tables zippy;
*list-tables,zippy
{
"ports_and_flags"
}
+list-tables

There are no tables defined that match the array IDs within the datalogger program. That's because it's a mixed array datalogger as apposed to a table datalogger. If it were a table datalogger LoggerNet could simply retrieve the table definitions built into the datalogger and thereby learn the structure of the data. The only way we can educate LoggerNet as to the structure of the mixed array dataloggers data is through a file association. DLD files (usually) and FSL files have a header that lists, in the case of a mixed array datalogger, array numbers and fields within the arrays. Here's an example from the top of a CR10X DLD file.

};CR10X
;cr10x.DLD
;Created by Short Cut (2.7)
;$
;:BattV :ProgSig :Temp_F :PTemp_C
;$

;%
;Final Storage Label File for: cr10x.SCW
;Date: 9/17/2008
;Time: 13:14:04
;
;101 Output_Table 1.00 Min
;1 101 L
;2 Year_RTM L
;3 Day_RTM L
;4 Hour_Minute_RTM L
;5 Temp_F_AVG L
;
;102 Output_Table 60.00 Min
;1 102 L
;2 Year_RTM L
;3 Day_RTM L
;4 Hour_Minute_RTM L
;5 BattV_MIN L
;6 ProgSig L
;
;Estimated final storage locations used per day: 7344
;%

The names between the first $ and the second $ are the input location names. The names between the first % and second % describe the final storage arrays and fields within the arrays.

Here's an example of an FSL file.

Final Storage Label File for: cr10x.SCW
Date: 9/17/2008
Time: 13:14:04

101 Output_Table 1.00 Min
1 101 L
2 Year_RTM L
3 Day_RTM L
4 Hour_Minute_RTM L
5 Temp_F_AVG L

102 Output_Table 60.00 Min
1 102 L
2 Year_RTM L
3 Day_RTM L
4 Hour_Minute_RTM L
5 BattV_MIN L
6 ProgSig L

Estimated final storage locations used per day: 7344

I'm hoping you have a DLD or FSL file for the program running in the datalogger with such a header in it.

Associate the DLD or FSL file to the device.

associate-program-file Zippy C:\Campbellsci\SCWin\cr10x.dld;
+associate-program-file

After that, list the tables again.

list-tables zippy;
*list-tables,zippy
{
"101"
"102"
"ports_and_flags"
}
+list-tables

The tables have now been defined. At this point you can even describe the table structures if you want.

describe-table Zippy 101;
*describe-table,"Zippy","",0,2000,1
{
"Year_RTM" 27 0 {} {} {} {} {1 1}
"Day_RTM" 27 0 {} {} {} {} {1 1}
"Hour_Minute_RTM" 27 0 {} {} {} {} {1 1}
"Temp_F_AVG" 27 0 {} {} {} {} {1 1}
}
+describe-table

After following the above instructions you should have tables defined that you can query with the data-query command.
* Last updated by: ChipsNSalsa on 9/17/2008 @ 5:51 PM *

新对话如下:

YES!!!!

That's what I needed: "associate-program-file"


Funny thing is, I discovered the FSL files by playing with the CSI "Short Cut" program, I just didn't know how to make the association.

The docs are a little sparse on this one... but then, hey, I'm probably the first guy in 5 years to need it.

Thanks a million, "Chips n salsa".

You've saved my bacon!

Eric

分享到:

原文链接:,转发请注明来源!
海洋仪器网 仪器使用 Array Based Logger Downloads_Campbellsci论坛问答
「Array Based Logger Downloads_Campbellsci论坛问答」评论列表

发表评论