DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Assigning data to a new channel

I would like to create a new channel and then fill that channel with the HIC (15) number from the CHNHICCALC function, I'm missing something easy I'm sure. The code that doesn't work is below. The channel Right_Ear_HIC_Graph just reports back the position it is in the dataset not the actual value of HIC.

 

Call CHNHICCALC("ElapsedTime","Right Ear Resultant",1,1,0,0,0,0)

Hic_Right_Ear = Int(HICRes(1,3))

 

Call CHNALLOC("Right_Ear_HIC_Graph",1,1,DataTypeFloat64,"Numeric",2,0)

Right_Ear_HIC_Graph = Hic_Right_Ear

0 Kudos
Message 1 of 3
(3,680 Views)

Hello jhorton,

 

The last line needs to be:

 

ChD(1,"Right_Ear_HIC_Graph") = Hic_Right_Ear

 

The ChD() variable allows you at address a specific "cell" (row and column) in the channel, ion this case it's row 1 in the channel called "Right_Ear_HIC_Graph".

 

I would personally store the HIC in channel property, which makes it searchable, but there might be a good reason to store it as a value in a channel.

 

Let me know if this helps,

 

     Otmar

Otmar D. Foehner
Message 2 of 3
(3,658 Views)

Hey jhorton,

 

In addition to Otmar's method, if you're using a recent version of DIAdem, you can also set the channel value in an object-oriented fashion:

 

Data.Root.ChannelGroups("Channel Group Name Here").Channels("Right_Ear_HIC_Graph").Values(1) = Hic_Right_Ear

 

Channel group and channel names can be referenced by name or by index.

 

 

Derrick S.
Product Manager
NI DIAdem
National Instruments
0 Kudos
Message 3 of 3
(3,580 Views)