Quantcast
Channel: DIAdem topics
Viewing all 3211 articles
Browse latest View live

Unable to copy text from logfile

$
0
0

Diadem Script, down is a window with logfile.

Sometimes i cant copy text from there, i mark some output and want to copy it with CTRL+C but it doesnt work, sometimes it works. 

Sometimes help if i click "open in editor" and in new script tab it works.

 

Diadem 2017 64bit, windows 10


Time Aligning Two Datasets

$
0
0

Hi All,

 

Searching on the NI Forums to find a way of aligning two datasets didn't give me what I required, so to detail the issue:

  • I have two sets of data.
  • Both datasets have the same measurement channels
  • I want to plot the datasets against each other.
  • The datasets have different recording lengths so there is an offset in the X-Axis time period.
  • I want to try to align the datasets to overlay specific sections that are identical to each other.
  • I wish to do this using either a time-based X-axis or a logpoint-based X-axis.

Other programs such as Bosch MDA and Uniplot have this feature built in where data alignment is done with a simple, easy drag and drop on the X-axis. I'm surprised that Diadem does not have this.

Color palette object in SUD

$
0
0

Is there any way to get the "color palette" object in a DIAdem SUD dialog? 

 

Appreciate the help!

Julia

Export to PDF appending issues

$
0
0

Recently, since switching to DIAdem 2019, I have been having trouble with using the Report.Sheets.ExportToPDF(path, append = true) where I set the appending option to true.  The resulting appended file is corrupt many time.  I have done a little bit of troubleshooting, and seems pretty random and mostly happens if there are more than 3 sheets and not always on the first append.  Does anyone else experience this?  The file won'nt open in adobe or any other pdf viewer.

For troubleshooting, if I simply run the following code as soon as I open DIAdem to make 4 appended pages of the example TDR loaded, the file is corrupt:

Option Explicit 'Forces the explicit declaration of all the variables in a script. DIM PATH, NAME PATH = "C:\Users\111660\Downloads\" NAME = "example" Call Report.Sheets.ExportToPDF(PATH & NAME & ".pdf", TRUE) Call Report.Sheets.ExportToPDF(PATH & NAME & ".pdf", TRUE) Call Report.Sheets.ExportToPDF(PATH & NAME & ".pdf", TRUE) Call Report.Sheets.ExportToPDF(PATH & NAME & ".pdf", TRUE)

diadem 2019.JPGpdferror.JPG

Dialog box font different on various devices

$
0
0

Hello,

i made a dialog box, but when i open it on various devices (win7, win10), the font is smaller or bigger, its not the same. I tried checking settings (win zoom, win fonts) but we have similar setting and the font is bigger.

Do you have some tip or idea what can cause this problem?

 

dialogSizes.png

Display average of X samples

$
0
0

Hi.

I'm using Diadem to display a value at a specific data point, using this:

 

Flow [lpm]:
@@str(Data.Root.ChannelGroups.Item(3).Channels.Item("Flow1").Values(Pno(Data.Root.ChannelGroups(3).Channels("Time\ai0"),5)),"AutoAdj")@@
@@str(Data.Root.ChannelGroups.Item(3).Channels.Item("Flow1").Values(Pno(Data.Root.ChannelGroups(3).Channels("Time\ai0"),15)),"AutoAdj")@@
@@str(Data.Root.ChannelGroups.Item(3).Channels.Item("Flow1").Values(Pno(Data.Root.ChannelGroups(3).Channels("Time\ai0"),25)),"AutoAdj")@@
@@str(Data.Root.ChannelGroups.Item(3).Channels.Item("Flow1").Values(Pno(Data.Root.ChannelGroups(3).Channels("Time\ai0"),35)),"AutoAdj")@@
@@str(Data.Root.ChannelGroups.Item(3).Channels.Item("Flow1").Values(Pno(Data.Root.ChannelGroups(3).Channels("Time\ai0"),45)),"AutoAdj")@@
@@str(Data.Root.ChannelGroups.Item(3).Channels.Item("Flow1").Values(Pno(Data.Root.ChannelGroups(3).Channels("Time\ai0"),55)),"AutoAdj")@@
@@str(Data.Root.ChannelGroups.Item(3).Channels.Item("Flow1").Values(Pno(Data.Root.ChannelGroups(3).Channels("Time\ai0"),65)),"AutoAdj")@@
@@str(Data.Root.ChannelGroups.Item(3).Channels.Item("Flow1").Values(Pno(Data.Root.ChannelGroups(3).Channels("Time\ai0"),75)),"AutoAdj")@@
@@str(Data.Root.ChannelGroups.Item(3).Channels.Item("Flow1").Values(Pno(Data.Root.ChannelGroups(3).Channels("Time\ai0"),85)),"AutoAdj")@@
@@str(Data.Root.ChannelGroups.Item(3).Channels.Item("Flow1").Values(Pno(Data.Root.ChannelGroups(3).Channels("Time\ai0"),95)),"AutoAdj")@@
@@str(Data.Root.ChannelGroups.Item(3).Channels.Item("Flow1").Values(Pno(Data.Root.ChannelGroups(3).Channels("Time\ai0"),105)),"AutoAdj")@@

 

