<< Prev        Next >>

ID : 7318

GetAccelometer

Function

To read the cumulative information of acceleration that has been applied to COBOTTA.

This command is available in Ver.2.7.* or higher.

Syntax

GetAccelometer

Return Value

This command returns the cumulative information of acceleration that has been applied to COBOTTA (hereafter, acceleration over the threshold value) as Variant Type.

Element number Description
0 The occurrence of acceleration over the threshold value that has been applied to COBOTTA within one second is counted and the number is stored as Integer type.
1 Among the acceleration over the threshold value that has been applied to COBOTTA within one second, the maximum acceleration (G[gravity acceleration]) is stored with Double precision real number type.

Description

To read the cumulative information of acceleration that has been applied to COBOTTA.

The Number of Occurrences of Acceleration over the Threshold Value Applied to COBOTTA

This counts how many acceleration events has been occurred against COBOTTA with 0.5G or higher within one second from the first acceleration.

However, when acceleration over the threshold value is applied to COBOTTA, if the next acceleration over the threshold value is applied within 0.05 second, it is not counted as one acceleration.

For example, in the following case, the number of acceleration occurrences will be three.

Also, once acceleration is applied to COBOTTA within one second, after that, if another acceleration event occurs within one second, the cumulative information is overwritten by the later acceleration.

For example, if GetAccelometer is executed in the following timing, the number of acceleration occurrences will be 4.

The Maximum Acceleration Value when Acceleration over the Threshold Value is Applied to COBOTTA

Among the acceleration over the threshold value that has been applied to COBOTTA within one second, the maximum acceleration (G[gravity acceleration]) is returned.

For example, if GetAccelometer is executed in the following Timing 1, the maximum acceleration will be 0.8G.

Also, just like the number of occurrences of acceleration, once acceleration is applied to COBOTTA, after that, if another acceleration event occurs, the cumulative information is overwritten by the later acceleration.

For example, if GetAccelometer is executed in the Timing 2 of the above figure, the maximum acceleration will be 0.7G.

Related Terms

ClearAccelometer

Attention

The function of this command itself is not included in the safety function.

When using the function, be sure to perform the risk assessment and take necessary safety measures to ensure the safety operation.

Example

'!TITLE "When acceleration over threshold value occurs three times or more, set the maximum acceleration (G) to D0."
 
Sub Main 
  Dim sensorValue As Variant

  Do While 1
    'Reset the cumulative information of acceleration to 0.
    ClearAccelometer

    Do While 1
      'Obtain the cumulative information of acceleration.
      sensorValue = GetAccelometer

      'If the acceleration over the threshold value is applied two times or more.
      If sensorValue( 0 ) > 2 Then
        'The maximum acceleration value among the applied acceleration over threshold value.
        D0 = sensorValue( 1 )

        Exit Do
      End If
    Loop
    Delay 1
  Loop	
End Sub

ID : 7318

<< Prev        Next >>