CANopenDemo
CANopenNode demo, tutorial and testing
|
Example object oriented access to the Object Dictionary variable. More...
#include "301/CO_ODinterface.h"
Go to the source code of this file.
Data Structures | |
struct | objectAccessOD_t |
Object declaration for objectAccessOD. More... | |
Functions | |
CO_ReturnError_t | objectAccessOD_init (objectAccessOD_t *thisObj, OD_entry_t *OD_demoRecord, uint32_t *errInfo) |
Initialize objectAccessOD object. | |
static float64_t | objectAccessOD_readAverage (objectAccessOD_t *thisObj) |
Read "average" variable from Object Dictionary. | |
Example object oriented access to the Object Dictionary variable.
This file is part of CANopenNode, an opensource CANopen Stack. Project home page is https://github.com/CANopenNode/CANopenNode. For more information on CANopen see http://www.can-cia.org/.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
CO_ReturnError_t objectAccessOD_init | ( | objectAccessOD_t * | thisObj, |
OD_entry_t * | OD_demoRecord, | ||
uint32_t * | errInfo ) |
Initialize objectAccessOD object.
thisObj | This object will be initialized. | |
OD_demoRecord | Object Dictionary entry for demoRecord. | |
[out] | errInfo | If OD entry is erroneous, errInfo indicates its index. |
|
inlinestatic |
Read "average" variable from Object Dictionary.
This is a demonstration of extended OD variable. OD variable is not accessed from memory location, because it does not exist. Average is calculated from internal values, so function access is necessary. "read" function specified by OD_extension_init() is called. For "read" function to use, "OD_IO_t io_average" structure has been initialized before. If objectAccessOD_readAverage() is used from mainline, it has to be protected with CO_LOCK_OD / CO_UNLOCK_OD macros as every access to OD variable from mainline.
thisObj | This object contains access information to "average" parameter |