But I would like to see the average of 120 data points/ samples at the 5, 15, 25, etc marker.

Can anyone please help me here 🙂

 

Brian

How to read and write Excel file from vb script

$
0
0

Hello guys,

 

I am a DIAdem 2017 user and I mainly use scripts to perform operations for automation reasons.

 

I am trying to set up a script that is capable of reading the excel spreadsheet's cell content (for a given file path, sheet name and cell range), transferring the content into an array in Diadem.

 

I started looking at CreateObject(...) and CreateUDI(...). However in the documentation there is a very little about handling an excel file from diadem script.

 

Do you have some examples that show how someone can handle the excel file, read and write the data inside the cells and save the file eventually.

 

Thank you

CHD versus Values object gives different results

$
0
0

Hello,

 

I am getting rid of old commands in VBS script such as CHD and replacing them with their object-oriented counterparts. So far I had no problems but I found out one discrepancy. With For Loop I generate numbers from 0.1 to 1 with step 0.1. I write these values into channel row that is 10 times the current loop value.

It's easy enough, with command CHD(iLoop*10,"NoName/Kanal")=iLoop I get the correct results (0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, ...)

Oddly with Data.GetChannel("NoName/Kanal").Values(iLoop*10)=iLoop I get (0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.8, 0, 1, ...)

 

Call Data.Root.Clear()
Call Data.Root.ChannelGroups.Add("NoName")
Call Data.Root.ActiveChannelGroup.Channels.Add("Kanal",DataTypeFloat64)
Data.Root.ActiveChannelGroup.Channels("Kanal").ReservedSize(100)

Dim iLoop
For iLoop=0.1 To 10 step 0.1

   'Data.GetChannel("NoName/Kanal").Values(iLoop*10)=iLoop
   CHD(iLoop*10,"NoName/Kanal")=iLoop

Next

 

Maybe I'm overlooking something, any help would be appreciated.

 

Thank you,

Marek.

 


Analyzing multiple TDMS files in one script

$
0
0

Hey all

 

I am new to DIAdem and trying to write a script to analyze a bunch of data files from a test. For this test, the data output would typically be from 8 measurement points, resulting in 8 data files. I currently have a script that analyzes one data file (my intro to DIAdem scripting) but I would like to expand that script to be able to read in all of the data files at once.

 

My end goal will be to create a test report that lists the data from all 8 runs in tabular and graphical form.

 

Any help on loading/analyzing multiple data files in one script, and saving the results of that analysis, would be greatly appreciated.

 

Thank you

Brian

Event length bell curve

$
0
0

Hi, I was hoping for some help.

 

I have some data which effectively shows when a electric motor for an air compressor is on or off (1 is off, 2 is on). It switches on and off frequently and I would like to plot a bell curve which shows the distribution of how long it's on for when it comes on. I've tried a few things but nothing is really working as I would hope. Any help would be appreciated. 

 

Kind Regards,

Kieran

Script access to 2D Axis Curves

$
0
0

Hello,

 

I am very seriously failing to understand the object model used in Report. The following line of code works perfectly in one of my scripts:

Report.ActiveSheet.Objects("2DAxis1").Curves2D("2DAxis1_Curve1").Shape.XChannel.Reference = HWChn.Name

However, when I transfer it to another script that uses a different Report file and change the channel reference to the first channel of the first group, it fails:

Report.ActiveSheet.Objects("2DAxis1").Curves2D("2DAxis1_Curve1").Shape.XChannel.Reference = "[1]/[1]"

The error message says: Object doesn't support this property or method: 'XChannel'

 

At first I thought it was the channel reference but now I suspect it's the name of the Curves2D object. The error message is not clear in which object it's referring to. I used Ctrl+Shift+C on the Curves and Axis Definition dialogue box and the reference in the retrieved text is:

Report.ActiveSheet.Objects("2DAxis1").Curves2D.Item(1).Shape.XChannel.Reference = "[1]/[1]"

The above line is using Item to refer to the first curve.

 

Opening the Curve Parameters dialogue box for curve 1 and using Ctrl+Shift+C yields:

Report.ActiveSheet.Objects("2DAxis1").Curves2D.Item("2DObj1_Curve1").Shape.XChannel.Reference = "[1]/[1]"

 

