DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Create tdm with no data

I am trying to create a tdm file with more than 60 channels.  The creation of this file will just have the channels names and units.  This file will have data appended to it periodically.  The trouble I am having is having more than 60 channels I cannot specify the max channel length therefore the next time I try to add data it tell me I exceeded the max channel length.
0 Kudos
Message 1 of 5
(3,434 Views)

Hi bm2cox,

It sounds to me like you are mixing two issues.  You say that you are having trouble "having more than 60 channels" and then describe the difficulty as "I can not specify the max channel length".

Do I gather correctly that you are wanting to do the appending of the new values by loading the original data set into DIAdem, writing a few new values under each original channel, then saving the data set back to the TDM file in its original location on disk?

One problem you will run into with this method is that when you load a data set from disk, DIAdem will automatically set the maximum length of each channel loaded to the number of values declared in the TDM header for that channel.  So first you have to lengthen each channel before you can append to it:

NumNewValues = 100
Call DataDelall
Call DataFileLoad(".\libr\dat\Example.TDM")
FOR j = 1 TO GlobUsedChn
  NumOldValues = ChnLength(j)
  Call ChnReAlloc(j, ChnLength(j) + NumNewValues)
  ChnLength(j) = NumOldValues + NumNewValues
  FOR i = 1 TO NumNewValues
    ChDX(NumOldValues + i, j) = CDbl(j + i - 1)
  NEXT ' i
NEXT ' j
Call WndShow("VIEW")

Ask if you have further questions,
Brad Turpin
Product Support Engineer
National Instruments

 

Message 2 of 5
(3,416 Views)
Brad,
The message I am getting is "You can only expand dynamically created channels"
 
Here is an example file
 
Thanks
Larry
0 Kudos
Message 3 of 5
(3,411 Views)
For versions of DIAdem prior to 10.0, the ChnRealloc function will only work for dynamically generated channels.  Instead use the ChnAlloc function to allocate a new channel and populate it with the values from the old channel and your new values.

Regards,

Tyler T.
0 Kudos
Message 4 of 5
(3,383 Views)

Hi bm2cox,

Right, this was more difficult in older DIAdem versions.  If you just create a new Group with identically named channels and populate them with the new values, you can use a posted example to append them to the bottom of the first set of channels (you read from the TDM file).  You should run the VBScript "Concatenate Groups.VBS" once you have the 2 Groups set up: 

http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD4?p_guid=C34F36CBFA7173C3E034080020E74861&p_...

Choose the 9.1 version if you have DIAdem 9.1,
Brad Turpin
Product Support Engineer
National Instruments

 

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