DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Dataplugin Assistant - Configuring more than 50 data input Channels

Hello!

 

actual I do some adaption of a vbs-script for data analysis. The data is imported from a txt-file by using the dataplugin. I used the dataplugin assistant to create the plugin. On the first view it worked fine. But it didnt. The text data is imported as numeric data and I wanted to correct this. First I tried to use the dataplugin assistant again, but there is a problem. I cant configure the specific channels because they re not shown in the selection. The last field ist just marked with ".." and I cant expand it or s.th. So I cant configure channels which are 50+, but I have to. So next idea was to edit the code of the dataplugin-file after exporting it, but it is not possible to do that in Diadem 2012 (https://forums.ni.com/t5/DIAdem/DataPlugin-VBS-encryption-always-on/td-p/2405322). So what can I do? Anyone can help?

 

Greetings,

 

Kolja Gruß

0 Kudos
Message 1 of 6
(5,508 Views)

Hi Kolja,

 

Care to post or email you data files for me to see what you're dealing with?  If it's simple I can create the DataPlugin for you and send you the source code so you can edit it in future if need be.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

brad.turpin@ni.com

0 Kudos
Message 2 of 6
(5,487 Views)

I Have exactly the same issue reported above. How can i solve this?

Thanks!

0 Kudos
Message 3 of 6
(1,694 Views)

Hi Marco,

 

The ASCII and Excel DataPlugin Wizards are designed to enable the DIAdem user to create a simple DataPlugin without having to program it from scratch.  The wizards have limitations, though, and it seems you've bumped up against one of them.

 

The way forward is to abandon the wizard and program the DataPlugin from scratch.  Usually, if the wizard is close to being able to import your data file format, this turns into a very simple task, and I'd be happy to create one for you and send you the resulting code to review and use.

 

Care to post some sample data files?

Brad Turpin

Principal Technical Support Engineer

NI

0 Kudos
Message 4 of 6
(1,680 Views)

It's a csv with ; as comma separator.

First row has to become the channel name.

Second row instead the first channel value.

Some values are double, others are string. In the example file attatched some second row cells are empty. I will re-arrange the plugin myself for them.

Thanks a lot for the support Brad!

Regards.

Marco

0 Kudos
Message 5 of 6
(1,672 Views)

Hi Marco,

 

Here is a short DataPlugin that loads all rows and columns present in the CSV file, and it uses the value of the second row to guess the intended data type of each column.  For now, empty row2 values create a string channel.  Here's the code and the *.uri file for easy registration in your DIAdem.  Note that for modern versions of DIAdem, if you just double-click the *.uri file, the DataPlugin will register encrypted.  You have to instead go to the DataPlugins dialog and import the *.uri file in order to be able to see and edit the DataPlugin source code.

 

 

OPTION EXPLICIT

Sub ReadStore(File)
  Dim j, jMax, Block, Group, Channel, ChanNames, ChanTypes
  File.Formatter.Delimiters = ";"
  File.Formatter.LineFeeds = vbCRLF
  Set Group = Root.ChannelGroups.Add(File.Info.FileName)
  Call GetHdrInfo(File, ChanNames, ChanTypes)
  jMax = UBound(ChanNames)
  Set Block = File.GetStringBlock()
  FOR j = 1 TO jMax
    Set Channel = Block.Channels.Add(ChanNames(j), ChanTypes(j))
    Call Group.Channels.AddDirectAccessChannel(Channel)
  NEXT ' j
End Sub


Sub GetHdrInfo(File, ChanNames, ChanTypes)
  Dim j, jMax, Delim, DataPos, DataVal
  Delim = File.Formatter.Delimiters
  ChanNames = Split(Delim & File.GetNextLine, Delim)
  jMax = UBound(ChanNames)
  DataPos = File.Position
  ChanTypes = Split(Delim & File.GetNextLine, Delim)
  ReDim Preserve ChanTypes(jMax)
  File.Position = DataPos
  FOR j = 1 TO jMax
    ChanNames(j) = Trim(ChanNames(j))
    DataVal = Trim(ChanTypes(j))
    ChanTypes(j) = eString
    IF IsNumeric(DataVal) AND DataVal <> "" THEN ChanTypes(j) = eR64
  NEXT ' j
End Sub ' GetHdrInfo()

 

 

Brad Turpin

Principal Technical Support Engineer

NI

0 Kudos
Message 6 of 6
(1,634 Views)