That's three different ways of accessing the same curve, but the first way only works on one of my Report files and not the other.

 

I then created a dummy Report file using a single axis system and tested my first line - it worked perfectly. I then added a second axis system, because that's the only difference that I can see between my two Report files, and ran the line once more. Again, it worked fine. So, now I'm stuck as to what the difference is between the various ways of accessing the curve objects. What's wrong with the first way, and how do I get the actual name of each curve to guarantee that I am correctly referencing them in code?

 

Thanks, Simon. 

oduce .mp3 file from DIAdem script

$
0
0

Hi everyone. Just a quick question.
Is there a way to reproduce an audio file (let's say an mp3 or equivalent) directly from script, without opening it in View?

Thanks a lot!

Opening an MDF file

$
0
0

Hello,

I am new to DIAdem and need to open MDF files to view and process them.  However, it won't let me load it.  After installing DIAdem with a plugin for MDF3 and MDF4, when selecting the file in the Open menu, I get the following error:

 

Cannot load the file "\\xxx.mdf" with the loader "MDF3".

Further information:

The file does not contain any measurements. Such a file cannot be loaded.

 

Any solutions?

pdf export (output print data as graphic) quit working in DIAdem 2019

$
0
0

The other day I was doing a pdf export of a filled 3D graph and remembered that I had forgotten to toggle the "Output print data as graphic" setting on. I hit the escape key to abort the pdf export and now it seems stuck in the mode which acts like the 'output print data as graphic' is not enabled no matter how I set the report output settings.

 

I get nothing but a solid block of color in the pdf file where the 3D color plot should be. It looks fine on the screen.

If I load the data into my old version of DIAdem 2015 (which I keep around for scripting compatibility issues) it generates the pdf 3D color plot just fine.

 

I'm assuming something is wrong with the DIAdem 2019 pdf export print device, but DIAdem 2015 is not affected.

 

Anyone have a suggestion on how I can get the graphic pdf export working on DIAdem 2019 again?

Table Cell Coloring help needed

$
0
0

Hello Group,

 

I am working to make a 2dTable to be able to change font color based on exceeding limits values.

Background:

Am using DIAdem 2019 SP1, Windows 10 pro 64.

Was working with example from forum by Winner,   This works partly, in that it will color the first column but not the subsequent columns.  (in my case the 2Dtable is 7 columns wide!)

 

Code used for user Commands.

Sub MyOnDrawingCell_1(Context, Cell)
'If (Context.Table.Name = "2DTable") Then
If (Cell.Value > 0.0) Then
Cell.Font.Color.SetPredefinedColor(2)
else
Cell.Font.Color.SetPredefinedColor(5)

End If
'End If
End Sub

Sub MyOnDrawingCell_2(Context, Cell)

'If (Context.Table.Name = "2DTable") Then
If (Cell.Value > 0.0) Then
Cell.Font.Color.SetPredefinedColor(2)
else
Cell.Font.Color.SetPredefinedColor(5)
End If
'End If
End Sub

 

 

Code used to build the Table

'-------------------------------------------------------------------------------
'-- VBS script file
'-- Created on 04/15/2020 08:57:50
'-- Author:
'-- Comment:
'-------------------------------------------------------------------------------
Option Explicit 'Forces the explicit declaration of all the variables in a script.
Dim oMy2DTable, oMyPosition, oMyColumn1, oMyColumn2
Call Report.NewLayout()
Set oMy2DTable = Report.ActiveSheet.Objects.Add(eReportObject2DTable,"My2DTable")
Set oMyPosition = oMy2DTable.Position.ByBorder
oMyPosition.Top = 30
oMyPosition.Bottom = 20
oMyPosition.Left = 20
oMyPosition.Right = 30
Set oMyColumn1 = oMy2DTable.Columns.Add(e2DTableColumnChannel)
oMyColumn1.Channel.Reference = "[1]/[1]"
Set oMyColumn2 = oMy2DTable.Columns.Add(e2DTableColumnChannel)
oMyColumn2.Channel.Reference = "[1]/[2]"
oMy2DTable.Settings.IndexSettings.IndexMode = e2DTableIndexModeAutomaticallyIncreasing
oMyColumn1.Settings.OnDrawingCell = "MyOnDrawingCell_1"
oMyColumn2.Settings.OnDrawingCell = "MyOnDrawingCell_2"

 

Questions List:

1) When I run the script to make the table, the result is that I can get column 1 to correctly color the fonts. But it will not in Column 2. Do not understand why it is not working.

2) When I tried to set the event code from the GUI

Pesmith8_0-1586960137076.png

Unsure what to put into this block.  Seems that if script set this value, then it works partially, but if set in gui have yet to get it to work.

 

If anyone can help with a working table building code or TDR and usercommand function that works, that would be very appreciated.

 

