DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Concatenating DataFileLoad Registered Data

I am trying to use the "Importing Data From Multiple ASCII Files" to concatenate file using the DataFileLoad command with the ImportAction set to register since it is so much faster.  I get a message that says cannot concatenate read only channels.  Is there a way around this.

0 Kudos
Message 1 of 5
(3,986 Views)

Hi bm2cox,

 

I've tried to reproduce what you are seeing, but I haven't been able to get the same error message.  Do you get the error message when using the example data files that are included with the script? (Spanned ASCII data set 1-4)

 

If not, then there must be something about the ASCII files you are importing.  I have tried making ASCII files read-only, but I still didn't get the error.  Is there anything about the ASCII files you are using that is out of the ordinary?

 

BM2 = Boatswain's Mate?

 

Regards,

 

Brandon V.

Applications Engineering

National Instruments

www.ni.com/support

 

 

0 Kudos
Message 2 of 5
(3,972 Views)

Brandon,

You are correct Boatswain Mate.  Here is the error I am getting when running the script:

 

Error in <Concatenate Groups.VBS> (Line: 381, Column: 29):

This operation does not work with write-protected channels.

 

Line 381 is:

IF (AllDynamic) THEN CallChnReAlloc(ToChan, TargetLen)

0 Kudos
Message 3 of 5
(3,962 Views)

Hi BM2,

 

I was finally able to reproduce what you are seeing.  The error is because of using the "Register" parameter.  When the channels are being concatenated, they are being added to one of the original channels, and when the channels are registered, they are read only.  You can fix this a couple of ways.  First, you could not use the "Register" parameter.  I would not expect the import to happen much, if any, faster on an ASCII data import when registering the data.

 

If registering the data turns out to be significantly faster than loading the data, you could also use the updated scripts that I have attached.  If you download them, remove the .doc extension from them.  The forum won't let me attach .vbs files.  You can change lines 79 and 83 of the Importing Data From Multiple DataPlugin Files.vbs to register the data.

 

              Call DataFileLoad(FilePaths(i), DataPlugin, "Register")
            Case Else
              Call GroupCreate(NameSplit(FilePaths(i), "N"))
              Call GroupDefaultSet(GroupCount)
              Call DataFileLoadSel(FilePaths(i), DataPlugin, "Register")

Since this will cause the error that you have been seeing, you also need to change a parameter in line 45 from TRUE to FALSE.

 

GroupIdx = ConcatGroups(Xchannel, X_Overlap, ShortChans, NoValueRow, AddDateTime, FALSE, StartGroup)

 

This will tell the script to leave the original groups as they were in the DataPortal, and will keep you from getting the error.  You will have the original groups loaded still, so you may need to do some cleanup in the script to remove any data that you don't need.

 

Let me know if you have any questions!

 

Regards,

 

Brandon V. (Formerly FC2)

Applications Engineering

National Instruments

www.ni.com/support

 

 

 

 

0 Kudos
Message 4 of 5
(3,894 Views)

Thanks Brandon your script worked.

 

Larry (Formerly BM2)

0 Kudos
Message 5 of 5
(3,889 Views)