From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
07-01-2006 08:51 AM
We use DIAdem to analyze data from a crash box which is installed on our Indy Cars. It is not uncommon to have two impacts which both require a HIC calculation for reporting purposes. It looks like the HIC function looks for the peak of the channel used for the calculation. Thus if you zoom in on the car impact channel that does not have the peak of the channel used for the HIC calculation. The HIC calculated number does not correlate with the car impact graph. We have script files that analyze the data and draw the appropriate graphs. The data sets are 1.5 minutes in length and we typically zoom down to about a 200msec window for graphing. I would like the calculations like HIC and Delta V to be confined to the data in the window determined by the cursors used for the zooming of the window. The work around has been to edit the data into 2 data sets each of which contains an impact. However due to the speed that we like to get the data to the Doctors having to manually edit the data into two data sets is not desirable.
07-02-2006 03:56 AM
Matthias Alleweldt Project Engineer / Projektingenieur | Twigeater? |
07-02-2006 03:57 AM
Option Explicit
Dim i
Dim dX1
Dim dX2
Dim nStartRow
Dim nEndRow
Dim dSampleInterval : dSampleInterval = 0.0001
' remove temporary channelgroup if exist
If GroupIndexGet("DATA_PART") > 0 Then
Call GroupDel(GroupIndexGet("DATA_PART"))
End If
' X1/X2 order might be wrong
If View.ActiveSheet.Cursor.X1 < View.ActiveSheet.Cursor.X2 Then
dX1 = View.ActiveSheet.Cursor.X1
dX2 = View.ActiveSheet.Cursor.X2
Else
dX1 = View.ActiveSheet.Cursor.X2
dX2 = View.ActiveSheet.Cursor.X1
End If
' convert time values to channel row index (simple way)
nStartRow = dX1 / dSampleInterval + 1
nEndRow = dX2 / dSampleInterval + 1
' create new temporary channelgroup and set it as default
GroupCreate("DATA_PART")
GroupDefaultSet(GroupIndexGet("DATA_PART"))
' copy the defined block from the first channelgroup
For i=1 to GroupChnCount(1)
' create target channel
Call ChnAlloc( ChnName("[1]/[" & i & "]"),nEndRow - nStartRow + 1)
' copy data block
Call DataBlCopy("'[1]/[" & i & "]'",nStartRow,nEndRow,"'" & "DATA_PART/[" & i & "]'",1)
Next
' calculate HIC in new group
Call ChnXYZAbsValue("DATA_PART/11HEAD0000H3ACXP", "DATA_PART/11HEAD0000H3ACYP", "DATA_PART/11HEAD0000H3ACZP", "DATA_PART/11HEAD0000H3ACRA")
Call ChnHICCalc("DATA_PART/time", "DATA_PART/11HEAD0000H3ACRA", true, true, true)
' do something with the HIC
MsgBox "HIC(1) = " & HICRes(1,1)
Matthias Alleweldt Project Engineer / Projektingenieur | Twigeater? |
07-23-2006 09:26 AM
Thank you for your response. With some hints from your code I was able to get our HICs calculated correctly. I was trying to use the block copy function but did not understand what to do once the data was copied. Creating the new channel group was the secret. We already had a script written that would allow me to zoom in on the crash impulse in view and then update the time axis on the 6 graphs in report that we print for the doctors. Since we were already doing the manual parsing of the data as you mentioned in your first response we already had the cursor coordinates need to create the channel group.
Thanks again for your help
Jeff