Paul

 


TDMS Data Logging - Waveforms & XY data

$
0
0

Hello Everyone,

 

I am measuring data of two different types of data

1. Waveform (t0, dt, Y)

2. XY graph (timestamp [array], Y[array])

 

My use case is:

1. Channels (10 channels) with waveform data has sample rate 1kHz, which acquire data as waveform. (DAQmx AI channel)

2. Another channels are (100 variables) OPC-UA based, which acquire data on event, and returns data in timestamp & value format.

OPC-UA variables changes its value very rarely.

3. I don't want to convert OPCUA data to waveform, since it will acquire more space.

 

I want to log both data in same TDMS file & analyze/veiw in DIAdem.

How should i achieve this?

 

BR & Stay Healthy,

DIAdem CSV Custom DataPlugin

$
0
0

I am fairly new to using DIAdem and I am trying to configure a DataPlugin for my .csv files when I import them into DIAdem. I've attached an example file of what all of my files are standardized too, with the addition or subtraction of channel columns.

 

The way our data acquisition is currently configured, my Channel Name and Units are all in one cell. So for example, my first channel is labelled "Time (sec)", so my Channel Name would be "Time" and my Units for that channel would be "sec" or "seconds". This format is standard across all my channels with varying names and units.

 

I am trying to figure a way out to essentially designate that row to be my Channel Name and Units, but then go into each one and extract the Channel Name and Units for that column to assign it in the metadata when I import these files. I have tried using the DataPlugin Wizard, but it's very limited past choosing how to segment the data and what each row designation should be. I'm assuming I could use a script to help out, but not entirely sure how that would work with importing data or using the data finder.

 

To clarify, I'd like to achieve this on the DataFinder side and not just have a script run and then user select what data to import. By achieving this on the DataFinder side, any time new data is added to my server it will pull all that metadata and I can search using those properties.

ChnFFT1 Issue

$
0
0

Hello,

 

I have a question about the ChnFFT1 function in Diadem.

I have to process a signal with 134217728 values and a sampling frequency of 4 MHz.

The FFT parameters for my analysis are :

- Output : Frequency & RMS amplitude.

- PeakMax average.

- Length of the individual intervals : 2048.

- Overlap : 75%

I calculated that this corresponds to (4*134217728/2048)-4=262140 intervals.

 

I tried the following Diadem parameters but the result does not match with what I expect :
FFTIndexChn = 0
FFTIntervUser = "NumberStartOverl"
FFTIntervPara(1) = 262140
FFTIntervPara(3) = 1
FFTIntervOverl = 75
FFTNoV = 0
FFTWndFct = "Hanning"
FFTWndCorrectTyp = "Random"
FFTAverageType = "PeakMax"
FFTAmplFirst = "Amplitude"
FFTAmpl = 1
FFTAmplType = "Ampl.RMS"
FFTCalc = 0
FFTAmplExt = "No"
FFTPhase = 0
FFTCepstrum = 0

 

I tried also the following Diadem parameters but that does not work :
FFTIndexChn = 0
FFTIntervUser = "LengthStartOverl"
FFTIntervPara(2) = 2048
FFTIntervPara(3) = 1
FFTIntervOverl = 75
FFTNoV = 0
FFTWndFct = "Hanning"
FFTWndCorrectTyp = "Random"
FFTAverageType = "PeakMax"
FFTAmplFirst = "Amplitude"
FFTAmpl = 1
FFTAmplType = "Ampl.RMS"
FFTCalc = 0
FFTAmplExt = "No"
FFTPhase = 0
FFTCepstrum = 0

 

Finally, I obtain the good result when I split my signal into packets with a maximum of 50k intervals.

I do FFT calculation for each sub-signals and take the maximum values at the end. 

Is there a limitation of the ChnFFT1 in term of number of intervals ?

Or, am I not using the function as it should be ?

Thank you in advance

DIADEM crash debug...

$
0
0

Crash when loading dataset from Datafinder Server.Crash when loading dataset from Datafinder Server.

 

Looks like when I try to load data that is more than 80ish groups I get this.  I am loading from a System link datafinder module not local.

Anyone else ever get this?

 

PC: DIAdem 2019 SP1 Win 10

DF server.  system link 19.6, Windows Server 2012.

Report Channel entry has group as "*"

$
0
0

Hi group,

 

Seeing something in DIAdem 2019, that is new for a 2DTable.

 

When have Table Columns in a 2Dtable, with datatype of Channel. The Entry section only lets me group to be "*" . This is creating some issues as I have more one channel with same name in different groups.

 

Looked in the DIAdem settings to see if have done something wrong, but so far have not found a solution.

 

Pesmith8_0-1587556716799.png

 

Paul

 

Viewing all 3211 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>