04-27-2005 04:07 AM
04-27-2005 09:41 AM
04-27-2005 10:28 AM
03-25-2011 10:46 AM
Hello,
I would like to set a complete range of data (array) using OLE command 'ValueRangeSet' instead of setting each single value.
If i try to make this sample run, it does not work properly.
I have a 1D-Array of 'Single Type' Data (Gesamtdaten) and tried the following using VB.net :
oDIAdem = CreateObject("DIAdem.ToDataSheet")
My desired result is to get the 1D-data array into Channelgroup1 Kanal3.
Thanks in advance for any help with this ...
oDIAdem.ValueRangeSet(1, "[1]/Kanal 3", Gesamtdaten.Length, "[1]/Kanal 3", Gesamtdaten)03-26-2011 05:24 PM
Hi Tebe2011,
To my knowledge you can only get and set 2D arrays from/to the Data Portal using OLE (ActiveX). Have you tried declaring your array as a 2D array where the second dimension is of size 1?
Brad Turpin
DIAdem Product Support Engineer
National Instruments
03-28-2011 04:33 AM
Hello,
thanks for your answer - the "ValueRangeSet" now shows no error anymore, but it still works strange 😞
After "ValueRangeSet" with the 2D array there is only the first value from this array in Diadem, all other values are not imported, the Diadem channel length is "1"
My 2D array was setup using VB.net : Dim Gesamtdaten(15000, 0) as single
The first array dimension is completely filled with data, but only the value for Gesamtdaten(0, 0) has been transferred to corresponding Diadem channel using :
Laenge = UBound(Gesamtdaten, 1) + 1
oDIAdem.ValueRangeSet(1, "[1]/Kanal 3", Laenge, "[1]/Kanal 3", Gesamtdaten)
What else is going wrong here ?
regards
03-28-2011 07:59 AM
Hi Tebe,
Based on the symptom you're reporting, I'd guess that you're trying to write to brand new (empty) channels, right? In that case all you need to do is explicitly set the channel length to the target value BEFORE you write the data to it, like this (VBScript):
Dim lSuccessT Dim vValueV(499, 3) For i = 0 To UBound(vValueV, 1) For j = 0 To UBound(vValueV, 2) ChnLength(j+1) = UBound(vValueV, 1)+1 vValueV(i, j) = 4711.4711 Next Next Set oDIASheet = CreateObject("DIAdem.TODataSheet") lSuccessT = oDIASheet.ValueRangeSet(1, 1, 500, 4, vValueV)
Brad Turpin
DIAdem Product Support Engineer
National Instruments
03-28-2011 09:44 AM
Hello,
thanks again for your support - it's working now 🙂
regards