08-13-2011 04:42 PM
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
08-15-2011 09:49 AM
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
08-15-2011 04:00 PM
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.